/* Cascade Connect 2026 redesign
   A coastal control-room aesthetic: midnight navigation, mineral surfaces,
   tidal teal actions, and coral attention states. */

:root {
  --evergreen-950: #111f36;
  --evergreen-900: #172b49;
  --evergreen-800: #244a68;
  --evergreen-700: #2c6f7b;
  --warm-50: #f4f7fb;
  --warm-100: #eaf0f6;
  --warm-200: #d9e3ed;
  --warm-250: #cbd8e4;
  --warm-300: #bbcbd9;
  --ink-900: #172237;
  --ink-800: #24334b;
  --ink-700: #50627a;
  --ink-600: #62738a;
  --ink-500: #75859a;
  --ink-400: #8f9caf;
  --copper-500: #1c9c99;
  --copper-600: #167f82;
  --copper-650: #126f75;
  --copper-700: #0f626b;
  --error-700: #b6404e;
  --focus: #4aa8ff;
  --display-font: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  --font-display: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  --interface-font:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --shadow-panel: 0 18px 50px rgb(20 40 69 / 10%);
  --shadow-float: 0 24px 70px rgb(10 25 48 / 20%);
  --radius-sm: 8px;
  --radius-md: 12px;
  color-scheme: light;
}

html {
  background: var(--warm-50);
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(circle at 86% 8%, rgb(74 168 255 / 8%), transparent 31rem),
    linear-gradient(145deg, #f8fafd 0%, var(--warm-50) 46%, #eef4f8 100%);
}

::selection {
  color: #fff;
  background: #167f82;
}

.cascade-skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 9999;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  color: #fff;
  background: #172b49;
  font-size: 0.8rem;
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-150%);
  transition: transform 160ms ease;
}

.cascade-skip-link:focus {
  outline: 3px solid var(--focus);
  transform: translateY(0);
}

/* Application shell: the old horizontal menu becomes a true navigation rail. */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 17.5rem minmax(0, 1fr);
  background: transparent;
}

.app-shell__header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 17.5rem;
  height: 100vh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
  overflow-y: auto;
  padding: 1.35rem 1rem 1rem;
  border: 0;
  border-right: 1px solid rgb(255 255 255 / 9%);
  color: #edf6fb;
  background:
    radial-gradient(circle at 50% 0%, rgb(67 184 180 / 20%), transparent 18rem),
    linear-gradient(175deg, #111f36 0%, #0b1628 62%, #101d31 100%);
  box-shadow: 12px 0 40px rgb(15 31 54 / 10%);
}

.brand-lockup--workspace {
  width: 100%;
  min-height: 4.35rem;
  display: flex;
  padding: 0.2rem 0.55rem 1.25rem;
  border-bottom: 1px solid rgb(255 255 255 / 11%);
  color: #fff;
}

.brand-lockup--workspace .brand-lockup__mark {
  width: 2.65rem;
  height: 2.65rem;
  border: 1px solid rgb(255 255 255 / 32%);
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 8px 24px rgb(0 0 0 / 20%);
}

.brand-lockup--workspace strong {
  color: #fff;
  font: 650 1.03rem/1.1 var(--display-font);
  letter-spacing: 0.03em;
}

.brand-lockup--workspace small {
  color: #72d4ce;
  font-size: 0.62rem;
  letter-spacing: 0.23em;
}

.app-shell__nav {
  min-width: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: stretch;
  gap: 0.32rem;
  padding: 0.35rem 0;
}

.app-shell__nav::before {
  content: "Workspace";
  margin: 0 0.7rem 0.45rem;
  color: rgb(210 226 239 / 48%);
  font-size: 0.61rem;
  font-weight: 850;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.app-shell__nav > a[data-cascade-source="true"] {
  display: none !important;
}

.cascade-nav-groups {
  min-width: 0;
  display: grid;
  gap: 0.18rem;
}

.cascade-nav-group {
  min-width: 0;
}

.cascade-nav-trigger,
.app-shell__nav .cascade-nav-submenu a {
  width: 100%;
  min-width: 0;
  display: grid;
  align-items: center;
  border: 0;
  border-radius: 9px;
  color: rgb(232 242 249 / 72%);
  background: transparent;
  font-family: var(--interface-font);
  text-align: left;
  text-decoration: none;
  transition:
    color 160ms ease,
    background-color 160ms ease,
    transform 160ms ease;
}

.cascade-nav-trigger {
  min-height: 43px;
  grid-template-columns: 1.25rem minmax(0, 1fr) 1rem;
  gap: 0.58rem;
  padding: 0.58rem 0.68rem;
  font-size: 0.76rem;
  font-weight: 760;
  cursor: pointer;
}

.cascade-nav-label,
.app-shell__nav .cascade-nav-submenu a span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cascade-nav-icon {
  width: 1.05rem;
  height: 1.05rem;
  color: #72d4ce;
}

.cascade-nav-chevron {
  width: 0.9rem;
  height: 0.9rem;
  justify-self: end;
  color: rgb(232 242 249 / 42%);
  transition:
    transform 180ms ease,
    color 180ms ease;
}

.cascade-nav-trigger:hover,
.app-shell__nav .cascade-nav-submenu a:hover {
  border: 0;
  color: #fff;
  background: rgb(255 255 255 / 7%);
}

.cascade-nav-trigger:hover {
  transform: translateX(2px);
}

.cascade-nav-trigger.is-active {
  color: #fff;
  background: linear-gradient(
    90deg,
    rgb(28 156 153 / 27%),
    rgb(74 168 255 / 11%)
  );
  box-shadow: inset 3px 0 #58d1c7;
}

.cascade-nav-group.is-open .cascade-nav-chevron {
  color: #8ff0e7;
  transform: rotate(90deg);
}

.cascade-nav-submenu {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition:
    max-height 240ms cubic-bezier(0.2, 0.72, 0.3, 1),
    opacity 160ms ease;
}

.cascade-nav-group.is-open .cascade-nav-submenu {
  max-height: 22rem;
  opacity: 1;
}

.cascade-nav-submenu__inner {
  position: relative;
  display: grid;
  gap: 0.12rem;
  margin: 0.15rem 0 0.38rem;
  padding: 0.12rem 0 0.08rem 1.15rem;
}

.cascade-nav-submenu__inner::before {
  position: absolute;
  inset: 0.15rem auto 0.15rem 0.88rem;
  width: 1px;
  background: rgb(114 212 206 / 18%);
  content: "";
}

.app-shell__nav .cascade-nav-submenu a {
  min-height: 36px;
  grid-template-columns: 1.05rem minmax(0, 1fr);
  gap: 0.52rem;
  padding: 0.48rem 0.62rem;
  font-size: 0.69rem;
  font-weight: 680;
  line-height: 1.15;
}

.app-shell__nav .cascade-nav-submenu a::before {
  content: none;
}

.app-shell__nav .cascade-nav-submenu a .cascade-nav-icon {
  width: 0.9rem;
  height: 0.9rem;
  color: rgb(114 212 206 / 68%);
}

.app-shell__nav .cascade-nav-submenu a.is-active,
.app-shell__nav .cascade-nav-submenu a[aria-current="page"] {
  border: 0;
  color: #fff;
  background: rgb(255 255 255 / 9%);
  box-shadow: none;
}

.app-shell__nav .cascade-nav-submenu a.is-active .cascade-nav-icon,
.app-shell__nav .cascade-nav-submenu a[aria-current="page"] .cascade-nav-icon {
  color: #8ff0e7;
}

.app-shell__session {
  display: grid;
  align-items: stretch;
  gap: 0.6rem;
  padding: 1rem 0.7rem 0.2rem;
  border-top: 1px solid rgb(255 255 255 / 11%);
  color: rgb(232 242 249 / 68%);
  font-size: 0.7rem;
  line-height: 1.35;
}

.app-shell__session > span {
  overflow-wrap: anywhere;
}

.app-shell__session .text-button {
  width: 100%;
  min-height: 40px;
  justify-content: flex-start;
  margin: 0;
  border: 1px solid rgb(255 255 255 / 12%);
  padding: 0.55rem 0.65rem;
  color: #edf6fb;
  background: rgb(255 255 255 / 5%);
}

.app-shell__session .text-button:hover {
  border-color: rgb(114 212 206 / 35%);
  color: #fff;
  background: rgb(28 156 153 / 13%);
}

.app-shell__menu-button,
.app-shell__mobile-sign-out {
  display: none;
}

.app-shell__main,
.app-shell__main:has(> .people-workspace),
.app-shell__main:has(> .tools-page),
.app-shell__main:has(> .resources-workspace) {
  grid-column: 2;
  min-width: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: clamp(1.75rem, 3.2vw, 3.6rem) clamp(1.25rem, 3.4vw, 3.9rem);
}

.app-shell__main > * {
  animation: cascade-enter 360ms cubic-bezier(0.2, 0.72, 0.3, 1) both;
}

/* Workspace routing now lives in the sidebar; suppress duplicate page menus. */
.calendar-workspace__tabs,
.resources-workspace__nav,
.settings-page__index {
  display: none !important;
}

.resources-workspace__header,
.resources-workspace__header--overview {
  grid-template-columns: minmax(0, 1fr);
}

.resources-workspace__identity {
  width: fit-content;
  border: 1px solid var(--warm-200);
  border-radius: var(--radius-sm);
}

/* Typography and hierarchy */
.app-shell__main h1,
.settings-page__header h1 {
  font-family: var(--display-font);
  font-weight: 650;
  letter-spacing: -0.045em;
}

/* Let headings inherit each component's surface color. Dark feature panels
   deliberately set a light foreground, while light panels use the page ink. */

.eyebrow {
  color: var(--copper-650);
  font-weight: 850;
  letter-spacing: 0.16em;
}

/* Reusable surfaces */
.panel,
.transaction-table-wrap,
.transaction-overview,
.transaction-timeline,
.transaction-checklist,
.workspace-data-list,
.workspace-record-list,
.activity-list,
.workspace-empty-state,
.settings-section,
.settings-access-message {
  border-color: var(--warm-200);
  border-radius: var(--radius-md);
  background: rgb(255 255 255 / 86%);
  box-shadow: 0 12px 38px rgb(24 48 77 / 7%);
}

.content-card,
.client-card,
.reminder-card,
.note-card,
.tools-overview-card,
.resource-card {
  border-color: var(--warm-200);
  border-radius: var(--radius-md);
  background: rgb(255 255 255 / 86%);
  box-shadow: 0 8px 28px rgb(24 48 77 / 6%);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.content-card:hover,
.client-card:hover,
.note-card:hover,
.tools-overview-card:hover,
.resource-card:hover {
  border-color: #a9c8d9;
  box-shadow: 0 18px 44px rgb(24 48 77 / 11%);
  transform: translateY(-2px);
}

/* Buttons and form controls */
.primary-button,
.settings-primary-action {
  border-color: #126f75;
  border-radius: var(--radius-sm);
  color: #fff;
  background: linear-gradient(135deg, #167f82, #1c9c99);
  box-shadow: 0 9px 22px rgb(22 127 130 / 20%);
}

.primary-button:hover,
.settings-primary-action:hover {
  border-color: #0f626b;
  background: linear-gradient(135deg, #126f75, #168c88);
  box-shadow: 0 13px 28px rgb(22 127 130 / 25%);
}

.secondary-button,
.button--secondary,
.button--ghost,
.icon-button {
  border-color: var(--warm-250);
  border-radius: var(--radius-sm);
}

.app-shell__main input:not([type="checkbox"]):not([type="radio"]),
.app-shell__main select,
.app-shell__main textarea {
  border-color: var(--warm-300);
  border-radius: var(--radius-sm);
  background: rgb(255 255 255 / 92%);
  box-shadow: inset 0 1px 2px rgb(20 40 69 / 4%);
}

.app-shell__main input:not([type="checkbox"]):not([type="radio"]):focus,
.app-shell__main select:focus,
.app-shell__main textarea:focus {
  border-color: #4aa8ff;
  outline: 3px solid rgb(74 168 255 / 18%);
}

/* Local navigation and tables */
.local-tabs,
.transaction-tabs,
.settings-page__index {
  gap: 0.3rem;
  padding: 0.32rem;
  border: 1px solid var(--warm-200);
  border-radius: 10px;
  background: rgb(255 255 255 / 72%);
}

.local-tabs a,
.transaction-tabs button,
.settings-page__index a {
  border: 0;
  border-radius: 7px;
}

.local-tabs a:hover,
.local-tabs a.active,
.transaction-tabs button:hover,
.transaction-tabs button.is-active,
.settings-page__index a:hover {
  border: 0;
  color: var(--evergreen-950);
  background: #e5f3f4;
  box-shadow: inset 0 0 0 1px rgb(28 156 153 / 17%);
}

table th,
.transaction-table th,
.settings-access-table th {
  color: var(--ink-600);
  background: #eaf0f6;
}

table tbody tr:hover,
.transaction-table tbody tr:hover {
  background: rgb(225 240 246 / 52%);
}

.file-progress {
  border-radius: 999px;
  background: #dce7ee;
}

.file-progress span {
  border-radius: inherit;
  background: linear-gradient(90deg, #1c9c99, #4aa8ff);
}

/* People workspace: use the same editorial hierarchy and data rhythm as CRM. */
.people-workspace {
  gap: 0;
  animation: cascade-enter 360ms cubic-bezier(0.2, 0.72, 0.3, 1) both;
}

.people-workspace__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
  border: 0;
  background: transparent;
}

.people-workspace__intro {
  position: static;
  min-width: 0;
  overflow: visible;
  padding: 0;
  color: var(--ink-900);
  background: transparent;
}

.people-workspace__intro::after {
  content: none;
}

.people-workspace__intro .eyebrow {
  margin: 0 0 0.55rem;
  color: var(--copper-600);
}

.people-workspace__intro h1 {
  margin: 0;
  color: var(--evergreen-950);
  font: 400 clamp(2.25rem, 4vw, 3.8rem)/1 var(--display-font);
  letter-spacing: -0.038em;
}

.people-workspace__intro > p:not(.eyebrow) {
  max-width: 44rem;
  margin: 0.9rem 0 0;
  color: var(--ink-700);
  font-size: 0.92rem;
  line-height: 1.65;
}

.people-workspace__scope {
  gap: 0.4rem;
  margin-top: 0.95rem;
}

.people-workspace__scope span {
  border: 1px solid var(--warm-200);
  border-radius: 999px;
  padding: 0.28rem 0.52rem;
  color: var(--ink-700);
  background: rgb(255 255 255 / 70%);
  font-size: 0.58rem;
  letter-spacing: 0.065em;
}

.people-workspace__actions {
  width: min(100%, 31rem);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: end;
  gap: 0.6rem;
  padding: 0;
  background: transparent;
}

/* Payroll now belongs to Corporate navigation, not the People workspace. */
.people-workspace__actions a[href="/staff/payroll"] {
  display: none;
}

.people-action {
  min-height: 2.75rem;
  border-radius: var(--radius-sm);
  padding: 0.68rem 0.9rem;
  font-size: 0.74rem;
}

.people-action--primary {
  border-color: var(--evergreen-900);
  color: var(--warm-50);
  background: var(--evergreen-900);
  box-shadow: 0 8px 18px rgb(13 42 37 / 13%);
}

.people-action--secondary {
  border-color: var(--warm-200);
  color: var(--evergreen-900);
  background: rgb(255 255 255 / 72%);
}

.people-metrics {
  border: 1px solid var(--warm-200);
  background:
    radial-gradient(circle at 91% 12%, rgb(28 156 153 / 7%), transparent 15rem),
    rgb(255 255 255 / 68%);
}

.people-metric {
  grid-template-rows: auto auto auto;
  column-gap: 0.75rem;
  padding: 1.1rem 1.25rem;
  border-right: 1px solid var(--warm-200);
  box-shadow: none;
}

.people-metric:nth-child(1) {
  box-shadow: inset 0 3px #2c6f7b;
}
.people-metric:nth-child(2) {
  box-shadow: inset 0 3px #1c9c99;
}
.people-metric:nth-child(3) {
  box-shadow: inset 0 3px #4aa8ff;
}
.people-metric:nth-child(4) {
  box-shadow: inset 0 3px #75859a;
}

.people-metric svg {
  grid-row: 1 / 4;
  color: var(--copper-600);
}

.people-metric strong {
  font: 400 1.65rem/1 var(--display-font);
}

.people-metric span {
  margin-top: 0.22rem;
  font-size: 0.7rem;
  font-weight: 800;
}

.people-metric small {
  margin-top: 0.2rem;
  font-size: 0.67rem;
}

.people-directory {
  display: flex;
  flex-direction: column;
  border: 0;
  background: transparent;
}

.people-directory__header {
  order: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.4rem;
  padding: 0 0.1rem 0.6rem;
  border: 0;
  border-bottom: 1px solid var(--warm-200);
  color: var(--ink-500);
  background: transparent;
}

.people-directory__header .eyebrow {
  margin: 0 0 0.25rem;
  color: var(--copper-600);
  font-size: 0.58rem;
}

.people-directory__header h2 {
  margin: 0;
  color: var(--evergreen-950);
  font: 400 1.2rem/1 var(--display-font);
}

.people-directory__header > p {
  color: var(--ink-500);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.people-directory__header > p strong {
  color: var(--evergreen-950);
  font: 400 1.2rem/1 var(--display-font);
}

.people-filters {
  order: 1;
  grid-template-columns: minmax(16rem, 2fr) minmax(20rem, 1.35fr) minmax(
      10rem,
      0.75fr
    );
  align-items: end;
  gap: 0.7rem;
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--warm-200);
  background: rgb(255 255 255 / 72%);
}

.people-filters label > span,
.people-view-filter legend {
  color: var(--ink-700);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.09em;
}

.people-filters input,
.people-filters select,
.people-view-filter > div {
  min-height: 2.6rem;
  border-color: var(--warm-300);
  background: rgb(248 250 253 / 94%);
  font-size: 0.76rem;
}

.people-filters input:hover,
.people-filters select:hover {
  border-color: var(--ink-500);
}

.people-view-filter button {
  font-size: 0.68rem;
}

.people-view-filter button[aria-pressed="true"] {
  color: #fff;
  background: var(--evergreen-900);
}

.people-table-wrap {
  order: 3;
  border-right: 1px solid var(--warm-200);
  border-left: 1px solid var(--warm-200);
  background: rgb(255 255 255 / 70%);
}

.people-table {
  min-width: 72rem;
}

.people-table th {
  padding: 0.72rem 1rem;
  color: var(--ink-600);
  background: #eaf0f6;
  font-size: 0.6rem;
}

.people-sort-button {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-align: left;
  text-transform: inherit;
}

.people-sort-button:hover {
  color: var(--evergreen-900);
}

.people-sort-button:focus-visible {
  border-radius: 2px;
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

.people-sort-button > span {
  color: var(--copper-600);
  font-size: 0.75rem;
  line-height: 1;
}

.people-table td {
  padding: 1rem;
  font-size: 0.69rem;
  vertical-align: middle;
  transition: background-color 160ms ease;
}

.people-table tbody tr:hover {
  background: rgb(225 240 246 / 52%);
}

.people-row--agent td:first-child {
  box-shadow: inset 4px 0 0 var(--evergreen-700);
}

.people-row--staff td:first-child {
  box-shadow: inset 4px 0 0 var(--copper-500);
}

.people-avatar {
  width: 2.65rem;
  height: 2.65rem;
  border-color: var(--warm-200);
  color: var(--evergreen-900);
  background: linear-gradient(145deg, #e3edf4, #fff);
  font-size: 0.68rem;
}

.people-avatar--staff {
  border-color: rgb(28 156 153 / 28%);
  color: var(--copper-650);
  background: linear-gradient(145deg, #dff2f1, #fff);
}

.people-person-cell > div > strong,
.people-table td > strong {
  font-size: 0.78rem;
}

.people-kind,
.people-status {
  border-radius: 999px;
  padding: 0.2rem 0.46rem;
}

.people-kind--intern {
  color: var(--copper-700, var(--copper-600));
  background: rgb(164 95 56 / 12%);
}

.people-table [hidden] {
  display: none !important;
}

.people-pto-not-applicable {
  color: var(--ink-500);
}

.people-tenure--summary {
  color: var(--evergreen-950);
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.people-row-action {
  min-height: 2.35rem;
  border-radius: var(--radius-sm);
  padding: 0.46rem 0.62rem;
  background: rgb(255 255 255 / 86%);
}

@media (max-width: 1100px) {
  .people-workspace__header {
    align-items: stretch;
    flex-direction: column;
    gap: 1.25rem;
  }

  .people-workspace__actions {
    width: 100%;
    max-width: none;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .people-filters {
    grid-template-columns: minmax(16rem, 1fr) minmax(20rem, 1fr);
  }

  .people-filters__status {
    grid-column: 2;
  }
}

@media (max-width: 760px) {
  .people-workspace__actions,
  .people-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .people-metric:nth-child(2) {
    border-right: 0;
  }

  .people-metric:nth-child(-n + 2) {
    border-bottom: 1px solid var(--warm-200);
  }

  .people-filters {
    grid-template-columns: 1fr;
  }

  .people-filters__status {
    grid-column: auto;
  }
}

/* Agent editor: compact basic information, conditional payment details, and audit log. */
.agent-intake--edit .agent-intake-form {
  gap: 0.7rem;
}

.agent-intake--edit .agent-intake-section > header {
  gap: 0.55rem;
  padding: 0.7rem 0.85rem;
}

.agent-intake--edit .agent-intake-section__body {
  gap: 0.7rem;
  padding: 0.8rem;
}

.agent-intake--edit .agent-field {
  gap: 0.3rem;
}

.agent-intake--edit .agent-field input,
.agent-intake--edit .agent-field select {
  min-width: 0;
  min-height: 2.35rem;
  padding: 0.46rem 0.55rem;
  font-size: 0.76rem;
}

.agent-intake--edit .agent-form-grid--identity {
  display: grid;
  grid-template-columns: repeat(18, minmax(0, 1fr));
  align-items: start;
  gap: 0.55rem;
}

.agent-intake--edit .agent-form-grid--identity .agent-field {
  min-width: 0;
  flex: none !important;
}

.agent-field--employee,
.agent-field--tag,
.agent-field--license,
.agent-field--status {
  grid-column: span 2;
}

.agent-field--first-name,
.agent-field--middle-name {
  grid-column: span 3;
}

.agent-field--last-name {
  grid-column: span 4;
}

.agent-field--email {
  grid-column: span 5;
}

.agent-field--phone,
.agent-field--ssn,
.agent-field--license-expiry,
.agent-field--active-date {
  grid-column: span 3;
}

.agent-field--dre,
.agent-field--nmls {
  grid-column: span 2;
}

.agent-field--inactive-date {
  grid-column: span 3;
}

.agent-field--address-one {
  grid-column: span 8;
}

.agent-field--address-two {
  grid-column: span 7;
}

.agent-form-grid--identity:has(.agent-field--inactive-date)
  .agent-field--address-one {
  grid-column: span 7;
}

.agent-form-grid--identity:has(.agent-field--inactive-date)
  .agent-field--address-two {
  grid-column: span 5;
}

.agent-intake--edit .agent-payment-layout {
  grid-template-columns: minmax(21rem, 0.8fr) minmax(30rem, 1.2fr);
  align-items: start;
  gap: 0.7rem;
}

.agent-intake--edit .agent-payment-method > div {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.agent-intake--edit .agent-payment-method label {
  gap: 0.48rem;
  padding: 0.52rem 0.6rem;
}

.agent-payment-details {
  min-width: 0;
  display: grid;
  gap: 0.55rem;
}

.agent-payment-details--wire {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.agent-payment-details--check,
.agent-payment-details--zelle {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
}

.agent-payment-details .agent-check-delivery {
  min-height: 2.35rem;
  align-content: center;
  padding: 0.4rem 0.6rem;
}

.agent-intake--edit .agent-form-grid--commission {
  gap: 0.55rem;
}

.agent-change-log {
  border: 1px solid var(--warm-200);
  background: rgb(255 255 255 / 68%);
}

.agent-change-log > summary {
  min-height: 3.2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  color: var(--evergreen-950);
  background: var(--warm-100);
  cursor: pointer;
}

.agent-change-log > summary > span {
  display: grid;
  gap: 0.12rem;
}

.agent-change-log > summary strong {
  font-size: 0.76rem;
}

.agent-change-log > summary small {
  color: var(--ink-500);
  font-size: 0.61rem;
}

.agent-change-log > summary > b {
  margin-left: auto;
  border: 1px solid var(--warm-250);
  border-radius: 999px;
  padding: 0.18rem 0.45rem;
  color: var(--ink-600);
  font-size: 0.56rem;
  text-transform: uppercase;
}

.agent-change-log > ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.agent-change-log > ol > li {
  padding: 0.7rem 0.85rem;
  border-top: 1px solid var(--warm-200);
}

.agent-change-log li > header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.agent-change-log li > header > div {
  display: grid;
  gap: 0.15rem;
}

.agent-change-log li > header strong {
  color: var(--evergreen-950);
  font-size: 0.7rem;
}

.agent-change-log li > header span,
.agent-change-log li > header > span {
  color: var(--ink-500);
  font-size: 0.59rem;
  text-transform: uppercase;
}

.agent-change-log dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem 0.7rem;
  margin: 0;
}

.agent-change-log dl > div {
  min-width: 0;
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: 0.45rem;
}

.agent-change-log :is(dt, dd) {
  min-width: 0;
  margin: 0;
  font-size: 0.62rem;
  line-height: 1.4;
}

.agent-change-log dt,
.agent-change-log dd span {
  color: var(--ink-500);
}

.agent-change-log dd {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 0.35rem;
  overflow-wrap: anywhere;
}

.agent-change-log > p {
  margin: 0;
  padding: 0.8rem 0.85rem;
  border-top: 1px solid var(--warm-200);
  color: var(--ink-500);
  font-size: 0.65rem;
}

@media (max-width: 1100px) {
  .agent-intake--edit .agent-form-grid--identity {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .agent-intake--edit .agent-form-grid--identity .agent-field {
    grid-column: span 1;
  }

  .agent-intake--edit
    .agent-form-grid--identity
    :is(
      .agent-field--email,
      .agent-field--address-one,
      .agent-field--address-two
    ) {
    grid-column: span 2;
  }

  .agent-intake--edit .agent-payment-layout,
  .agent-payment-details--wire {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .agent-payment-method {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .agent-intake--edit .agent-form-grid--identity,
  .agent-intake--edit .agent-payment-layout,
  .agent-payment-details--wire,
  .agent-payment-details--check,
  .agent-payment-details--zelle,
  .agent-change-log dl {
    grid-template-columns: 1fr;
  }

  .agent-intake--edit .agent-form-grid--identity .agent-field,
  .agent-intake--edit
    .agent-form-grid--identity
    :is(
      .agent-field--email,
      .agent-field--address-one,
      .agent-field--address-two
    ),
  .agent-payment-method {
    grid-column: auto;
  }

  .agent-intake--edit .agent-payment-method > div,
  .agent-change-log dl > div {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .people-workspace__actions {
    grid-template-columns: 1fr;
  }

  .people-metrics {
    grid-template-columns: 1fr;
  }

  .people-metric {
    border-right: 0;
    border-bottom: 1px solid var(--warm-200);
  }

  .people-metric:last-child {
    border-bottom: 0;
  }

  .people-directory__header {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.45rem;
  }

  .people-view-filter > div {
    grid-auto-flow: row;
  }

  .people-view-filter button {
    border-right: 0;
    border-bottom: 1px solid var(--warm-200);
  }

  .people-view-filter button:last-child {
    border-bottom: 0;
  }
}

.stage-label,
.offer-document-status,
.people-status,
.agent-status,
.staff-status {
  border-radius: 999px;
}

.risk-label--urgent,
.checklist-status--blocked {
  color: #b6404e;
}

.risk-label--warning {
  color: #c15e42;
}

.settings-save-bar {
  border-color: #172b49;
  border-radius: 10px;
  background: rgb(17 31 54 / 96%);
  box-shadow: var(--shadow-float);
}

/* Keep the compensation form legible and aligned at portal content widths. */
#compensation .settings-grid--4 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
}

/* CurrencyAmountInput is itself a span; undo the legacy prefix rule that
   accidentally positioned the entire control on top of its label and hint. */
.settings-number-prefix > .currency-amount-input {
  position: relative;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  width: 100%;
  display: block;
  color: inherit;
  font: inherit;
  transform: none;
}

#compensation .settings-field {
  min-width: 0;
  grid-template-rows: auto auto 1fr;
}

#compensation .settings-field label {
  line-height: 1.35;
}

#compensation .settings-field small {
  max-width: 34rem;
}

@media (max-width: 680px) {
  #compensation .settings-grid--4 {
    grid-template-columns: 1fr;
  }
}

dialog,
.offer-cover-dialog,
.offer-listing-agent-dialog,
.pdf-password-dialog {
  border-color: var(--warm-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-float);
}

dialog::backdrop,
.offer-cover-dialog::backdrop,
.offer-listing-agent-dialog::backdrop,
.pdf-password-dialog::backdrop {
  background: rgb(9 20 37 / 68%);
}

/* Login is part of the same design language, not a separate microsite. */
.login-page {
  background:
    radial-gradient(circle at 88% 8%, rgb(74 168 255 / 12%), transparent 27rem),
    #f4f7fb;
}

.login-story {
  color: #f4f8fb;
  background:
    linear-gradient(rgb(255 255 255 / 3%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 3%) 1px, transparent 1px),
    radial-gradient(circle at 16% 82%, rgb(28 156 153 / 30%), transparent 31%),
    linear-gradient(155deg, #172b49, #0b1628 72%);
  background-size:
    42px 42px,
    42px 42px,
    auto,
    auto;
}

.login-story::after {
  border-color: rgb(114 212 206 / 25%);
  box-shadow:
    0 0 0 4.5rem rgb(74 168 255 / 5%),
    0 0 0 9rem rgb(28 156 153 / 4%);
}

.login-story .eyebrow,
.login-story__statement em {
  color: #72d4ce;
}

.login-story__detail {
  color: rgb(236 245 250 / 75%);
}

.login-panel h1,
.workspace-preview__main h1 {
  color: var(--evergreen-950);
  font-family: var(--display-font);
  font-weight: 650;
}

.demo-credentials {
  border-color: var(--warm-200);
  border-left-color: var(--copper-500);
  border-radius: var(--radius-sm);
  background: rgb(255 255 255 / 72%);
  box-shadow: 0 10px 30px rgb(24 48 77 / 6%);
}

@keyframes cascade-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .app-shell {
    display: block;
  }

  .app-shell__header {
    position: sticky;
    top: 0;
    width: 100%;
    height: auto;
    min-height: 68px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    overflow: visible;
    padding: 0.7rem 1rem;
    border-right: 0;
    border-bottom: 1px solid rgb(255 255 255 / 10%);
    background: rgb(13 27 48 / 97%);
    box-shadow: 0 10px 30px rgb(12 25 45 / 16%);
  }

  .brand-lockup--workspace {
    min-height: 0;
    padding: 0;
    border: 0;
  }

  .brand-lockup--workspace .brand-lockup__mark {
    width: 2.45rem;
    height: 2.45rem;
  }

  .app-shell__menu-button {
    width: 2.7rem;
    height: 2.7rem;
    display: grid;
    border: 1px solid rgb(255 255 255 / 16%);
    border-radius: 8px;
    color: #fff;
    background: rgb(255 255 255 / 7%);
  }

  .app-shell__nav {
    position: fixed;
    top: 68px;
    bottom: 0;
    left: 0;
    z-index: 60;
    width: min(20rem, calc(100vw - 2rem));
    display: none;
    align-items: stretch;
    flex-direction: column;
    overflow-y: auto;
    padding: 1.2rem 1rem;
    border: 0;
    background: linear-gradient(175deg, #111f36, #0b1628);
    box-shadow: 24px 0 60px rgb(9 20 37 / 36%);
  }

  .app-shell__nav--open {
    display: flex;
    animation: cascade-drawer 220ms ease-out both;
  }

  .app-shell__mobile-sign-out {
    min-height: 44px;
    display: block;
    margin-top: auto;
    border: 1px solid rgb(255 255 255 / 16%);
    border-radius: 8px;
    color: #fff;
    background: rgb(255 255 255 / 6%);
  }

  .app-shell__session {
    display: none;
  }

  .app-shell__main,
  .app-shell__main:has(> .people-workspace),
  .app-shell__main:has(> .tools-page),
  .app-shell__main:has(> .resources-workspace) {
    width: 100%;
    padding: 1.35rem 1rem 2.5rem;
  }
}

@keyframes cascade-drawer {
  from {
    opacity: 0;
    transform: translateX(-18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 560px) {
  .brand-lockup--workspace strong {
    font-size: 0.95rem;
  }

  .brand-lockup--workspace small {
    font-size: 0.55rem;
  }

  .local-tabs,
  .transaction-tabs,
  .settings-page__index {
    overflow-x: auto;
    border-radius: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* New-client intake: dense relationship context without turning the form
   into a wall of empty fields. */
.cascade-client-intake .cascade-native-value {
  display: none;
}

.cascade-client-intake .client-primary-name-source,
.cascade-client-intake .client-notes-source,
.cascade-client-intake .client-date-source,
.cascade-client-intake .cascade-phone-source,
.cascade-client-intake .cascade-email-source,
.cascade-client-intake .cascade-birthday-source,
.cascade-client-intake .cascade-birthday-source + input[type="hidden"] {
  display: none;
}

.cascade-client-intake .client-form-grid--relationship {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cascade-client-intake .client-basics-secondary {
  grid-template-columns: minmax(0, 1.25fr) minmax(12rem, 0.75fr);
}

.cascade-client-intake .client-person-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0.55rem;
}

.cascade-client-intake .client-person-grid > .client-field {
  grid-column: span 6;
  min-width: 0;
}

.cascade-client-intake
  .client-person-grid
  > .client-field
  > :is(input, select) {
  min-width: 0;
  width: 100%;
}

.cascade-client-intake
  .client-person-grid
  > .client-field:has(#cascade-client-name)
  > label,
.cascade-client-intake
  .client-person-grid
  > .client-field:has(#partner-name)
  > label,
.cascade-client-intake
  .client-person-grid
  > .client-field:has(#primary-preferred-name)
  > label,
.cascade-client-intake
  .client-person-grid
  > .client-field:has(#secondary-preferred-name)
  > label,
.cascade-client-intake
  .client-person-grid
  > .client-field:has(#client-email)
  > label,
.cascade-client-intake
  .client-person-grid
  > .client-field:has(#partner-email)
  > label,
.cascade-client-intake
  .client-person-grid
  > .client-field:has(#client-phone)
  > label,
.cascade-client-intake
  .client-person-grid
  > .client-field:has(#partner-phone)
  > label {
  width: 100%;
  min-width: 0;
  min-height: 1.5rem;
  line-height: 1.05;
  white-space: normal;
}

.cascade-client-intake
  .client-person-grid
  > .client-field:has(#cascade-client-name),
.cascade-client-intake .client-person-grid > .client-field:has(#partner-name) {
  grid-column: span 7;
}

.cascade-client-intake
  .client-person-grid
  > .client-field:has(#primary-preferred-name),
.cascade-client-intake
  .client-person-grid
  > .client-field:has(#secondary-preferred-name) {
  grid-column: span 5;
}

.cascade-client-intake .client-person-grid > .client-field:has(#client-email),
.cascade-client-intake .client-person-grid > .client-field:has(#partner-email) {
  grid-column: span 7;
}

.cascade-client-intake .client-person-grid > .client-field:has(#client-phone),
.cascade-client-intake .client-person-grid > .client-field:has(#partner-phone) {
  grid-column: span 5;
}

.cascade-client-intake
  .client-person-grid
  > .client-field:has(#primary-birthday),
.cascade-client-intake
  .client-person-grid
  > .client-field:has(#partner-birthday) {
  grid-column: span 3;
}

.cascade-client-intake
  .client-person-grid
  > .client-field:has(#primary-employer),
.cascade-client-intake
  .client-person-grid
  > .client-field:has(#partner-employer) {
  grid-column: span 4;
}

.cascade-client-intake
  .client-person-grid
  > .client-field:has(#primary-work-location),
.cascade-client-intake
  .client-person-grid
  > .client-field:has(#partner-work-location) {
  grid-column: span 5;
}

.cascade-client-intake
  .client-person-grid
  > .client-field:has(#primary-linkedin),
.cascade-client-intake
  .client-person-grid
  > .client-field:has(#secondary-linkedin) {
  grid-column: span 8;
}

.cascade-client-intake
  .client-person-grid
  > .client-social-field:not(.client-social-field--linkedin) {
  grid-column: span 6;
}

.cascade-client-intake #primary-birthday,
.cascade-client-intake #partner-birthday {
  min-width: 0;
  width: 100%;
}

.client-social-field {
  position: relative;
}

.client-social-field input {
  padding-right: 2rem !important;
}

.client-inline-remove,
.client-relationship-remove {
  display: grid;
  place-items: center;
  border: 0;
  color: var(--ink-500);
  background: transparent;
  font: 500 1.15rem/1 var(--interface-font);
  cursor: pointer;
}

.client-inline-remove {
  position: absolute;
  right: 0.32rem;
  bottom: 0.34rem;
  width: 1.7rem;
  height: 1.7rem;
}

.client-inline-remove:hover,
.client-relationship-remove:hover {
  color: var(--error-700);
}

.client-social-field--linkedin .client-inline-remove {
  display: none;
}

.client-social-adder {
  position: relative;
  grid-column: span 4;
  align-self: end;
  width: fit-content;
  margin: 0 0 0.65rem;
}

.client-social-adder summary {
  color: var(--copper-650);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  list-style: none;
}

.client-social-adder summary::-webkit-details-marker {
  display: none;
}

.client-social-adder summary::before {
  margin-right: 0.28rem;
  content: "+";
}

.client-social-adder__menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  z-index: 10;
  min-width: 10rem;
  display: grid;
  overflow: hidden;
  border: 1px solid var(--warm-200);
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: var(--shadow-panel);
}

.client-social-adder__menu button {
  border: 0;
  border-bottom: 1px solid var(--warm-100);
  padding: 0.55rem 0.65rem;
  color: var(--ink-800);
  background: #fff;
  font: 700 0.68rem/1.2 var(--interface-font);
  text-align: left;
  cursor: pointer;
}

.client-social-adder__menu button:last-child {
  border-bottom: 0;
}

.client-social-adder__menu button:hover {
  background: var(--warm-100);
}

.client-relationship-lower {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.7rem;
  align-items: stretch;
}

.client-notes-compact,
.client-relationship-map {
  min-width: 0;
  border: 1px solid var(--warm-200);
  padding: 0.7rem;
  background: rgb(255 255 255 / 58%);
}

.client-notes-compact textarea {
  min-height: 4.25rem;
  height: calc(100% - 1.1rem);
  resize: vertical;
}

.client-relationship-map > header,
.client-contact-relationships > header,
.client-important-dates > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.55rem;
}

.client-relationship-map h3,
.client-contact-relationships h3,
.client-important-dates h3 {
  margin: 0.12rem 0 0;
  color: var(--evergreen-950);
  font: 650 0.88rem/1.2 var(--display-font);
}

.client-relationship-map .client-secondary-action,
.client-contact-relationships .client-secondary-action,
.client-important-dates .client-secondary-action {
  min-height: 2rem;
  padding: 0.35rem 0.55rem;
  font-size: 0.62rem;
  white-space: nowrap;
}

.client-relationship-rows {
  display: grid;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 0.15rem;
}

.client-contact-relationships {
  margin-top: 0.65rem;
  border-top: 1px solid var(--warm-200);
  padding-top: 0.6rem;
}

.client-relationship-row {
  min-width: 0;
  display: grid;
  grid-template-columns: max-content minmax(7.5rem, 0.65fr) max-content minmax(
      10rem,
      1.35fr
    ) 1.5rem;
  align-items: center;
  gap: 0.3rem;
}

.client-contact-relationships .client-relationship-row > input {
  grid-column: auto;
}

.client-contact-relationships .client-relationship-remove {
  grid-column: auto;
  grid-row: auto;
}

.client-relationship-row > span {
  color: var(--ink-600);
  font-size: 0.66rem;
  font-weight: 700;
  white-space: nowrap;
}

.client-relationship-row :is(input, select) {
  width: 100%;
  min-height: 2.15rem !important;
  padding: 0.38rem 0.48rem !important;
  font-size: 0.7rem !important;
}

.client-family-grid,
.client-household-layout {
  display: grid;
  grid-template-columns: minmax(14rem, 0.7fr) minmax(0, 1.8fr);
  align-items: start;
  gap: 0.7rem;
}

.client-household-layout > .client-form-columns {
  grid-column: 1 / -1;
}

.client-household-layout > .client-important-dates {
  grid-column: 1;
}

.client-household-layout > .client-children-intake {
  grid-column: 2;
}

.client-important-dates,
.cascade-client-intake .client-children-intake {
  min-width: 0;
  border: 1px solid var(--warm-200);
  background: rgb(255 255 255 / 58%);
}

.client-important-dates {
  padding: 0.7rem;
}

.client-important-dates__body {
  display: grid;
  gap: 0.55rem;
}

.client-milestone-rows {
  display: grid;
  gap: 0.45rem;
}

.client-milestone-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(5.75rem, 0.7fr) 1.5rem;
  align-items: end;
  gap: 0.35rem;
  border-top: 1px solid var(--warm-200);
  padding-top: 0.5rem;
}

.client-milestone-row .client-field {
  min-width: 0;
}

.client-milestone-row input {
  width: 100%;
  min-width: 0;
}

.client-milestone-remove {
  width: 1.5rem;
  height: 2.15rem;
  display: grid;
  place-items: center;
  border: 0;
  color: var(--ink-500);
  background: transparent;
  font: 500 1.15rem/1 var(--interface-font);
  cursor: pointer;
}

.client-milestone-remove:hover {
  color: var(--error-700);
}

.client-milestone-remove:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.client-important-dates .client-field small {
  display: none;
}

.cascade-client-intake .client-children-intake__note {
  padding: 0.45rem 0.65rem;
  font-size: 0.61rem;
  line-height: 1.4;
}

.cascade-client-intake .client-child-rows {
  grid-template-columns: 1fr;
  gap: 0;
  overflow-x: auto;
  padding: 0 0.55rem 0.55rem;
}

.cascade-client-intake .client-member-table-head,
.cascade-client-intake .client-child-row {
  min-width: 42rem;
  grid-template-columns: 6.5rem minmax(6rem, 1fr) 3.5rem 6.5rem 5rem minmax(
      7rem,
      1fr
    ) 2rem;
  align-items: center;
  gap: 0.42rem;
}

.cascade-client-intake .client-member-table-head {
  display: grid;
  margin: 0 0.55rem;
  border-bottom: 1px solid var(--warm-200);
  padding: 0.48rem 0 0.38rem;
  color: var(--ink-500);
  font-size: 0.56rem;
  font-weight: 850;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.cascade-client-intake .client-child-row {
  border: 0;
  border-bottom: 1px solid var(--warm-200);
  border-radius: 0;
  padding: 0.46rem 0;
  background: transparent;
  box-shadow: none;
}

.cascade-client-intake .client-child-row:last-child {
  border-bottom: 0;
}

.cascade-client-intake .client-child-row legend,
.cascade-client-intake .client-child-row .client-field > label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.cascade-client-intake .client-household-member-type select {
  min-width: 0;
  width: 100%;
  min-height: 2.2rem !important;
  height: 2.2rem;
}

.cascade-client-intake .client-child-row[hidden] {
  display: none !important;
}

.cascade-client-intake .client-current-property-row--primary {
  grid-template-columns: minmax(10.5rem, 0.72fr) minmax(18rem, 1.4fr) 7.25rem;
}

.cascade-client-intake #current-home-notes {
  min-height: 2.2rem;
  height: 2.2rem;
  resize: vertical;
}

.cascade-client-intake .client-property-last-updated input[readonly] {
  color: var(--ink-700);
  background: var(--warm-100);
}

.cascade-client-intake .client-child-birth-year {
  min-height: 2.2rem;
  display: grid;
  grid-column: 5;
  place-items: center;
  border: 1px solid var(--warm-200);
  color: var(--evergreen-950);
  background: var(--warm-100);
  font-size: 0.68rem;
}

.cascade-client-intake .client-child-birth-year span {
  display: none;
}

.cascade-client-intake .client-child-remove {
  grid-column: 7;
}

.cascade-client-intake .client-child-row .client-field:first-of-type,
.cascade-client-intake .client-child-row .client-field:nth-of-type(2),
.cascade-client-intake .client-child-row .client-field:nth-of-type(3),
.cascade-client-intake .client-child-row .client-field:nth-of-type(4),
.cascade-client-intake .client-child-row .client-field:nth-of-type(5) {
  grid-column: auto;
}

.cascade-client-intake .client-family-member-notes input {
  min-width: 0;
  width: 100%;
}

.cascade-client-intake .client-family-member-notes {
  grid-column: 6 !important;
}

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

  .client-relationship-lower,
  .client-family-grid,
  .client-household-layout {
    grid-template-columns: 1fr;
  }

  .client-household-layout > .client-important-dates,
  .client-household-layout > .client-children-intake {
    grid-column: 1;
  }
}

@media (max-width: 720px) {
  .cascade-client-intake .client-form-grid--relationship,
  .cascade-client-intake .client-basics-secondary,
  .cascade-client-intake .client-person-grid {
    grid-template-columns: 1fr;
  }

  .cascade-client-intake .client-person-grid > .client-field {
    grid-column: auto !important;
  }

  .cascade-client-intake .client-social-adder {
    grid-column: auto;
    margin: 0;
  }

  .cascade-client-intake .client-current-property-row--primary {
    grid-template-columns: 1fr;
  }

  .cascade-client-intake .client-member-table-head,
  .cascade-client-intake .client-child-row {
    min-width: 42rem;
  }
}

/* Staff employment record: dense, scannable profile and contact ledger */
.staff-edit__header {
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 0.65rem;
}

.staff-edit__header h1 {
  font-size: clamp(1.55rem, 2.3vw, 2.15rem);
  line-height: 1.05;
}

.staff-edit__header > div:first-child > p:last-child {
  max-width: 52rem;
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
  line-height: 1.4;
}

.staff-edit__current {
  min-width: 12rem;
  padding: 0.55rem 0.7rem;
}

.staff-edit__metrics {
  gap: 0;
  margin-bottom: 0.65rem;
  overflow: hidden;
  border: 1px solid var(--warm-200);
  border-radius: var(--radius-md);
  background: rgb(255 255 255 / 68%);
}

.staff-edit__metrics article {
  min-height: 0;
  border: 0;
  border-left: 1px solid var(--warm-200);
  border-radius: 0;
  padding: 0.55rem 0.72rem;
  box-shadow: none;
}

.staff-edit__metrics article:first-child {
  border-left: 0;
}

.staff-edit__metrics article > span,
.staff-edit__metrics article > small {
  font-size: 0.58rem;
  line-height: 1.3;
}

.staff-edit__metrics article > strong {
  margin-block: 0.12rem;
  font-size: 1rem;
  line-height: 1.15;
}

.staff-edit-card {
  margin-bottom: 0.65rem;
}

.staff-edit-card__header {
  gap: 0.55rem;
  padding: 0.62rem 0.78rem;
}

.staff-edit-card__header > svg {
  width: 1rem;
  height: 1rem;
}

.staff-edit-card__header h2 {
  font-size: 1rem;
  line-height: 1.15;
}

.staff-edit-card__header .eyebrow {
  margin-bottom: 0.12rem;
  font-size: 0.55rem;
}

.staff-record-details {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.staff-record-details > div {
  min-height: 0;
  padding: 0.5rem 0.68rem;
}

.staff-record-details dt {
  font-size: 0.55rem;
  line-height: 1.25;
}

.staff-record-details dd {
  margin-top: 0.16rem;
  font-size: 0.68rem;
  line-height: 1.35;
}

.staff-contact-summary {
  display: grid;
  grid-template-columns: minmax(13rem, 0.75fr) minmax(20rem, 1.25fr);
  border-top: 1px solid var(--warm-200);
}

.staff-contact-summary > section {
  min-width: 0;
  padding: 0.58rem 0.72rem 0.65rem;
}

.staff-contact-summary > section + section {
  border-left: 1px solid var(--warm-200);
}

.staff-contact-summary header,
.staff-contact-summary li,
.staff-contact-summary li > div {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.staff-contact-summary header {
  justify-content: space-between;
  margin-bottom: 0.32rem;
}

.staff-contact-summary h3 {
  margin: 0;
  color: var(--evergreen-950);
  font-size: 0.67rem;
}

.staff-contact-summary header > span {
  min-width: 1.2rem;
  border-radius: 999px;
  padding: 0.12rem 0.32rem;
  color: var(--ink-600);
  background: var(--warm-100);
  font-size: 0.55rem;
  font-weight: 800;
  text-align: center;
}

.staff-contact-summary :is(ul, p) {
  margin: 0;
  padding: 0;
  list-style: none;
}

.staff-contact-summary p {
  color: var(--ink-600);
  font-size: 0.65rem;
}

.staff-contact-summary li {
  justify-content: space-between;
  min-width: 0;
  padding: 0.25rem 0;
  border-top: 1px solid var(--warm-150);
  font-size: 0.65rem;
}

.staff-contact-summary li:first-child {
  border-top: 0;
}

.staff-contact-summary li > div {
  min-width: 0;
  flex-wrap: wrap;
}

.staff-contact-summary li > div:last-child {
  justify-content: flex-end;
}

.staff-contact-summary li span {
  color: var(--ink-600);
}

.staff-contact-summary a {
  color: var(--evergreen-800);
  font-weight: 750;
  overflow-wrap: anywhere;
}

.staff-profile-editor {
  padding: 0.72rem 0.78rem;
}

.staff-profile-editor__fields {
  gap: 0.55rem 0.6rem;
}

.staff-contact-editors {
  display: grid;
  grid-template-columns: minmax(17rem, 0.7fr) minmax(34rem, 1.3fr);
  gap: 0.65rem;
  margin-top: 0.7rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--warm-200);
}

.staff-contact-editor {
  min-width: 0;
  border: 1px solid var(--warm-200);
  border-radius: var(--radius-sm);
  background: rgb(255 255 255 / 54%);
}

.staff-contact-editor > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  padding: 0.5rem 0.58rem;
  border-bottom: 1px solid var(--warm-200);
}

.staff-contact-editor h3,
.staff-contact-editor p {
  margin: 0;
}

.staff-contact-editor h3 {
  color: var(--evergreen-950);
  font-size: 0.7rem;
}

.staff-contact-editor header p {
  margin-top: 0.08rem;
  color: var(--ink-600);
  font-size: 0.56rem;
  line-height: 1.3;
}

.staff-contact-editor .staff-secondary-action {
  min-height: 2.15rem;
  padding: 0.42rem 0.58rem;
  font-size: 0.65rem;
}

.staff-phone-editor-list,
.staff-emergency-editor-list {
  display: grid;
}

.staff-phone-editor-row,
.staff-emergency-editor-row {
  display: grid;
  align-items: end;
  gap: 0.42rem;
  padding: 0.5rem 0.58rem;
  border-top: 1px solid var(--warm-150);
}

.staff-phone-editor-row:first-child,
.staff-emergency-editor-row:first-child {
  border-top: 0;
}

.staff-phone-editor-row {
  grid-template-columns: minmax(6rem, 0.55fr) minmax(9rem, 1fr) auto;
}

.staff-emergency-editor-row {
  grid-template-columns: 1.1fr 0.85fr 1fr 1fr 1.15fr auto;
}

.staff-contact-editor .staff-field {
  grid-column: auto;
}

.staff-contact-editor .staff-field label {
  margin-bottom: 0.18rem;
  font-size: 0.56rem;
}

.staff-contact-editor :is(input, select) {
  min-height: 2.15rem;
  padding: 0.38rem 0.48rem;
  font-size: 0.67rem;
}

.staff-contact-remove-action {
  min-height: 2.15rem;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 0.38rem 0.48rem;
  color: var(--error-700);
  background: transparent;
  font-size: 0.62rem;
  font-weight: 800;
}

.staff-contact-remove-action:hover {
  background: #f8eae5;
}

.staff-contact-remove-action:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.staff-contact-editor__empty {
  padding: 0.58rem;
  color: var(--ink-600);
  font-size: 0.65rem;
}

.staff-profile-editor > footer {
  margin-top: 0.7rem;
}

[aria-labelledby="staff-title-history-heading"] .staff-history-table {
  min-width: 0;
  table-layout: fixed;
}

[aria-labelledby="staff-title-history-heading"] .staff-history-table th,
[aria-labelledby="staff-title-history-heading"] .staff-history-table td {
  padding: 0.46rem 0.72rem;
}

[aria-labelledby="staff-title-history-heading"]
  .staff-history-table
  th:first-child {
  width: 48%;
}

[aria-labelledby="staff-title-history-heading"]
  .staff-history-table
  th:last-child {
  width: 3.2rem;
}

.staff-title-dates {
  color: var(--ink-600);
  font-size: 0.67rem;
  white-space: nowrap;
}

.staff-title-dates.is-current {
  color: var(--evergreen-800);
  font-weight: 800;
}

[aria-labelledby="staff-title-history-heading"] .staff-inline-editor {
  padding: 0.62rem 0.75rem 0.7rem;
}

@media (max-width: 1100px) {
  .staff-contact-editors {
    grid-template-columns: 1fr;
  }

  .staff-emergency-editor-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 850px) {
  .staff-record-details {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .staff-contact-summary {
    grid-template-columns: 1fr;
  }

  .staff-contact-summary > section + section {
    border-top: 1px solid var(--warm-200);
    border-left: 0;
  }
}

@media (max-width: 620px) {
  .staff-edit__header {
    align-items: stretch;
  }

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

  .staff-edit__metrics article:nth-child(3) {
    border-left: 0;
  }

  .staff-edit__metrics article:nth-child(n + 3) {
    border-top: 1px solid var(--warm-200);
  }

  .staff-record-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .staff-record-details > div.is-wide {
    grid-column: span 2;
  }

  .staff-phone-editor-row,
  .staff-emergency-editor-row {
    grid-template-columns: 1fr;
  }

  .staff-contact-remove-action {
    justify-self: start;
  }

  .staff-contact-summary li,
  .staff-contact-summary li > div:last-child {
    align-items: flex-start;
    flex-direction: column;
  }

  [aria-labelledby="staff-title-history-heading"]
    .staff-history-table
    th:first-child {
    width: 42%;
  }
}

/* Corporate staff requests: approval queues and payroll handoff */
.corporate-request-page {
  min-width: 0;
}

.corporate-request-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin: 1.35rem 0 1rem;
}

.corporate-request-metrics article {
  min-width: 0;
  display: grid;
  gap: 0.18rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--warm-200);
  border-radius: var(--radius-md);
  background: rgb(255 255 255 / 86%);
  box-shadow: 0 10px 28px rgb(20 40 69 / 6%);
}

.corporate-request-metrics strong {
  color: var(--evergreen-900);
  font-family: var(--display-font);
  font-size: clamp(1.55rem, 2.4vw, 2.15rem);
  line-height: 1;
}

.corporate-request-metrics span {
  color: var(--ink-600);
  font-size: 0.72rem;
  font-weight: 750;
}

.corporate-request-toolbar {
  min-width: 0;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--warm-200);
  border-radius: var(--radius-sm);
  background: var(--warm-100);
}

.corporate-request-toolbar label {
  min-width: min(100%, 14rem);
  display: grid;
  gap: 0.32rem;
}

.corporate-request-toolbar label > span {
  color: var(--ink-700);
  font-size: 0.65rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.corporate-request-toolbar select {
  min-height: 2.6rem;
  border: 1px solid var(--warm-300);
  border-radius: var(--radius-sm);
  padding: 0.55rem 2.25rem 0.55rem 0.7rem;
  color: var(--ink-900);
  background: #fff;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
}

.corporate-request-toolbar a {
  min-height: 2.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border-radius: var(--radius-sm);
  padding: 0.62rem 0.9rem;
  color: #fff;
  background: var(--evergreen-900);
  font-size: 0.75rem;
  font-weight: 800;
  text-decoration: none;
}

.corporate-request-toolbar :is(select, a):focus-visible,
.request-action:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.corporate-request-list {
  display: grid;
  gap: 0.8rem;
}

.corporate-request-card {
  min-width: 0;
  display: grid;
  gap: 0.9rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--warm-200);
  border-left: 4px solid var(--copper-600);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: 0 12px 34px rgb(20 40 69 / 7%);
}

.corporate-request-card--reimbursement {
  border-left-color: var(--evergreen-800);
}

.corporate-request-card > header,
.corporate-request-card > header > div,
.corporate-request-card > footer {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.corporate-request-card > header {
  justify-content: space-between;
}

.corporate-request-card > header > div > div {
  min-width: 0;
  display: grid;
  gap: 0.12rem;
}

.corporate-request-card > header strong {
  overflow-wrap: anywhere;
  color: var(--ink-900);
  font-size: 0.91rem;
}

.corporate-request-card
  > header
  span:not(.staff-status, .corporate-request-card__icon) {
  color: var(--ink-600);
  font-size: 0.68rem;
  font-weight: 650;
}

.corporate-request-card__icon {
  flex: 0 0 auto;
  width: 2.35rem;
  height: 2.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--copper-700);
  background: #e5f5f4;
}

.corporate-request-card dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0;
}

.corporate-request-card dl > div {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 0.15rem;
  padding: 0.65rem 0.72rem;
  border-radius: var(--radius-sm);
  background: var(--warm-50);
}

.corporate-request-card dt {
  color: var(--ink-600);
  font-size: 0.61rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.corporate-request-card dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink-900);
  font-size: 0.78rem;
  font-weight: 750;
}

.corporate-request-card dd a,
.staff-portal-records li a {
  display: block;
  width: fit-content;
  margin-top: 0.2rem;
  color: var(--teal-700);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.corporate-request-card dd a:hover,
.staff-portal-records li a:hover {
  color: var(--evergreen-900);
}

.corporate-request-card > p {
  margin: 0;
  color: var(--ink-700);
  font-size: 0.77rem;
  line-height: 1.55;
}

.corporate-request-card > p > :is(strong, span) {
  display: block;
  margin-top: 0.35rem;
}

.corporate-request-card__hold {
  width: fit-content;
  border: 1px solid color-mix(in srgb, var(--error-700) 30%, transparent);
  border-radius: 999px;
  padding: 0.16rem 0.5rem;
  color: var(--error-700);
  background: #f8eae5;
  font-size: 0.64rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.corporate-request-card > footer {
  justify-content: flex-end;
  padding-top: 0.15rem;
  border-top: 1px solid var(--warm-100);
}

.corporate-request-card > footer > span {
  margin-right: auto;
  color: var(--error-700);
  font-size: 0.68rem;
  font-weight: 750;
}

.request-action {
  min-height: 2.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  padding: 0.58rem 0.78rem;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 850;
  cursor: pointer;
}

.request-action--approve {
  border: 1px solid var(--evergreen-900);
  color: #fff;
  background: var(--evergreen-900);
}

.request-action--decline {
  border: 1px solid var(--error-700);
  color: var(--error-700);
  background: #fff;
}

.request-action:hover:not(:disabled) {
  filter: brightness(0.9);
}

.request-action:disabled {
  border-color: var(--warm-300);
  color: var(--ink-500);
  background: var(--warm-100);
  cursor: not-allowed;
}

.staff-status--included {
  color: #0a645f;
  background: #dff3ef;
}

.corporate-request-empty {
  margin: 0;
  padding: 2.4rem 1rem;
  border: 1px dashed var(--warm-300);
  border-radius: var(--radius-md);
  color: var(--ink-600);
  background: rgb(255 255 255 / 65%);
  font-size: 0.82rem;
  text-align: center;
}

/* New pay stub: show exactly what approved staff requests will be imported. */
.payroll-import-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.payroll-import-summary > article {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 0.8rem;
  border: 1px solid var(--warm-200);
  border-radius: var(--radius-sm);
  color: var(--evergreen-800);
  background: var(--warm-50);
}

.payroll-import-summary > article > div {
  min-width: 0;
  display: grid;
  gap: 0.1rem;
}

.payroll-import-summary strong {
  color: var(--ink-900);
  font-size: 0.78rem;
}

.payroll-import-summary span,
.payroll-import-summary > p {
  color: var(--ink-600);
  font-size: 0.67rem;
  line-height: 1.45;
}

.payroll-import-summary > p,
.payroll-import-summary > ul {
  grid-column: 1 / -1;
}

.payroll-import-summary > p {
  margin: 0;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-sm);
  background: var(--warm-50);
}

.payroll-import-summary > ul {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.payroll-import-summary li {
  min-width: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.48rem 0.65rem;
  border-bottom: 1px solid var(--warm-100);
}

.payroll-import-summary li span {
  max-width: 60%;
  overflow-wrap: anywhere;
  text-align: right;
}

@media (max-width: 820px) {
  .corporate-request-card dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .corporate-request-metrics,
  .payroll-import-summary {
    grid-template-columns: 1fr;
  }

  .corporate-request-toolbar,
  .corporate-request-card > header,
  .corporate-request-card > footer,
  .payroll-import-summary li {
    align-items: stretch;
    flex-direction: column;
  }

  .corporate-request-toolbar label,
  .corporate-request-toolbar a,
  .request-action {
    width: 100%;
  }

  .corporate-request-card dl {
    grid-template-columns: 1fr;
  }

  .corporate-request-card > footer > span {
    margin-right: 0;
  }

  .payroll-import-summary > p,
  .payroll-import-summary > ul {
    grid-column: auto;
  }

  .payroll-import-summary li span {
    max-width: none;
    text-align: left;
  }
}

/* Agent editor: compact identity and effective-dated compensation terms */
.agent-intake--edit .agent-intake__intro {
  max-width: 58rem;
}

.agent-form-grid--identity {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.7rem;
}

.agent-form-grid--identity .agent-field {
  flex: 0 1 auto;
}

.agent-field--employee,
.agent-field--abbreviation {
  flex-basis: 7.25rem !important;
}

.agent-field--record-type,
.agent-field--status {
  flex-basis: 9rem !important;
}

.agent-field--id-type {
  flex-basis: 11rem !important;
}

.agent-field--name {
  flex: 1 1 13rem !important;
}

.agent-field--email {
  flex: 1.25 1 16rem !important;
}

.agent-field--id-number {
  flex: 1 1 13rem !important;
}

.agent-form-grid--address {
  grid-template-columns: minmax(16rem, 1.25fr) minmax(14rem, 1fr);
}

.agent-form-grid--tenure {
  grid-template-columns: repeat(2, minmax(12rem, 18rem));
}

.agent-form-grid--commission {
  grid-template-columns: minmax(9rem, 0.65fr) minmax(11rem, 0.75fr) minmax(
      13rem,
      1fr
    ) minmax(13rem, 1fr);
  align-items: start;
}

.agent-field-hint {
  color: var(--ink-500);
  font-size: 0.62rem;
  line-height: 1.4;
}

.agent-payment-layout {
  display: grid;
  grid-template-columns: minmax(20rem, 1.25fr) minmax(15rem, 0.75fr);
  align-items: end;
  gap: 1rem;
}

.agent-payment-method {
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.agent-payment-method legend {
  margin-bottom: 0.4rem;
  color: var(--ink-700);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.agent-payment-method > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.agent-payment-method label {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.6rem;
  border: 1px solid var(--warm-250);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.75rem;
  color: var(--ink-700);
  background: rgb(255 255 255 / 72%);
  cursor: pointer;
}

.agent-payment-method label.is-selected {
  border-color: var(--copper-500);
  background: #e5f3f4;
  box-shadow: inset 3px 0 var(--copper-500);
}

.agent-payment-method input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--copper-600);
}

/* Staff compensation revisions: keep the six related values together. */
.staff-edit-card[aria-labelledby="staff-comp-history-heading"]
  .staff-inline-editor
  .staff-form-grid--2 {
  grid-template-columns:
    minmax(6.75rem, 0.72fr)
    minmax(6.75rem, 0.72fr)
    minmax(7.25rem, 0.8fr)
    minmax(7.25rem, 0.8fr)
    minmax(8rem, 1fr)
    minmax(8rem, 1fr);
  align-items: start;
  gap: 0.55rem;
}

.staff-edit-card[aria-labelledby="staff-comp-history-heading"]
  .staff-inline-editor
  .staff-field {
  min-width: 0;
}

.staff-edit-card[aria-labelledby="staff-comp-history-heading"]
  .staff-inline-editor
  .staff-field
  > label {
  min-height: 1.8rem;
  align-items: flex-end;
  line-height: 1.25;
}

.staff-edit-card[aria-labelledby="staff-comp-history-heading"]
  .staff-inline-editor
  .staff-field
  input {
  min-width: 0;
}

@media (max-width: 1100px) {
  .staff-edit-card[aria-labelledby="staff-comp-history-heading"]
    .staff-inline-editor
    .staff-form-grid--2 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .staff-edit-card[aria-labelledby="staff-comp-history-heading"]
    .staff-inline-editor
    .staff-form-grid--2 {
    grid-template-columns: 1fr;
  }

  .staff-edit-card[aria-labelledby="staff-comp-history-heading"]
    .staff-inline-editor
    .staff-field
    > label {
    min-height: 0;
  }
}

.agent-payment-method label span {
  display: grid;
  gap: 0.18rem;
}

.agent-payment-method strong {
  color: var(--evergreen-950);
  font-size: 0.76rem;
}

.agent-payment-method small {
  color: var(--ink-600);
  font-size: 0.62rem;
  line-height: 1.35;
}

.agent-check-delivery {
  min-width: 0;
  display: grid;
  gap: 0.22rem;
  border: 1px solid var(--warm-200);
  border-left: 3px solid var(--copper-500);
  padding: 0.72rem 0.82rem;
  background: var(--warm-100);
}

.agent-check-delivery span {
  color: var(--ink-600);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.agent-check-delivery strong {
  color: var(--evergreen-950);
  font-size: 0.78rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.agent-check-delivery small {
  color: var(--ink-600);
  font-size: 0.61rem;
  line-height: 1.35;
}

.agent-commission-history {
  border: 1px solid var(--warm-200);
  background: rgb(255 255 255 / 58%);
}

.agent-commission-history > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.8rem;
  border-bottom: 1px solid var(--warm-200);
}

.agent-commission-history h3 {
  margin: 0;
  color: var(--evergreen-950);
  font-size: 0.76rem;
}

.agent-commission-history header span {
  border: 1px solid var(--warm-250);
  border-radius: 999px;
  padding: 0.18rem 0.45rem;
  color: var(--ink-600);
  font-size: 0.56rem;
  font-weight: 800;
  text-transform: uppercase;
}

.agent-commission-history ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.agent-commission-history li {
  display: grid;
  grid-template-columns: minmax(10rem, 0.75fr) minmax(12rem, 1fr) minmax(
      12rem,
      1fr
    );
  gap: 0.75rem;
  padding: 0.65rem 0.8rem;
  border-top: 1px solid var(--warm-150);
}

.agent-commission-history li:first-child {
  border-top: 0;
}

.agent-commission-history :is(time, span) {
  color: var(--ink-600);
  font-size: 0.65rem;
  line-height: 1.4;
}

.agent-commission-history strong {
  color: var(--evergreen-950);
  font-size: 0.68rem;
  line-height: 1.4;
}

@media (max-width: 1050px) {
  .agent-form-grid--commission {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .agent-payment-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .agent-form-grid--identity .agent-field {
    flex: 1 1 min(100%, 14rem) !important;
  }

  .agent-form-grid--address,
  .agent-form-grid--tenure,
  .agent-form-grid--commission {
    grid-template-columns: 1fr;
  }

  .agent-payment-method > div,
  .agent-commission-history li {
    grid-template-columns: 1fr;
  }
}

.agent-intake--edit
  .agent-intake-section__body:has(> .agent-form-grid--commission) {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: stretch;
}

.agent-intake--edit .agent-form-grid--commission {
  grid-column: 1 / -1;
}

.agent-intake--edit .agent-split-preview,
.agent-intake--edit .agent-commission-history {
  min-width: 0;
  margin: 0;
}

@media (max-width: 900px) {
  .agent-intake--edit
    .agent-intake-section__body:has(> .agent-form-grid--commission) {
    grid-template-columns: 1fr;
  }

  .agent-intake--edit .agent-form-grid--commission {
    grid-column: auto;
  }
}

/* Staff record editors: guarded destructive actions */
.staff-inline-editor__header-actions,
.payroll-form__header-actions,
.staff-delete-confirmation {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.staff-delete-trigger,
.payroll-form > header .staff-delete-trigger {
  min-height: 2.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--error-700);
  border-radius: var(--radius-sm);
  padding: 0.64rem 0.85rem;
  color: var(--error-700);
  background: transparent;
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.staff-delete-trigger:hover,
.payroll-form > header .staff-delete-trigger:hover {
  background: #f8eae5;
}

.staff-delete-trigger:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.staff-delete-confirmation {
  padding: 0.4rem;
  border: 1px solid color-mix(in srgb, var(--error-700) 35%, transparent);
  border-radius: var(--radius-sm);
  background: #f8eae5;
}

.staff-delete-confirmation > span {
  color: var(--error-700);
  font-size: 0.67rem;
  font-weight: 800;
}

.payroll-form > header .staff-delete-confirmation > button {
  padding: 0.64rem 0.85rem;
}

.payroll-form > header .staff-delete-confirmation > .staff-secondary-action {
  border: 1px solid var(--warm-300);
  color: var(--evergreen-900);
  background: var(--warm-50);
}

.payroll-form > header .staff-delete-confirmation > .staff-destructive-action {
  border: 1px solid var(--error-700);
  color: var(--warm-50);
  background: var(--error-700);
}

/* Staff audit history: guarded destructive action */
.staff-change-log-clear {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.staff-change-log-clear > span {
  color: var(--error-700);
  font-size: 0.67rem;
  font-weight: 800;
}

.staff-destructive-action {
  min-height: 2.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--error-700);
  border-radius: var(--radius-sm);
  padding: 0.64rem 0.85rem;
  color: var(--warm-50);
  background: var(--error-700);
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.staff-destructive-action:hover {
  filter: brightness(0.9);
}

.staff-destructive-action:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

@media (max-width: 720px) {
  .staff-inline-editor > header {
    align-items: flex-start;
    flex-direction: column;
  }

  .staff-inline-editor__header-actions,
  .payroll-form__header-actions,
  .staff-delete-confirmation,
  .staff-change-log-clear,
  .staff-delete-confirmation > :is(button, span),
  .staff-change-log-clear > :is(button, span) {
    width: 100%;
  }
}
