:root {
  color-scheme: light;
  --bg: #e9e9e9;
  --text: #08122a;
  --muted: #5d6473;
  --line: #efefef;
  --field: #ffffff;
  --purple: #5848f7;
  --orange: #ff741f;
  --orange-dark: #ef6411;
  --danger: #db2b24;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

button,
input,
select {
  font: inherit;
}

.is-hidden {
  display: none !important;
}

.landing-page {
  width: min(100%, 1440px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
}

.landing-header {
  min-height: 100px;
  padding: 0 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--purple);
}

.landing-logo {
  width: 190px;
  height: 62px;
  display: block;
  object-fit: cover;
  object-position: center;
}

.landing-hero {
  display: grid;
  grid-template-columns: 50% 50%;
  min-height: 650px;
}

.landing-copy {
  padding: 123px 80px 80px;
}

.landing-copy h1 {
  margin: 0 0 40px;
  font-size: clamp(4.2rem, 7vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: -0.055em;
}

.landing-copy > p {
  width: min(100%, 590px);
  margin: 0;
  color: #75808a;
  font-size: 1rem;
  line-height: 1.55;
}

.country-block {
  margin-top: 34px;
}

.country-block p {
  margin: 0 0 17px;
  color: var(--text);
  font-size: 0.9rem;
}

.country-list {
  display: flex;
  gap: 15px;
}

.country-list span {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 7px rgba(8, 18, 42, 0.13);
  font-size: 1.25rem;
}

.landing-actions {
  display: flex;
  gap: 24px;
  margin-top: 30px;
}

.landing-button {
  min-width: 200px;
  min-height: 49px;
  border-radius: 0;
  font-weight: 800;
  cursor: pointer;
}

.landing-button span {
  margin-left: 9px;
  font-size: 1.25rem;
}

.landing-button.borrow {
  color: #fff;
  background: var(--purple);
  border: 1px solid var(--purple);
}

.landing-button.login {
  color: var(--text);
  background: transparent;
  border: 1px solid #aeb4bd;
}

.landing-image {
  position: relative;
  margin: 0;
  min-height: 650px;
  overflow: hidden;
}

.landing-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.landing-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 18, 42, 0.18), rgba(8, 18, 42, 0.02) 42%, rgba(8, 18, 42, 0.28));
  pointer-events: none;
}

.landing-image figcaption {
  position: absolute;
  right: 28px;
  bottom: 13px;
  z-index: 1;
  display: grid;
  color: #fff;
  font-size: 0.76rem;
  line-height: 1.15;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.42);
}

.landing-image figcaption strong {
  font-size: 1rem;
}

.landing-footer {
  margin: 31px 80px 0;
  padding: 25px 0 34px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  color: #74808b;
  border-top: 1px solid #aeb4bd;
  font-size: 0.86rem;
}

.landing-footer a {
  color: #74808b;
  text-decoration: none;
}

.support-email-link {
  transform: translateX(-16px);
}

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: start center;
  padding-top: 132px;
  background: rgba(8, 18, 42, 0.64);
}

.landing-page.login-open .landing-header {
  background: #28246f;
}

.landing-page.login-open .landing-logo,
.landing-page.login-open .landing-copy,
.landing-page.login-open .landing-footer,
.landing-page.login-open .landing-button {
  filter: brightness(0.45);
}

.landing-page.login-open .landing-image img,
.landing-page.login-open .landing-image figcaption {
  filter: brightness(0.42);
}

.login-modal {
  width: min(100% - 40px, 480px);
  min-height: 456px;
  padding: 53px 40px 56px;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}

.login-modal h2 {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 1.75rem;
  line-height: 1.15;
  font-weight: 900;
}

.login-modal > p {
  margin: 0 0 35px;
  color: #73808b;
  font-size: 0.9rem;
}

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

.login-form label {
  position: relative;
  display: block;
}

.login-form label span {
  position: absolute;
  left: 24px;
  top: 50%;
  color: #73808b;
  transform: translateY(-50%);
  pointer-events: none;
}

.login-form input {
  width: 100%;
  min-height: 56px;
  padding: 16px 24px;
  color: var(--text);
  background: #ededed;
  border: 0;
  border-radius: 0;
}

.login-form input:focus {
  outline: 2px solid var(--purple);
}

.login-form input:focus + span,
.login-form input:not(:placeholder-shown) + span {
  display: none;
}

.login-form a {
  width: fit-content;
  margin: 5px 0 17px;
  color: var(--text);
  font-size: 0.88rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.login-form button {
  min-height: 47px;
  color: #fff;
  background: var(--purple);
  border: 0;
  border-radius: 0;
  font-weight: 900;
  cursor: pointer;
}

.app-shell {
  width: min(100%, 1280px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 60px 52px;
}

.dashboard-shell,
.notifications-shell,
.payouts-shell,
.bank-shell {
  position: relative;
  width: min(100%, 1280px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 60px 22px;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.notifications-shell,
.payouts-shell,
.bank-shell {
  padding-top: 36px;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 36px;
  margin-bottom: 28px;
}

.nav-greeting,
.nav-links {
  display: flex;
  align-items: center;
  gap: 15px;
  color: var(--text);
  font-size: 1.12rem;
  font-weight: 500;
}

.nav-links {
  gap: 22px;
  font-size: 1.13rem;
  font-weight: 800;
}

.nav-links a {
  color: var(--text);
  text-decoration: none;
}

.menu-button,
.bell-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  border: 0;
  color: var(--text);
  background: transparent;
  cursor: pointer;
}

.menu-button {
  width: 22px;
  height: 22px;
  padding: 0;
  gap: 4px;
}

.menu-button span {
  display: block;
  width: 21px;
  height: 3px;
  background: var(--text);
  border-radius: 999px;
}

.account-menu {
  position: absolute;
  z-index: 20;
  top: 50px;
  left: 47px;
  width: 354px;
  min-height: calc(100vh - 72px);
  padding: 28px 24px;
  display: grid;
  align-content: start;
  gap: 22px;
  background: #fff;
  box-shadow: 0 18px 35px rgba(8, 18, 42, 0.08);
}

.account-menu a,
.account-menu button {
  width: fit-content;
  padding: 0;
  border: 0;
  color: var(--text);
  background: transparent;
  font: inherit;
  font-size: 1.2rem;
  text-decoration: none;
  cursor: pointer;
}

.account-menu button {
  color: #c81717;
  font-size: 0.96rem;
}

.profile-card {
  position: absolute;
  z-index: 7;
  top: 108px;
  left: 50%;
  width: min(92vw, 620px);
  transform: translateX(-50%);
  display: grid;
  gap: 22px;
  padding: 28px;
  background: #fff;
  border: 1px solid #d6dbe1;
  box-shadow: 0 22px 55px rgba(5, 16, 40, 0.18);
}

.profile-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.profile-card-head p {
  margin: 0 0 5px;
  color: #74808b;
  font-weight: 800;
}

.profile-card h2 {
  margin: 0;
  color: var(--text);
  font-size: 1.7rem;
}

#profile-close {
  border: 0;
  color: var(--text);
  background: transparent;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

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

.profile-grid label {
  display: grid;
  gap: 7px;
}

.profile-grid label span {
  color: #74808b;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-grid input {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #c7ccd2;
  color: var(--text);
  background: #fff;
  font: inherit;
}

.profile-grid input:disabled {
  border-color: transparent;
  background: #f7f8fa;
  opacity: 1;
}

.profile-wide {
  grid-column: 1 / -1;
}

.profile-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

.profile-actions button {
  min-width: 128px;
  min-height: 42px;
  border: 0;
  color: #fff;
  background: var(--purple);
  font-weight: 900;
  cursor: pointer;
}

#profile-edit {
  color: var(--text);
  background: #fff;
  border: 1px solid #c7ccd2;
}

.bell-button {
  width: 30px;
  height: 30px;
  padding: 0;
}

.bell-button.active .bell-shape {
  filter: drop-shadow(0 0 0 var(--text));
}

.dashboard {
  margin-top: 16px;
}

.notifications-page {
  margin-top: 22px;
}

.notifications-page h1 {
  margin: 0 0 46px;
}

.notifications-list {
  border-top: 1px solid #aeb4bd;
}

.notifications-list button {
  display: grid;
  grid-template-columns: 112px 1fr;
  min-height: 60px;
  width: 100%;
  padding: 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #aeb4bd;
  cursor: pointer;
  text-align: left;
}

.notifications-list button:hover,
.notifications-list button:focus-visible {
  background: rgba(255, 255, 255, 0.34);
}

.notifications-list button.read {
  opacity: 0.68;
}

.notifications-list button.read p {
  font-weight: 500;
}

.notifications-list span,
.notifications-list p {
  margin: 0;
  display: flex;
  align-items: center;
  color: var(--text);
  font-size: 0.98rem;
}

.notifications-list span {
  border-right: 1px solid #aeb4bd;
}

.notifications-list p {
  padding-left: 32px;
}

.notifications-empty {
  min-height: 410px;
  display: grid;
  justify-items: center;
  align-content: center;
  text-align: center;
}

.empty-illustration {
  position: relative;
  width: 118px;
  height: 100px;
  margin-bottom: 18px;
}

.empty-paper {
  position: absolute;
  width: 53px;
  height: 72px;
  background: #b8d7e8;
  border: 2px solid #15324a;
  border-radius: 5px;
  transform: rotate(-12deg);
}

.empty-paper.back {
  left: 24px;
  top: 11px;
  opacity: 0.72;
}

.empty-paper.front {
  left: 40px;
  top: 4px;
  background: #dceef7;
  transform: rotate(-9deg);
}

.empty-paper.front::before {
  content: "";
  position: absolute;
  right: -2px;
  top: -2px;
  width: 16px;
  height: 16px;
  background: var(--bg);
  border-left: 2px solid #15324a;
  border-bottom: 2px solid #15324a;
  border-radius: 0 0 0 4px;
}

.empty-paper.front::after {
  content: "";
  position: absolute;
  left: 15px;
  top: 25px;
  width: 24px;
  height: 4px;
  background: #19a8e6;
  box-shadow: 0 11px 0 #19a8e6, 0 22px 0 #19a8e6;
  border-radius: 999px;
}

.empty-check {
  position: absolute;
  right: 15px;
  bottom: 12px;
  width: 37px;
  height: 37px;
  background: #45e848;
  border-radius: 50%;
}

.empty-check::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 10px;
  width: 15px;
  height: 9px;
  border-left: 5px solid #fff;
  border-bottom: 5px solid #fff;
  transform: rotate(-45deg);
}

.notifications-empty h2 {
  margin: 0 0 12px;
  font-size: 1.35rem;
}

.notifications-empty p {
  width: min(100%, 560px);
  margin: 0 0 26px;
  color: #74808b;
  line-height: 1.55;
}

.notifications-empty button {
  min-width: 203px;
  min-height: 49px;
  color: #fff;
  background: var(--purple);
  border: 0;
  font-weight: 900;
  cursor: pointer;
}

.notification-detail {
  border-top: 1px solid #aeb4bd;
}

.notification-detail-head {
  display: grid;
  grid-template-columns: 112px 1fr;
  min-height: 60px;
  align-items: center;
  border-bottom: 0;
}

.notification-detail-head span {
  color: var(--text);
}

.notification-detail-head strong {
  padding-left: 32px;
}

.notification-message {
  padding: 44px 0 26px;
  color: #74808b;
  line-height: 1.55;
  border-bottom: 1px solid #aeb4bd;
}

.notification-message p {
  margin: 0 0 24px;
}

.notification-message a {
  color: var(--text);
  text-decoration: underline;
}

.notification-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 44px;
}

.back-link {
  border: 0;
  padding: 0;
  color: var(--text);
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.reply-button {
  min-width: 165px;
  min-height: 48px;
  color: #fff;
  background: var(--orange);
  border: 0;
  font-weight: 900;
  cursor: pointer;
}

.notification-reply-form {
  margin-top: 24px;
}

.notification-reply-form textarea {
  width: 100%;
  min-height: 140px;
  padding: 16px 24px;
  color: var(--text);
  background: #fff;
  border: 0;
  resize: vertical;
  font: inherit;
  font-size: 1.1rem;
}

.notification-reply-form textarea:focus {
  outline: 2px solid var(--orange);
}

.notification-reply-form textarea::placeholder {
  color: #74808b;
}

.back-link.muted {
  color: #fff;
}

.dashboard h1 {
  margin-bottom: 38px;
}

.referral-submit-panel {
  display: grid;
  gap: 16px;
  margin: -18px 0 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid #d6dae0;
}

.referral-submit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.referral-submit-actions button,
.referral-form button {
  min-height: 38px;
  padding: 0 18px;
  color: #fff;
  background: var(--purple);
  border: 0;
  font-weight: 900;
  cursor: pointer;
}

.referral-submit-actions button:disabled,
.referral-form button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.referral-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
}

.referral-form label {
  display: grid;
  gap: 6px;
  color: #6e7782;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.referral-form input,
.referral-form select {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  color: var(--text);
  background: #f7f7f7;
  border: 1px solid #c7ccd2;
  font: inherit;
}

.referral-form input:focus,
.referral-form select:focus {
  outline: 2px solid var(--purple);
}

.referral-form button {
  align-self: end;
}

.referral-submit-status {
  margin: 0;
  color: #286036;
  font-weight: 800;
}

.referral-submit-status.error {
  color: #b3261e;
}

.loan-table {
  font-size: 0.96rem;
}

.payouts-page {
  display: grid;
  align-content: start;
  gap: 24px;
}

.payouts-title-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.payouts-title-row p {
  margin: 0 0 6px;
  color: #6d7680;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.payouts-title-row h1 {
  margin: 0;
  font-size: clamp(2.4rem, 7vw, 5.5rem);
  line-height: 0.95;
}

.payouts-title-row button {
  min-height: 38px;
  padding: 0 18px;
  color: #fff;
  background: var(--purple);
  border: 0;
  font-weight: 900;
  cursor: pointer;
}

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

.payout-metrics article {
  display: grid;
  gap: 8px;
  padding: 18px;
  background: #fff;
  border: 1px solid #d6dae0;
}

.payout-metrics span {
  color: #6d7680;
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.payout-metrics strong {
  font-size: 2rem;
}

.payout-list-panel {
  display: grid;
  gap: 12px;
  padding: 18px;
  background: #fff;
  border: 1px solid #d6dae0;
}

.payout-filter-bar {
  display: flex;
  justify-content: flex-end;
}

.payout-filter-bar label {
  display: grid;
  gap: 6px;
  min-width: 220px;
  color: #6d7680;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.payout-filter-bar select {
  min-height: 38px;
  padding: 0 12px;
  color: var(--text);
  background: #f7f7f7;
  border: 1px solid #c7ccd2;
}

.payout-list-head,
.payout-row {
  display: grid;
  grid-template-columns: 1.5fr 120px 180px 130px 100px;
  align-items: center;
  gap: 18px;
}

.payout-list-head {
  padding-bottom: 8px;
  color: #65717c;
  border-bottom: 1px solid #9d8cff;
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.payout-row {
  min-height: 52px;
  border-bottom: 1px solid #e1e5ea;
}

.payout-empty {
  grid-template-columns: 1fr;
  color: #74808b;
}

.bank-page {
  align-self: start;
  display: grid;
  gap: 18px;
  padding-top: 34px;
}

.bank-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 18px;
  background: #fff;
  border: 1px solid #d6dae0;
}

.bank-form label {
  display: grid;
  gap: 6px;
}

.bank-form label > span,
.w9-classifications legend {
  color: #65717c;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.bank-form input {
  min-height: 42px;
  min-width: 0;
  padding: 0 12px;
  color: var(--text);
  background: #f7f7f7;
  border: 1px solid #c7ccd2;
  border-radius: 0;
}

.bank-form input:disabled {
  color: #6f7780;
  background: #eceff3;
  border-color: #d1d6dd;
  cursor: not-allowed;
}

.bank-section-title {
  border-bottom: 1px solid #d6dae0;
  padding-top: 4px;
  padding-bottom: 8px;
}

.bank-section-title h2 {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  font-weight: 900;
}

.w9-classifications {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.w9-classifications legend {
  grid-column: 1 / -1;
  padding: 0;
}

.w9-classifications label {
  display: flex;
  align-items: center;
  min-height: 42px;
  gap: 8px;
  padding: 0 10px;
  background: #f7f7f7;
  border: 1px solid #c7ccd2;
  color: var(--text);
  font-weight: 800;
}

.w9-classifications input {
  min-height: 0;
  width: 16px;
  height: 16px;
  padding: 0;
  accent-color: var(--purple);
}

.bank-wide,
.bank-actions {
  grid-column: 1 / -1;
}

.bank-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bank-actions button {
  min-height: 42px;
  padding: 0 16px;
  color: #fff;
  background: var(--purple);
  border: 0;
  font-weight: 900;
  cursor: pointer;
}

.bank-status {
  color: #65717c;
  font-weight: 800;
}

.bank-status.error {
  color: #c32222;
}

.admin-payouts-panel {
  background: transparent;
  overflow-x: auto;
}

.admin-payouts-head,
.admin-payout-row {
  display: grid;
  grid-template-columns: 1.4fr 1.2fr 130px 150px 120px;
  align-items: center;
  gap: 18px;
  min-width: 840px;
}

.admin-payouts-head {
  padding-bottom: 10px;
  color: #65717c;
  border-bottom: 1px solid #9d8cff;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-payout-row {
  min-height: 58px;
  border-bottom: 1px solid #e1e5ea;
  cursor: pointer;
}

.admin-payout-row:hover {
  background: rgba(255, 255, 255, 0.24);
}

.admin-payout-empty {
  color: #74808b;
}

.payroll-panel {
  display: grid;
  gap: 14px;
  margin-top: 22px;
  background: #fff;
}

.payroll-controls {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) repeat(2, auto);
  gap: 12px;
  align-items: end;
}

.payroll-controls label {
  display: grid;
  gap: 6px;
}

.payroll-controls label > span {
  color: #65717c;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.payroll-controls input {
  min-height: 38px;
  min-width: 0;
  padding: 0 12px;
  color: var(--text);
  background: #f7f7f7;
  border: 1px solid #c7ccd2;
}

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

.payroll-metrics article {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid #dde2e8;
  background: #f7f8fa;
}

.payroll-metrics span,
.payroll-head {
  color: #65717c;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.payroll-metrics strong {
  font-size: 1.45rem;
}

.payroll-status {
  color: #65717c;
  font-weight: 800;
}

.payroll-status.error {
  color: #c32222;
}

.payroll-head,
.payroll-row {
  display: grid;
  grid-template-columns: 1.5fr 140px 120px 120px 150px;
  align-items: center;
  gap: 16px;
}

.payroll-head {
  padding-bottom: 8px;
  border-bottom: 1px solid #9d8cff;
}

.payroll-row {
  min-height: 52px;
  border-bottom: 1px solid #e1e5ea;
}

.payroll-empty {
  grid-template-columns: 1fr;
  color: #74808b;
}

.loan-head,
.loan-row {
  display: grid;
  grid-template-columns: 140px 185px 1fr 120px 28px;
  align-items: center;
  gap: 28px;
}

.loan-head {
  padding-bottom: 8px;
  color: #65717c;
  border-bottom: 1px solid #9d8cff;
  font-size: 1rem;
}

.loan-row {
  min-height: 56px;
  width: 100%;
  padding: 0;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 0;
  text-align: left;
  cursor: pointer;
}

.loan-row.approved {
  color: #a7a7a7;
}

.loan-row:hover,
.loan-row.selected {
  background: rgba(255, 255, 255, 0.36);
}

.loan-row:focus-visible {
  outline: 3px solid #006edc;
  outline-offset: -3px;
}

.loan-row strong {
  font-weight: 900;
}

.dashboard-message {
  grid-template-columns: 1fr;
  color: #74808b;
  cursor: default;
}

.dashboard-notice {
  margin: 10px 0 0;
  color: #74808b;
  font-size: 0.86rem;
}

.progress-pill {
  width: min(100%, 370px);
  height: 23px;
  overflow: hidden;
  background: #f7f7f7;
  border-radius: 999px;
}

.progress-pill span {
  display: block;
  width: 44%;
  height: 100%;
  background: var(--purple);
  border-radius: inherit;
}

.status-pill {
  width: fit-content;
  padding: 7px 14px;
  color: #d66700;
  background: #fff0d7;
  border-radius: 999px;
  font-size: 0.86rem;
}

.status-pill.approved {
  color: #00a85a;
  background: #eaffed;
}

.more-button {
  width: 22px;
  height: 22px;
  border: 0;
  background: transparent;
  position: relative;
}

.more-button::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 10px;
  width: 22px;
  height: 3px;
  background: var(--text);
  border-radius: 999px;
}

.more-button::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 1px;
  width: 3px;
  height: 22px;
  background: var(--text);
  border-radius: 999px;
}

.loan-row.selected .more-button::after {
  display: none;
}

.dashboard-details {
  display: grid;
  grid-template-columns: 280px 1fr 1.16fr;
  gap: 24px;
  min-height: 319px;
  margin-top: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid #aeb4bd;
}

.dashboard-details.is-collapsed {
  display: none;
}

.borrower-card,
.files-panel,
.notes-panel {
  padding-top: 4px;
}

.files-panel,
.notes-panel {
  border-left: 1px solid #8c949e;
  padding-left: 24px;
}

.borrower-card {
  display: grid;
  align-content: start;
  gap: 10px;
  color: #74808b;
}

.borrower-card strong,
.borrower-card a {
  color: var(--text);
  font-weight: 900;
}

.borrower-card p {
  margin: 18px 0 0;
  font-size: 1rem;
}

.borrower-card span {
  font-size: 0.92rem;
}

.help-block {
  display: grid;
  gap: 7px;
  margin-top: 115px;
}

.help-block span {
  color: #74808b;
}

.help-block a {
  text-decoration: none;
}

.files-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 6px;
  border-bottom: 1px solid #7f8791;
}

.files-panel h2,
.notes-panel h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
}

.files-panel header button {
  display: flex;
  align-items: center;
  gap: 16px;
  border: 0;
  color: var(--text);
  background: transparent;
  cursor: pointer;
}

.add-icon {
  position: relative;
  width: 17px;
  height: 23px;
  border: 2px solid var(--text);
  border-radius: 2px;
}

.add-icon::before,
.add-icon::after {
  content: "";
  position: absolute;
  background: var(--text);
}

.add-icon::before {
  width: 9px;
  height: 2px;
  left: 3px;
  top: 10px;
}

.add-icon::after {
  width: 2px;
  height: 9px;
  left: 7px;
  top: 6px;
}

.files-panel ul,
.notes-panel ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.files-panel li {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 6px;
  min-height: 48px;
  color: #74808b;
}

.files-panel li.empty-row {
  grid-template-columns: 1fr;
  color: #74808b;
}

.files-panel li.requested-file {
  color: var(--text);
}

.requested-file strong,
.requested-file small {
  display: block;
}

.requested-file small,
.requested-status {
  color: #74808b;
  font-size: 0.82rem;
  font-weight: 700;
}

.requested-status {
  border: 0;
  background: transparent;
  color: #d76a00;
  cursor: pointer;
  padding: 0;
  white-space: nowrap;
}

.requested-status:disabled {
  color: #0aa657;
  cursor: default;
}

.file-icon {
  width: 28px;
  height: 32px;
  display: block;
  background: var(--text);
  -webkit-mask: url("data:image/svg+xml,%3Csvg width='28' height='32' viewBox='0 0 28 32' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 2H17L26 11V28C26 29.1046 25.1046 30 24 30H5C3.89543 30 3 29.1046 3 28V4C3 2.89543 3.89543 2 5 2Z' stroke='black' stroke-width='4' stroke-linejoin='round'/%3E%3Cpath d='M17 2V11H26' stroke='black' stroke-width='4' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg width='28' height='32' viewBox='0 0 28 32' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 2H17L26 11V28C26 29.1046 25.1046 30 24 30H5C3.89543 30 3 29.1046 3 28V4C3 2.89543 3.89543 2 5 2Z' stroke='black' stroke-width='4' stroke-linejoin='round'/%3E%3Cpath d='M17 2V11H26' stroke='black' stroke-width='4' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.file-actions {
  display: flex;
  gap: 18px;
}

.file-actions button {
  position: relative;
  width: 31px;
  height: 31px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.file-actions button:first-child::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--text);
  -webkit-mask: url("data:image/svg+xml,%3Csvg width='31' height='31' viewBox='0 0 31 31' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 21.2C3.6 20.2 2 17.9 2 15.2C2 11.6 4.9 8.7 8.5 8.7C9.4 4.8 12.8 2 16.9 2C21.4 2 25.2 5.5 25.5 10C27.8 10.8 29.5 13 29.5 15.6C29.5 18.1 28 20.3 25.9 21.2' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M15.8 13V28' stroke='black' stroke-width='3.5' stroke-linecap='round'/%3E%3Cpath d='M9.8 21.8L15.8 28L21.8 21.8' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg width='31' height='31' viewBox='0 0 31 31' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 21.2C3.6 20.2 2 17.9 2 15.2C2 11.6 4.9 8.7 8.5 8.7C9.4 4.8 12.8 2 16.9 2C21.4 2 25.2 5.5 25.5 10C27.8 10.8 29.5 13 29.5 15.6C29.5 18.1 28 20.3 25.9 21.2' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M15.8 13V28' stroke='black' stroke-width='3.5' stroke-linecap='round'/%3E%3Cpath d='M9.8 21.8L15.8 28L21.8 21.8' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.file-actions button:last-child::before {
  content: "";
  position: absolute;
  background: var(--text);
  inset: 0;
  -webkit-mask: url("data:image/svg+xml,%3Csvg width='31' height='31' viewBox='0 0 31 31' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18 4H5C3.89543 4 3 4.89543 3 6V26C3 27.1046 3.89543 28 5 28H25C26.1046 28 27 27.1046 27 26V13' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M14 20.5L25.7 8.8C26.7 7.8 26.7 6.2 25.7 5.2C24.7 4.2 23.1 4.2 22.1 5.2L10.5 16.9L10 21L14 20.5Z' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg width='31' height='31' viewBox='0 0 31 31' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18 4H5C3.89543 4 3 4.89543 3 6V26C3 27.1046 3.89543 28 5 28H25C26.1046 28 27 27.1046 27 26V13' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M14 20.5L25.7 8.8C26.7 7.8 26.7 6.2 25.7 5.2C24.7 4.2 23.1 4.2 22.1 5.2L10.5 16.9L10 21L14 20.5Z' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.notes-panel h2 {
  padding-bottom: 8px;
  border-bottom: 1px solid #7f8791;
}

.note-form {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.note-form textarea {
  width: 100%;
  min-height: 78px;
  padding: 10px 12px;
  color: var(--text);
  background: #f7f7f7;
  border: 1px solid #c7ccd2;
  resize: vertical;
}

.note-form textarea:focus {
  outline: 2px solid var(--purple);
}

.note-form button {
  justify-self: end;
  min-height: 34px;
  padding: 0 18px;
  color: #fff;
  background: var(--purple);
  border: 0;
  font-weight: 800;
  cursor: pointer;
}

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

.notes-panel article {
  margin-top: 19px;
}

.notes-panel h3 {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 500;
}

.notes-panel li,
.notes-panel p {
  color: #74808b;
  font-size: 0.92rem;
}

.notes-panel li {
  margin: 0 0 10px 22px;
  list-style: disc;
}

.notes-panel p {
  margin: 18px 0 0;
}

.dashboard-footer {
  display: grid;
  gap: 18px;
  margin-top: 34px;
  color: #74808b;
  font-size: 0.86rem;
}

.dashboard-footer p {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
}

.dashboard-footer div {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
}

.dashboard-footer a {
  color: #74808b;
  text-decoration: none;
}

.admin-shell {
  width: min(100%, 1280px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 48px 42px;
  background: var(--bg);
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 64px;
  padding-bottom: 18px;
  border-bottom: 1px solid #aeb4bd;
}

.admin-logo {
  width: 128px;
  height: 42px;
  object-fit: cover;
  filter: brightness(0.35) contrast(1.35);
}

.admin-menu {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
}

.admin-menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.admin-menu-toggle span {
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}

.admin-menu-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 20;
  min-width: 220px;
  padding: 8px;
  display: grid;
  gap: 4px;
  background: #fff;
  border: 1px solid #d6dbe1;
  box-shadow: 0 18px 40px rgba(8, 19, 43, 0.14);
}

.admin-menu-panel button {
  justify-content: flex-start;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  color: var(--text);
  background: #fff;
  text-align: left;
}

.admin-menu-panel button:hover {
  background: #f4f6ff;
}

#admin-sign-out {
  color: #c32222;
}

.admin-header button,
#admin-dashboard-refresh,
#admin-refresh,
#admin-client-list-refresh,
#client-detail-back,
#admin-upload-refresh,
#admin-security-refresh,
#admin-payments-management-open,
#admin-payroll-back,
#admin-payouts-export-eligible,
#admin-payouts-refresh,
#payroll-preview,
#payroll-create-file,
#admin-reports-refresh,
#admin-archive-refresh,
#admin-message-form button {
  min-height: 38px;
  padding: 0 16px;
  color: #fff;
  background: var(--purple);
  border: 0;
  font-weight: 800;
  cursor: pointer;
}

.admin-header .admin-menu-panel button {
  justify-content: flex-start;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  color: var(--text);
  background: #fff;
  text-align: left;
}

.admin-header .admin-menu-panel button:hover {
  background: #f4f6ff;
}

.admin-header .admin-menu-panel #admin-sign-out {
  color: #c32222;
}

.admin-page {
  margin-top: 28px;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.admin-metrics article {
  min-height: 128px;
  padding: 22px;
  display: grid;
  align-content: space-between;
  background: #fff;
  border: 1px solid #d6dbe1;
}

.admin-metrics span {
  color: #74808b;
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-metrics strong {
  color: var(--text);
  font-size: 3rem;
  line-height: 1;
}

.admin-chart-panel {
  padding: 22px;
  background: #fff;
  border: 1px solid #d6dbe1;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  color: #74808b;
  font-size: 0.85rem;
  font-weight: 800;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.chart-legend i {
  width: 14px;
  height: 14px;
  display: inline-block;
}

.real-estate-key,
.loan-chart-bar.real-estate {
  background: var(--purple);
}

.business-key,
.loan-chart-bar.business {
  background: var(--orange);
}

.admin-loan-chart {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.admin-loan-chart p {
  margin: 0;
  color: #74808b;
}

.loan-chart-row {
  display: grid;
  grid-template-columns: 86px 1fr 42px;
  gap: 14px;
  align-items: center;
}

.loan-chart-label,
.loan-chart-value {
  color: var(--text);
  font-weight: 900;
}

.loan-chart-track {
  height: 28px;
  display: flex;
  overflow: hidden;
  background: #f0f2f5;
}

.loan-chart-bar {
  min-width: 0;
}

.admin-title-row {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 24px;
}

.admin-title-row p {
  margin: 0 0 6px;
  color: #74808b;
  font-weight: 800;
}

.admin-title-row h1 {
  margin: 0;
}

.admin-title-actions {
  display: flex;
  align-items: end;
  gap: 12px;
}

.admin-quick-search {
  display: grid;
  gap: 6px;
}

.admin-quick-search span {
  color: #74808b;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-quick-search input {
  min-width: 260px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid #c7ccd2;
  background: #fff;
  color: var(--text);
}

.admin-quick-search input:focus {
  outline: 2px solid rgba(89, 71, 255, 0.22);
  border-color: var(--purple);
}

.application-filter-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid #d6dbe1;
  background: #fff;
}

.application-filter-panel label {
  display: grid;
  gap: 6px;
}

.application-filter-panel span {
  color: #74808b;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.application-filter-panel input {
  min-height: 38px;
  min-width: 0;
  padding: 0 12px;
  border: 1px solid #c7ccd2;
  background: #fff;
  color: var(--text);
}

.application-filter-panel input:focus {
  outline: 2px solid rgba(89, 71, 255, 0.22);
  border-color: var(--purple);
}

.application-filter-panel button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #c7ccd2;
  background: #f7f8fa;
  color: var(--text);
  font-weight: 900;
  cursor: pointer;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(420px, 0.72fr) minmax(420px, 1.28fr);
  gap: 24px;
}

.settings-layout {
  display: grid;
  gap: 24px;
}

.settings-inner-title {
  margin-bottom: 18px;
}

.settings-nav,
.security-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.settings-nav-button,
.security-nav-button {
  min-height: 54px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #d6dbe1;
  color: var(--text);
  background: #fff;
  font-weight: 900;
  cursor: pointer;
}

.settings-nav-button:hover,
.settings-nav-button.selected,
.security-nav-button:hover,
.security-nav-button.selected {
  background: #f4f6ff;
  border-color: #b8adff;
}

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

.settings-help {
  margin: 0 0 18px;
  color: #74808b;
  line-height: 1.5;
}

.admin-list-panel,
.admin-detail-panel {
  background: #fff;
  border: 1px solid #d6dbe1;
}

.admin-list-panel {
  overflow-x: auto;
}

.admin-list-panel.admin-payouts-panel {
  background: transparent;
  border: 0;
}

.application-list-head,
.admin-application-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.35fr) minmax(120px, 0.95fr) 94px;
  gap: 12px;
  align-items: center;
  min-width: 390px;
}

.archive-list-head,
.archive-row {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr 1fr 88px minmax(220px, auto);
  gap: 12px;
  align-items: center;
}

.admin-list-head,
.archive-list-head {
  padding: 14px 16px;
  color: #74808b;
  border-bottom: 1px solid #d6dbe1;
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.security-list-head,
.security-row {
  grid-template-columns: 1.1fr 1fr 0.75fr;
  min-width: 0;
}

.client-list-head,
.client-list-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr 0.8fr 90px 0.9fr 1.2fr;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
}

.client-list-head {
  color: #74808b;
  background: #f7f8fa;
  border-bottom: 1px solid #d6dbe1;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.client-list-row {
  border-bottom: 1px solid #edf0f3;
  color: #74808b;
  width: 100%;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.client-list-row:hover,
.client-list-row.selected {
  background: #f4f6ff;
}

.client-list-row strong {
  color: var(--text);
}

.crm-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.crm-metrics article {
  background: #fff;
  border: 1px solid #d6dbe1;
  padding: 16px;
}

.crm-metrics span,
.crm-filters span {
  display: block;
  color: #74808b;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.crm-metrics strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 1.7rem;
}

.crm-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(160px, 0.8fr) minmax(180px, 0.9fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
  background: #fff;
  border: 1px solid #d6dbe1;
  padding: 14px;
}

.crm-filters input,
.crm-filters select {
  width: 100%;
  margin-top: 6px;
  border: 1px solid #c7ced6;
  background: #fff;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
}

.crm-filters button,
.crm-client-row {
  font: inherit;
}

.crm-filters button {
  border: 1px solid #c7ced6;
  background: #f7f8fa;
  color: var(--text);
  padding: 10px 16px;
  cursor: pointer;
}

.crm-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.crm-list-head,
.crm-client-row {
  display: grid;
  grid-template-columns: 1.1fr 1.35fr 0.55fr 0.7fr 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
}

.crm-list-head {
  color: #74808b;
  background: #f7f8fa;
  border-bottom: 1px solid #d6dbe1;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.crm-client-row {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #edf0f3;
  background: transparent;
  color: #74808b;
  text-align: left;
  cursor: pointer;
}

.crm-client-row:hover {
  background: #f4f6ff;
}

.crm-client-row strong,
.crm-activity-item strong {
  color: var(--text);
}

.crm-activity-panel {
  padding: 16px;
}

.crm-activity-panel h2 {
  margin: 0 0 14px;
  font-size: 1rem;
}

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

.crm-activity-item {
  display: grid;
  gap: 5px;
  border-bottom: 1px solid #edf0f3;
  padding-bottom: 10px;
}

.crm-activity-item span,
.crm-activity-item small {
  color: #74808b;
}

.client-list-row span,
.client-list-row strong {
  overflow-wrap: anywhere;
}

.client-detail-panel {
  min-width: 0;
}

.client-detail-content {
  display: grid;
  gap: 22px;
  padding: 18px 20px 20px;
}

.client-detail-content h3 {
  margin: 0 0 12px;
  font-size: 0.9rem;
  text-transform: uppercase;
  color: #74808b;
}

.client-detail-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.client-detail-summary div {
  min-width: 0;
  padding: 12px;
  border: 1px solid #edf0f3;
  background: #fbfcfe;
}

.client-detail-summary .client-edit-grid,
.client-detail-summary .client-detail-actions {
  grid-column: 1 / -1;
  padding: 0;
  border: 0;
  background: transparent;
}

.client-edit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.client-edit-field {
  display: grid;
  gap: 6px;
}

.client-edit-field span {
  color: #74808b;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.client-edit-field input {
  min-height: 38px;
  min-width: 0;
  padding: 0 10px;
  border: 1px solid #c7ccd2;
  background: #fff;
  color: var(--text);
}

.client-detail-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.client-detail-actions button {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  color: #fff;
  background: var(--purple);
  font-weight: 900;
  cursor: pointer;
}

.client-detail-actions button.secondary {
  border: 1px solid #c7ccd2;
  color: var(--text);
  background: #fff;
}

.client-detail-summary span,
.client-detail-summary strong {
  display: block;
  overflow-wrap: anywhere;
}

.client-detail-summary span {
  margin-bottom: 6px;
  color: #74808b;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

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

.client-detail-loan,
.client-message-row {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #edf0f3;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.client-detail-loan-summary {
  display: grid;
  gap: 6px;
}

.client-open-application {
  justify-self: start;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #c7ccd2;
  background: #f7f8fa;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
}

.client-open-application:hover {
  border-color: #b8adff;
  background: #f4f6ff;
}

.client-detail-loan span,
.client-detail-loan small,
.client-message-row span,
.client-message-row p {
  color: #74808b;
  overflow-wrap: anywhere;
}

.client-detail-answer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.client-detail-answer-grid div {
  padding: 10px;
  border: 1px solid #edf0f3;
  background: #fbfcfe;
}

.client-detail-answer-grid div span,
.client-detail-answer-grid div strong {
  display: block;
}

.client-detail-answer-grid div span {
  margin-bottom: 4px;
  color: #74808b;
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.client-detail-documents {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.client-detail-documents span {
  padding: 6px 9px;
  border: 1px solid #edf0f3;
  background: #fbfcfe;
  color: #74808b;
  font-size: 0.78rem;
  font-weight: 800;
}

.client-message-row p {
  margin: 0;
  line-height: 1.45;
}

.reports-panel {
  padding: 18px 20px 20px;
}

.reports-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(3, auto);
  gap: 12px;
  align-items: end;
  margin-top: 18px;
}

.reports-controls label {
  display: grid;
  gap: 6px;
}

.reports-controls label > span {
  color: #74808b;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.reports-controls select {
  min-height: 38px;
  min-width: 0;
  padding: 0 10px;
  border: 1px solid #c7ccd2;
  background: #fff;
}

.reports-controls button {
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  color: #fff;
  background: var(--purple);
  font-weight: 800;
  cursor: pointer;
}

.reports-help {
  margin: 14px 0 0;
  color: #74808b;
}

.admin-application-row,
.archive-row {
  width: 100%;
  min-height: 64px;
  padding: 12px 16px;
  border-bottom: 1px solid #edf0f3;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.admin-application-row {
  border: 0;
  cursor: pointer;
}

.admin-application-row:hover,
.admin-application-row.selected,
.archive-row:hover {
  background: #f4f6ff;
}

.admin-application-row strong,
.admin-application-row span,
.archive-row strong,
.archive-row span {
  overflow-wrap: anywhere;
}

.archive-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.archive-open-button,
.archive-unarchive-button,
.archive-delete-button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 6px;
  font-weight: 900;
  cursor: pointer;
}

.archive-open-button {
  border: 1px solid #c8d0da;
  background: #fff;
  color: var(--text);
}

.archive-unarchive-button {
  border: 1px solid #c8d0da;
  background: #f7f8fa;
  color: var(--text);
}

.archive-delete-button {
  border: 1px solid #f0b8b8;
  background: #fff5f5;
  color: #b42318;
}

.archive-open-button:hover {
  background: #f4f6ff;
}

.archive-unarchive-button:hover {
  background: #f4f6ff;
}

.archive-delete-button:hover {
  background: #ffe8e8;
}

.archive-empty {
  padding: 18px 16px;
  color: #74808b;
}

.admin-detail-panel {
  padding: 22px;
}

.admin-detail-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.admin-detail-panel h2,
.admin-detail-panel h3 {
  margin: 0;
}

.upload-panel {
  display: grid;
  gap: 20px;
}

.admin-upload-form {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(180px, 0.7fr) minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.admin-upload-form label {
  display: grid;
  gap: 6px;
}

.admin-upload-form label span {
  color: #74808b;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-upload-form select,
.admin-upload-form input {
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid #c7ccd2;
  background: #fff;
}

.admin-upload-form button {
  min-height: 38px;
  padding: 0 16px;
  border: 0;
  color: #fff;
  background: var(--purple);
  font-weight: 800;
  cursor: pointer;
}

.upload-documents {
  margin-top: 4px;
}

.upload-system-panel {
  margin-top: 22px;
}

.upload-system-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.upload-system-grid article {
  padding: 16px;
  display: grid;
  gap: 12px;
  background: #f7f8fa;
  border: 1px solid #d6dbe1;
}

.upload-system-grid span {
  color: #74808b;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.upload-system-grid strong {
  color: var(--text);
  font-size: 2rem;
}

.upload-system-list {
  display: grid;
  gap: 12px;
}

#upload-system-file-types {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#upload-system-file-types span {
  padding: 8px 10px;
  color: var(--text);
  background: #f4f6ff;
  border: 1px solid #d6dbe1;
  font-weight: 800;
}

#upload-system-file-types div {
  color: #74808b;
}

.admin-empty {
  margin-top: 28px;
  margin-left: 12px;
  color: #74808b;
}

.admin-detail-content {
  display: grid;
  gap: 24px;
  margin-top: 18px;
}

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

.admin-summary-grid div,
.admin-summary-grid label {
  display: grid;
  gap: 6px;
  padding: 12px;
  background: #f7f8fa;
}

.admin-summary-grid span {
  color: #74808b;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-summary-grid select,
.admin-summary-grid input {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #c7ccd2;
  background: #fff;
}

.admin-email-field,
.admin-loan-amount-field {
  grid-column: 1 / -1;
}

.admin-progress-control {
  grid-column: 1 / -1;
}

.admin-submitted-info {
  display: grid;
  gap: 12px;
}

.admin-submitted-info h3 {
  margin: 0;
  font-size: 1rem;
}

.admin-answers-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.admin-answer-row {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #e1e5ea;
  background: #f7f8fa;
}

.admin-answer-row span {
  color: #74808b;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-answer-row strong {
  overflow-wrap: anywhere;
}

.admin-save-details,
.admin-archive-button {
  min-height: 34px;
  align-self: end;
  padding: 0 12px;
  border: 0;
  color: #fff;
  background: var(--purple);
  font-weight: 900;
  cursor: pointer;
}

.admin-save-details {
  min-height: 34px;
  width: fit-content;
  padding: 0 10px;
  font-size: 0.84rem;
}

.admin-archive-button {
  background: var(--orange);
  font-size: 0.78rem;
  white-space: nowrap;
}

.admin-save-details:disabled,
.admin-archive-button:disabled {
  opacity: 0.7;
}

.admin-save-details:disabled {
  cursor: wait;
}

.admin-archive-button:disabled {
  cursor: default;
}

.admin-requested-files,
.admin-documents,
.admin-communications,
.admin-security {
  display: grid;
  gap: 12px;
}

.email-management-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
}

.email-library-grid {
  margin-top: 18px;
}

.admin-email-form,
.email-library-form {
  display: grid;
  gap: 12px;
}

.admin-email-form label,
.email-library-form label {
  display: grid;
  gap: 6px;
}

.admin-email-form label span,
.email-library-form label span {
  color: #74808b;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-email-form input,
.admin-email-form select,
.admin-email-form textarea,
.email-library-form input,
.email-library-form select,
.email-library-form textarea {
  width: 100%;
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid #c7ccd2;
  background: #fff;
  color: var(--text);
}

.admin-email-form textarea,
.email-library-form textarea {
  resize: vertical;
}

.admin-email-form input[readonly] {
  background: #f7f8fa;
  color: #59636e;
}

.admin-email-form button,
.email-library-form button {
  justify-self: end;
  min-height: 40px;
  padding: 0 18px;
  border: 0;
  color: #fff;
  background: var(--purple);
  font-weight: 900;
  cursor: pointer;
}

.admin-email-form button:disabled,
.email-library-form button:disabled {
  opacity: 0.7;
  cursor: wait;
}

.admin-email-history {
  display: grid;
  gap: 12px;
}

.email-history-item {
  display: grid;
  gap: 6px;
  padding: 12px 0;
  border-bottom: 1px solid #e1e5e9;
}

.email-history-item span,
.email-history-item p,
.email-history-item small {
  color: #74808b;
}

.email-history-item p {
  margin: 0;
  line-height: 1.45;
}

.email-history-item small {
  font-weight: 800;
}

.email-history-item.delivery-failed small {
  color: #b42318;
}

.email-template-list {
  display: grid;
  gap: 12px;
}

.email-library-item {
  display: grid;
  gap: 6px;
  padding: 12px 0;
  border-bottom: 1px solid #e1e5e9;
}

.email-library-item span,
.email-library-item small,
.email-library-item p {
  margin: 0;
  color: #74808b;
  line-height: 1.45;
  white-space: pre-wrap;
}

.email-library-item small {
  font-weight: 800;
}

.email-library-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.email-library-actions button {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid #c7ccd2;
  background: #fff;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.email-library-actions button:hover {
  background: #f4f6ff;
}

.email-library-actions button.danger {
  color: #b42318;
  border-color: #f0b8b2;
}

.email-library-form {
  margin-top: 18px;
}

.email-library-form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.email-library-form-actions button[type="button"] {
  color: var(--text);
  background: #fff;
  border: 1px solid #c7ccd2;
}

.admin-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-section-head h2 {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-icon {
  position: relative;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  color: var(--text);
}

.people-icon {
  width: 28px;
  height: 24px;
  border-bottom: 5px solid currentColor;
  border-radius: 0;
}

.people-icon::before,
.people-icon::after {
  content: "";
  position: absolute;
  background: currentColor;
}

.people-icon::before {
  top: 2px;
  left: 10px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  box-shadow: -10px 2px 0 -1px currentColor, 10px 2px 0 -1px currentColor;
}

.people-icon::after {
  left: 7px;
  bottom: 6px;
  width: 14px;
  height: 10px;
  border-radius: 12px 12px 2px 2px;
  box-shadow: -10px 2px 0 -2px currentColor, 10px 2px 0 -2px currentColor;
}

.settings-file-icon {
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 2H14L20 8V22H6V2Z' stroke='black' stroke-width='2.5' stroke-linejoin='round'/%3E%3Cpath d='M14 2V8H20' stroke='black' stroke-width='2.5' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 2H14L20 8V22H6V2Z' stroke='black' stroke-width='2.5' stroke-linejoin='round'/%3E%3Cpath d='M14 2V8H20' stroke='black' stroke-width='2.5' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.files-icon {
  width: 27px;
  height: 24px;
}

.files-icon::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 7px;
  width: 14px;
  height: 15px;
  border: 4px solid currentColor;
  border-radius: 5px;
}

.files-icon::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 1px;
  width: 15px;
  height: 18px;
  border: 4px solid currentColor;
  border-radius: 5px;
  background: var(--bg);
}

.building-icon {
  border-bottom: 3px solid currentColor;
}

.building-icon::before {
  content: "";
  position: absolute;
  left: 1px;
  right: 1px;
  top: 2px;
  height: 5px;
  background: currentColor;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.building-icon::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 9px;
  width: 4px;
  height: 10px;
  background: currentColor;
  box-shadow: 7px 0 0 currentColor, 14px 0 0 currentColor;
}

.status-icon::before,
.status-icon::after {
  content: "";
  position: absolute;
  left: 4px;
  width: 16px;
  height: 8px;
  background: currentColor;
}

.status-icon::before {
  top: 4px;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.status-icon::after {
  bottom: 4px;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.status-icon {
  border-top: 5px solid currentColor;
  border-bottom: 5px solid currentColor;
  border-radius: 4px;
}

.progress-icon {
  width: 24px;
  height: 23px;
}

.progress-icon::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1px;
  width: 24px;
  height: 10px;
  border-radius: 4px;
  background: currentColor;
  box-shadow: 0 13px 0 currentColor;
}

.progress-icon::after {
  content: "";
  position: absolute;
  right: 4px;
  top: 4px;
  width: 6px;
  height: 4px;
  background: #fff;
  box-shadow: 0 13px 0 #fff;
}

.admin-section-head button {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  color: #fff;
  background: var(--purple);
  font-weight: 800;
  cursor: pointer;
}

.admin-section-head button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.admin-requested-files-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  background: #f7f8fa;
  border: 1px solid #d6dbe1;
}

.requested-file-option {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-weight: 800;
}

.requested-file-option input {
  width: 17px;
  height: 17px;
  accent-color: var(--purple);
}

.admin-security {
  padding: 16px;
  background: #f7f8fa;
  border: 1px solid #d6dbe1;
}

.application-account-panel {
  display: grid;
  gap: 14px;
}

.application-account-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.application-account-head h3 {
  margin: 0;
}

.application-account-head span {
  padding: 5px 9px;
  color: #74808b;
  background: #fff;
  border: 1px solid #d6dbe1;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.application-account-head span.created {
  color: #175f36;
  background: #e9f8ef;
  border-color: #b9e7c8;
}

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

.admin-security-grid div,
.admin-security-grid label {
  display: grid;
  gap: 6px;
}

.admin-security-grid div > span,
.admin-security-grid label > span {
  color: #74808b;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-security-grid div > strong {
  overflow-wrap: anywhere;
}

.admin-security-grid input,
.admin-security-grid select {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid #c7ccd2;
  background: #fff;
}

.admin-security-grid .admin-checkbox {
  grid-template-columns: auto 1fr;
  align-items: center;
  align-content: center;
}

.admin-security-grid .admin-checkbox span {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: none;
}

.manual-user-panel {
  margin-bottom: 18px;
  padding: 16px;
}

.manual-user-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto auto;
  gap: 12px;
  align-items: end;
}

.manual-user-form label {
  display: grid;
  gap: 6px;
}

.manual-user-form label > span {
  color: #74808b;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.manual-user-form input,
.manual-user-form select {
  min-height: 38px;
  min-width: 0;
  padding: 0 10px;
  border: 1px solid #c7ccd2;
  background: #fff;
}

.manual-user-form .admin-checkbox {
  grid-template-columns: auto 1fr;
  align-items: center;
  min-height: 38px;
}

.manual-user-form .admin-checkbox input {
  min-height: 0;
}

.manual-user-form .admin-checkbox span {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: none;
}

.manual-user-form button {
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  color: #fff;
  background: var(--purple);
  font-weight: 800;
  cursor: pointer;
}

#manual-user-generate-password {
  color: var(--text);
  background: #fff;
  border: 1px solid #c7ccd2;
}

.admin-security-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.admin-security-actions button {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  font-weight: 800;
  cursor: pointer;
}

.admin-password-reset {
  margin-top: 18px;
  padding: 16px;
  display: grid;
  gap: 14px;
  background: #fff;
  border: 1px solid #d6dbe1;
}

.admin-password-reset h3,
.admin-password-reset p {
  margin: 0;
}

.admin-password-reset p {
  margin-top: 6px;
  color: #74808b;
}

.password-reset-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, auto) auto auto;
  gap: 10px;
  align-items: end;
}

.admin-reset-row {
  grid-template-columns: minmax(180px, 0.8fr) minmax(220px, 1fr) auto auto;
}

.password-reset-row label {
  display: grid;
  gap: 6px;
}

.password-reset-row label span {
  color: #74808b;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.password-reset-row input {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid #c7ccd2;
}

.password-reset-row .admin-checkbox {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  align-content: center;
  min-height: 36px;
}

.password-reset-row .admin-checkbox input {
  min-height: 0;
}

.password-reset-row .admin-checkbox span {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: none;
}

.password-reset-row button {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  color: #fff;
  background: var(--purple);
  font-weight: 800;
  cursor: pointer;
}

.password-reset-row #admin-generate-reset-password {
  color: var(--text);
  background: #fff;
  border: 1px solid #c7ccd2;
}

.admin-user-logs {
  margin-top: 18px;
  padding: 16px;
  background: #fff;
  border: 1px solid #d6dbe1;
}

.admin-user-logs h3 {
  margin-bottom: 12px;
}

#admin-user-logs-list {
  display: grid;
  gap: 10px;
}

.user-log-row {
  display: grid;
  gap: 4px;
  padding: 11px 0;
  border-top: 1px solid #edf0f3;
}

.user-log-row:first-child {
  border-top: 0;
}

.user-log-row strong {
  color: var(--text);
}

.user-log-row span,
#admin-user-logs-list > div {
  color: #74808b;
  font-size: 0.9rem;
}

#admin-generate-password,
#application-account-generate-password {
  color: var(--text);
  background: #fff;
  border: 1px solid #c7ccd2;
}

#admin-save-security,
#application-account-create {
  color: #fff;
  background: var(--purple);
}

.admin-documents ul,
.admin-notes-list {
  margin: 0;
  padding: 0;
}

.admin-documents li,
.admin-note {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #e1e5e9;
  color: #74808b;
}

#admin-message-form {
  display: grid;
  gap: 12px;
}

.associate-table {
  display: grid;
  border: 1px solid #d6dbe1;
}

.associate-table-head,
.associate-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr 0.9fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
}

.associate-table-head {
  color: #74808b;
  background: #f7f8fa;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.associate-row {
  border-top: 1px solid #edf0f3;
  color: #74808b;
}

.associate-row strong {
  color: var(--text);
}

.application-type-head,
.application-type-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
}

.application-type-head {
  color: #74808b;
  background: #f7f8fa;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.application-type-row {
  border-top: 1px solid #edf0f3;
}

.loan-settings-head,
.loan-settings-row {
  display: grid;
  grid-template-columns: 0.45fr 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
}

.loan-settings-head {
  color: #74808b;
  background: #f7f8fa;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.loan-settings-row {
  border-top: 1px solid #edf0f3;
  color: #74808b;
}

.loan-settings-row strong {
  color: var(--text);
}

.simple-settings-head,
.simple-settings-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
}

.progress-settings-head,
.progress-settings-row {
  display: grid;
  grid-template-columns: 1fr 120px auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
}

.api-connections-head,
.api-connections-row,
.automations-head,
.automations-row {
  display: grid;
  grid-template-columns: 0.8fr 0.7fr 1.3fr 0.8fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
}

.automations-head,
.automations-row {
  grid-template-columns: 0.9fr 0.8fr 1.1fr 1.1fr 0.6fr auto;
}

.simple-settings-head,
.progress-settings-head,
.api-connections-head,
.automations-head {
  color: #74808b;
  background: #f7f8fa;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.simple-settings-row,
.progress-settings-row,
.api-connections-row,
.automations-row {
  border-top: 1px solid #edf0f3;
  color: #74808b;
}

.simple-settings-row strong,
.progress-settings-row strong,
.api-connections-row strong,
.automations-row strong {
  color: var(--text);
}

.settings-row-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.settings-row-actions button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid #c7ccd2;
  background: #fff;
  color: var(--text);
  font-weight: 900;
  cursor: pointer;
}

.settings-row-actions button:hover {
  background: #f4f6ff;
}

.settings-row-actions button.danger {
  border-color: #f0b8b8;
  background: #fff5f5;
  color: #b42318;
}

.settings-row-actions button.danger:hover {
  background: #ffe8e8;
}

.associate-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
  margin-top: 20px;
}

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

.loan-settings-form {
  grid-template-columns: 0.45fr 1fr auto;
}

.simple-settings-form {
  grid-template-columns: minmax(0, 1fr) auto;
}

.progress-settings-form {
  grid-template-columns: minmax(0, 1fr) 120px auto;
}

.api-connections-form {
  grid-template-columns: 0.9fr 1.2fr 1fr 150px 130px auto;
}

.email-delivery-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.automations-form {
  grid-template-columns: 0.9fr 0.8fr 1.1fr 1.1fr 120px auto;
}

.api-connections-form select,
.email-delivery-form select,
.automations-form select {
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid #c7ccd2;
  background: #fff;
}

.email-delivery-form .email-starttls-toggle {
  min-height: 38px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  align-content: center;
}

.email-delivery-form .email-starttls-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--purple);
}

.email-delivery-form .email-starttls-toggle span {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: none;
}

.email-delivery-form button {
  justify-self: start;
}

.email-settings-status {
  margin-top: 18px;
  padding: 14px 16px;
  display: grid;
  gap: 6px;
  background: #f7f8fa;
  border: 1px solid #d6dbe1;
}

.email-settings-status p {
  margin: 0;
  color: #74808b;
}

.admin-access-table {
  border: 1px solid #d6dbe1;
}

.admin-access-head,
.admin-access-row {
  display: grid;
  grid-template-columns: 0.75fr 130px 0.75fr 0.85fr 1.25fr;
  gap: 16px;
  align-items: start;
}

.admin-access-head {
  padding: 14px 16px;
  color: #74808b;
  background: #f7f8fa;
  border-bottom: 1px solid #d6dbe1;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-access-row {
  padding: 16px;
  border-top: 1px solid #edf0f3;
}

.admin-access-row:first-child {
  border-top: 0;
}

.admin-access-user {
  display: grid;
  gap: 5px;
}

.admin-access-user strong {
  color: var(--text);
}

.admin-access-user span {
  color: #74808b;
  font-size: 0.9rem;
}

.admin-access-user small {
  color: #c77700;
  font-weight: 800;
}

.access-group {
  display: grid;
  gap: 8px;
}

.access-group-wide {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.access-toggle {
  min-height: 26px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
}

.access-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--purple);
}

.access-toggle-master {
  color: var(--purple);
}

.admin-access-form {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
}

.associate-form label {
  display: grid;
  gap: 6px;
}

.associate-form label span {
  color: #74808b;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.associate-form input {
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid #c7ccd2;
  background: #fff;
}

.associate-form button {
  min-height: 38px;
  padding: 0 16px;
  border: 0;
  color: #fff;
  background: var(--purple);
  font-weight: 800;
  cursor: pointer;
}

#admin-message {
  width: 100%;
  padding: 12px;
  border: 1px solid #c7ccd2;
}

#admin-message {
  resize: vertical;
}

#admin-message-form {
  display: grid;
  gap: 10px;
}

#admin-message-form button {
  justify-self: end;
}

.admin-note {
  display: grid;
  gap: 5px;
}

.admin-note small {
  color: #74808b;
  font-weight: 800;
}

.admin-note.delivery-failed small {
  color: #b42318;
}

.shield-icon {
  position: relative;
  flex: 0 0 auto;
  width: 18px;
  height: 20px;
  border: 2px solid var(--orange);
  border-top-width: 4px;
  border-radius: 10px 10px 12px 12px;
  clip-path: polygon(50% 0, 100% 18%, 92% 72%, 50% 100%, 8% 72%, 0 18%);
}

.bell-shape {
  position: relative;
  width: 17px;
  height: 18px;
  border-radius: 10px 10px 5px 5px;
  background: var(--text);
}

.bell-shape::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 6px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text);
}

.bell-shape::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 5px;
  width: 7px;
  height: 3px;
  border-radius: 999px;
  background: var(--text);
}

.badge {
  position: absolute;
  top: -3px;
  right: -1px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--orange);
  border-radius: 999px;
  font-size: 0.67rem;
  font-weight: 900;
  line-height: 1;
}

.prequal-card {
  width: 100%;
}

.topbar {
  display: block;
}

h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.75rem, 2.8vw, 2rem);
  line-height: 1.15;
  font-weight: 900;
}

.progress-label,
.progress-track {
  display: none;
}

#prequal-form {
  width: min(100%, 537px);
  margin: 94px auto 0;
}

.question-help {
  min-height: 1.3em;
  margin: 0 0 34px;
  color: var(--text);
  font-size: clamp(1.45rem, 3vw, 1.72rem);
  line-height: 1.15;
  font-weight: 900;
  text-align: center;
}

.answer-area {
  display: grid;
  gap: 32px;
}

.choice-label {
  margin: 0 0 -12px;
  color: var(--text);
  font-weight: 800;
}

.option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 0 25px;
  color: var(--text);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 0;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.option:hover {
  border-color: #d6d6d6;
}

.option:has(input:checked) {
  border-color: var(--orange);
  box-shadow: 0 0 0 1px var(--orange);
}

.option input {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--orange);
}

.field {
  display: grid;
  gap: 7px;
  background: var(--field);
  border: 1px solid var(--line);
  padding: 15px 24px 13px;
}

.field label {
  color: var(--text);
  font-weight: 500;
}

.field input,
.field select {
  width: 100%;
  min-height: 34px;
  padding: 0;
  color: var(--text);
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 1rem;
  font-weight: 700;
}

.amount-field input {
  font-size: 1.8rem;
  font-weight: 900;
}

.select-field select {
  font-size: 1.35rem;
  font-weight: 900;
}

.field input:focus,
.field select:focus {
  outline: 0;
}

.field input::placeholder {
  color: #9b9b9b;
}

.business-name-field {
  padding: 0 24px;
}

.business-name-field input {
  min-height: 56px;
  font-size: 0.95rem;
  font-weight: 700;
}

.no-business-option {
  min-height: 56px;
  margin-top: -16px;
  font-size: 0.82rem;
}

.no-business-option span {
  font-weight: 800;
}

.no-business-option input {
  width: 18px;
  height: 18px;
}

.field.invalid {
  background: #fff6f4;
  border-color: #f17067;
}

.field.invalid label,
.field-error {
  color: var(--danger);
}

.field-error {
  margin: 4px 0 -36px;
  transform: translateY(23px);
  font-size: 0.86rem;
  font-weight: 500;
}

.consent {
  margin: -10px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.confirmation {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: min(100%, 540px);
  margin: 70px auto 0;
  color: var(--text);
  text-align: center;
  line-height: 1.55;
}

.confirmation h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 900;
}

.confirmation p {
  margin: 0;
}

.confirmation-number {
  margin-top: 8px;
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 900;
}

.confirmation p:not(.confirmation-number) {
  color: #74808b;
}

.confirmation-shell .topbar,
.confirmation-shell .question-help,
.confirmation-shell .error,
.confirmation-shell .actions {
  display: none;
}

.confirmation-shell #prequal-form {
  margin-top: 0;
}

.confirmation-shell .answer-area {
  display: block;
}

.error {
  min-height: 64px;
  margin: -2px 0 28px;
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 500;
}

.error:empty {
  display: none;
}

.error-banner {
  display: flex;
  align-items: center;
  gap: 15px;
  min-height: 40px;
  margin-bottom: 10px;
  padding: 0 26px;
  color: var(--danger);
  background: #fff6f4;
  border: 1px solid var(--danger);
  border-radius: 7px;
}

.error-banner::before {
  content: "x";
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 2px solid var(--danger);
  border-radius: 50%;
  color: var(--danger);
  font-size: 0.85rem;
  font-weight: 900;
  line-height: 1;
}

.error-detail {
  display: block;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 164px;
  gap: 28px;
  align-items: center;
  margin-top: 58px;
}

.button {
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 0;
  font-weight: 900;
  cursor: pointer;
}

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

.primary {
  color: #fff;
  background: var(--orange);
}

.primary:hover {
  background: var(--orange-dark);
}

.ghost {
  justify-self: start;
  min-height: auto;
  padding: 0;
  color: var(--text);
  background: transparent;
  border: 0;
}

.summary {
  display: grid;
  gap: 12px;
}

.summary-row {
  display: grid;
  gap: 4px;
  padding: 14px 0;
  border-bottom: 1px solid #d4d4d4;
}

.summary-row strong {
  color: var(--muted);
  font-size: 0.85rem;
}

.disclaimer-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8, 18, 42, 0.66);
}

.disclaimer-modal {
  width: min(100%, 600px);
  padding: 28px 38px 32px;
  color: var(--text);
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.24);
  text-align: center;
}

.disclaimer-modal h2 {
  margin: 0 0 22px;
  font-size: 1rem;
  font-weight: 900;
}

.disclaimer-modal p {
  margin: 0;
  color: #74808b;
  font-size: 0.76rem;
  line-height: 1.5;
}

.disclaimer-button {
  width: min(100%, 200px);
  margin-top: 24px;
  color: #fff;
  background: var(--purple);
}

.disclaimer-button:hover {
  background: #4537de;
}

@media (max-width: 760px) {
  .landing-header {
    min-height: 78px;
    padding: 0 24px;
  }

  .landing-hero {
    grid-template-columns: 1fr;
  }

  .landing-copy {
    padding: 56px 24px 42px;
  }

  .landing-copy h1 {
    font-size: 3.7rem;
  }

  .landing-actions {
    display: grid;
  }

  .landing-button {
    width: 100%;
  }

  .landing-image {
    min-height: 360px;
  }

  .landing-footer {
    margin: 24px;
    padding-bottom: 24px;
  }

  .app-shell {
    padding: 24px 20px 42px;
  }

  .dashboard-shell,
  .bank-shell {
    padding: 24px 20px 32px;
  }

  .referral-form {
    grid-template-columns: 1fr;
  }

  .bank-form {
    grid-template-columns: 1fr;
  }

  .w9-classifications {
    grid-template-columns: 1fr;
  }

  .bank-actions {
    display: grid;
  }

  .referral-submit-actions {
    display: grid;
  }

  .payouts-title-row {
    display: grid;
    align-items: start;
  }

  .payout-metrics,
  .payroll-metrics,
  .payout-list-head,
  .payout-row,
  .payroll-head,
  .payroll-row {
    grid-template-columns: 1fr;
  }

  .payout-filter-bar,
  .payout-filter-bar label {
    width: 100%;
  }

  .payout-list-head {
    display: none;
  }

  .payroll-controls {
    grid-template-columns: 1fr;
  }

  .payroll-head {
    display: none;
  }

  .profile-card {
    top: 92px;
    padding: 22px;
  }

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

  .settings-nav,
  .security-nav {
    grid-template-columns: 1fr;
  }

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

  .admin-title-actions {
    width: 100%;
    display: grid;
  }

  .admin-quick-search input {
    min-width: 0;
    width: 100%;
  }

  .application-filter-panel {
    grid-template-columns: 1fr;
  }

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

  .admin-list-head {
    display: none;
  }

  .admin-application-row {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .admin-upload-form {
    grid-template-columns: 1fr;
  }

  .email-management-grid {
    grid-template-columns: 1fr;
  }

  .upload-system-grid {
    grid-template-columns: 1fr;
  }

  .associate-table-head,
  .application-type-head,
  .loan-settings-head,
  .simple-settings-head,
  .progress-settings-head,
  .api-connections-head,
  .automations-head {
    display: none;
  }

  .associate-row,
  .application-type-row,
  .loan-settings-row,
  .simple-settings-row,
  .progress-settings-row,
  .api-connections-row,
  .api-connections-form,
  .email-delivery-form,
  .automations-row,
  .automations-form {
    grid-template-columns: 1fr;
  }

  .client-list-head {
    display: none;
  }

  .client-list-row {
    grid-template-columns: 1fr;
  }

  .crm-metrics,
  .crm-filters,
  .crm-layout {
    grid-template-columns: 1fr;
  }

  .crm-list-head {
    display: none;
  }

  .crm-client-row {
    grid-template-columns: 1fr;
  }

  .client-detail-summary {
    grid-template-columns: 1fr;
  }

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

  .client-detail-answer-grid {
    grid-template-columns: 1fr;
  }

  .reports-controls {
    grid-template-columns: 1fr;
  }

  .archive-list-head {
    display: none;
  }

  .admin-payouts-head {
    display: none;
  }

  .admin-payout-row {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .archive-row {
    grid-template-columns: 1fr;
  }

  .archive-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .loan-chart-row {
    grid-template-columns: 70px 1fr 32px;
  }

  .admin-access-head {
    display: none;
  }

  .admin-access-row,
  .admin-access-form {
    grid-template-columns: 1fr;
  }

  .manual-user-form {
    grid-template-columns: 1fr;
  }

  .admin-answers-list {
    grid-template-columns: 1fr;
  }

  .access-group-wide {
    grid-template-columns: 1fr;
  }

  .password-reset-row {
    grid-template-columns: 1fr;
  }

  .site-nav {
    align-items: flex-start;
  }

  .nav-greeting span,
  .nav-links {
    font-size: 0.95rem;
  }

  .nav-links {
    gap: 13px;
  }

  .loan-head {
    display: none;
  }

  .loan-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px 0;
    border-top: 1px solid #9d8cff;
  }

  .progress-pill {
    width: 100%;
  }

  .dashboard-details {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .files-panel,
  .notes-panel {
    border-left: 0;
    border-top: 1px solid #8c949e;
    padding-left: 0;
    padding-top: 20px;
  }

  .help-block {
    margin-top: 26px;
  }

  .dashboard-footer p {
    align-items: flex-start;
  }

  #prequal-form {
    margin-top: 62px;
  }

  .answer-area {
    gap: 18px;
  }

  .actions {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .ghost {
    order: 2;
  }

  .primary {
    order: 1;
    width: 100%;
  }
}
