:root {
  --orange: #ff6600;
  --orange-700: #d94f00;
  --gold: #ffc328;
  --black: #252525;
  --ink: #1f1b18;
  --muted: #70665f;
  --cream: #fff8ef;
  --paper: #ffffff;
  --bg: #f6f2ed;
  --line: #e8ddd5;
  --shadow: 0 24px 70px rgba(37, 37, 37, 0.11);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  font-size: 15px;
}

body {
  min-height: 100%;
  margin: 0;
  background:
    linear-gradient(135deg, rgba(255, 102, 0, 0.08), transparent 34rem),
    radial-gradient(circle at 92% 12%, rgba(255, 195, 40, 0.2), transparent 19rem),
    var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", Inter, Arial, sans-serif;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(37, 37, 37, 0.06);
  backdrop-filter: blur(14px);
}

.site-header::before {
  content: "";
  display: block;
  height: 5px;
  background: linear-gradient(90deg, var(--orange), var(--gold));
}

.site-nav {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--black);
  text-decoration: none;
  font-weight: 900;
}

.brand:hover {
  color: var(--black);
}

.brand img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  display: block;
}

.brand span {
  font-size: 17px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links form {
  margin: 0;
}

.nav-links a,
.nav-links button,
.nav-user {
  border: 0;
  background: transparent;
  color: #3d352f;
  padding: 9px 13px;
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
  line-height: 1;
}

.nav-links a:hover,
.nav-links button:hover {
  color: var(--orange-700);
  background: #fff1e5;
}

.nav-user {
  color: var(--muted);
  background: #f3ece6;
}

.app-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 22px 56px;
}

.site-footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 22px 24px;
  color: var(--muted);
  font-size: 13px;
}

.portal-entry,
.admin-signin {
  min-height: calc(100vh - 170px);
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.72fr);
  gap: 26px;
  align-items: stretch;
}

.entry-story,
.signin-panel {
  position: relative;
  overflow: hidden;
  min-height: 560px;
  padding: 42px;
  color: #fff;
  background:
    linear-gradient(145deg, rgba(37, 37, 37, 0.98), rgba(37, 37, 37, 0.86)),
    linear-gradient(90deg, var(--orange), var(--gold));
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.entry-story::after,
.signin-panel::after {
  content: "";
  position: absolute;
  right: -88px;
  bottom: -92px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--orange), var(--gold));
  opacity: 0.9;
}

.story-logo,
.signin-panel img {
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  background: #fff;
  border-radius: 8px;
  margin-bottom: 34px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.2);
}

.story-logo img,
.signin-panel img {
  object-fit: contain;
}

.story-logo img {
  width: 88px;
  height: 88px;
}

.signin-panel img {
  padding: 14px;
}

.eyebrow {
  color: var(--orange);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.entry-story .eyebrow,
.signin-panel .eyebrow {
  color: var(--gold);
}

.entry-story h1,
.signin-panel h1 {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 12px 0 18px;
  font-size: clamp(2.2rem, 4vw, 4.35rem);
  line-height: 0.98;
  font-weight: 950;
  letter-spacing: -0.03em;
}

.entry-story p,
.signin-panel p {
  position: relative;
  z-index: 1;
  max-width: 620px;
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 1.06rem;
  line-height: 1.7;
}

.story-points {
  position: absolute;
  left: 42px;
  right: 42px;
  bottom: 38px;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.story-points span {
  min-height: 72px;
  display: flex;
  align-items: end;
  padding: 14px;
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: #fff;
  font-weight: 850;
}

.entry-card,
.signin-card {
  align-self: center;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 34px;
  box-shadow: var(--shadow);
}

.entry-card-head {
  margin-bottom: 24px;
}

.entry-card-head h2 {
  margin: 6px 0 0;
  color: var(--black);
  font-size: 1.9rem;
  font-weight: 950;
  letter-spacing: -0.02em;
}

.leadway-form {
  display: grid;
  gap: 16px;
}

.form-field {
  display: grid;
  gap: 7px;
}

.form-field label,
.form-label {
  color: #3b332d;
  font-size: 0.92rem;
  font-weight: 850;
}

.form-field input,
.form-control,
.form-select {
  width: 100%;
  min-height: 48px;
  border: 1px solid #d7cbc2;
  border-radius: 8px;
  padding: 11px 13px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  outline: none;
}

.form-field input::placeholder,
.form-control::placeholder,
.report-search-field input::placeholder,
textarea::placeholder {
  color: #cfc6bf;
  opacity: 1;
  font-weight: 500;
}

.form-field input:disabled,
.form-control:disabled,
.calculated-input:disabled {
  color: #4f4640;
  background: #f4f1ed;
}

.field-hint {
  display: block;
  margin-top: 6px;
  color: #84776d;
  font-size: 0.82rem;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.field-hint.is-success {
  color: #126244;
}

.field-hint.is-error {
  color: #b42318;
}

.form-field input:focus,
.form-control:focus,
.form-select:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(255, 102, 0, 0.14);
}

.leadway-select {
  width: 100%;
  min-height: 48px;
  border: 1px solid #d7cbc2;
  border-radius: 8px;
  padding: 11px 42px 11px 13px;
  background:
    linear-gradient(45deg, transparent 50%, #4f4640 50%) calc(100% - 22px) 50% / 7px 7px no-repeat,
    linear-gradient(135deg, #4f4640 50%, transparent 50%) calc(100% - 16px) 50% / 7px 7px no-repeat,
    #fffaf5;
  color: var(--ink);
  font: inherit;
  outline: none;
  appearance: none;
}

.leadway-select:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(255, 102, 0, 0.14);
}

.primary-action,
.btn-primary {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  padding: 12px 18px;
  background: linear-gradient(135deg, var(--orange), #f28b18);
  color: #fff;
  font-weight: 950;
  box-shadow: 0 12px 28px rgba(255, 102, 0, 0.24);
}

.primary-action:hover,
.btn-primary:hover {
  background: linear-gradient(135deg, var(--orange-700), var(--orange));
  color: #fff;
}

.btn,
.btn-outline-primary,
.btn-outline-secondary {
  border-radius: 8px;
  font-weight: 850;
}

.btn-outline-primary {
  color: var(--orange-700);
  border-color: var(--orange);
}

.btn-outline-primary:hover {
  color: #fff;
  background: var(--orange);
  border-color: var(--orange);
}

.demo-note {
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.entry-assurance .app-build-info {
  margin-top: 8px;
  color: #8d7c70;
  font-size: 0.74rem;
  font-weight: 800;
}

.alert-warning {
  color: #633500;
  background: #fff2df;
  border-color: #ffd39f;
  border-radius: 8px;
}

.page-band,
.admin-hero,
.metric,
.report-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 42px rgba(37, 37, 37, 0.07);
}

.page-band {
  padding: 24px;
}

.page-title {
  margin-bottom: 5px;
  color: var(--black);
  font-weight: 950;
  letter-spacing: -0.02em;
}

.section-title {
  color: var(--black);
  font-size: 1.04rem;
  font-weight: 950;
  margin: 0 0 14px;
}

.muted-copy {
  color: var(--muted);
}

.metric {
  position: relative;
  overflow: hidden;
  padding: 18px;
}

.metric::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--orange), var(--gold));
}

.metric-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.metric-value {
  color: var(--black);
  font-size: 1.1rem;
  font-weight: 950;
}

.admin-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
}

.admin-report-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 28px 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 102, 0, 0.05), transparent 48%),
    #ffffff;
  box-shadow: 0 16px 42px rgba(37, 37, 37, 0.07);
}

.admin-hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.signed-in {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 750;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.report-panel {
  overflow: hidden;
}

.report-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, var(--cream));
}

.report-panel-head-stacked {
  display: grid;
  grid-template-columns: minmax(260px, 0.45fr) minmax(0, 1fr);
  align-items: end;
  gap: 22px;
}

.report-filter-form {
  display: grid;
  grid-template-columns: minmax(240px, 1.3fr) minmax(150px, 0.7fr) minmax(140px, 0.62fr) minmax(140px, 0.62fr) auto;
  align-items: end;
  gap: 12px;
}

.report-filter-form.simple-report-filter {
  grid-template-columns: minmax(260px, 1fr) auto;
}

.report-search-field,
.report-filter-field {
  display: grid;
  gap: 6px;
}

.report-search-field label,
.report-filter-field label {
  color: #594f48;
  font-size: 0.74rem;
  font-weight: 950;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.report-search-field input,
.report-filter-field input,
.report-filter-field select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #d7cbc2;
  border-radius: 8px;
  padding: 10px 13px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  outline: none;
}

.report-search-field input:focus,
.report-filter-field input:focus,
.report-filter-field select:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(255, 102, 0, 0.14);
}

.report-filter-actions {
  display: flex;
  align-items: end;
  gap: 8px;
}

.report-filter-actions .primary-action,
.report-filter-actions .secondary-action {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  text-decoration: none;
}

.report-status-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: #fffaf5;
}

.report-status-tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #5d524b;
  font-weight: 900;
  text-decoration: none;
}

.report-status-tabs a:hover,
.report-status-tabs a.is-active {
  border-color: #efc6a4;
  color: var(--orange-700);
  background: #ffffff;
}

.bulk-action-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.bulk-action-panel h3 {
  margin: 0;
  color: var(--black);
  font-size: 1rem;
  font-weight: 950;
}

.bulk-action-panel p {
  max-width: 720px;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.bulk-upload-form {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 0 0 auto;
}

.bulk-upload-form input[type="file"] {
  max-width: 280px;
  border: 1px solid #d7cbc2;
  border-radius: 8px;
  padding: 10px;
  background: #fffaf5;
  color: var(--ink);
  font-weight: 750;
}

.report-table-wrap {
  overflow: visible;
}

.report-table {
  margin: 0;
  width: 100%;
  table-layout: fixed;
}

.report-table thead th {
  color: #594f48;
  background: #fff1e5;
  border-bottom: 1px solid #efd4bf;
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
}

.admin-data-table {
  width: 100%;
}

.admin-data-table tbody td {
  vertical-align: middle;
}

.admin-data-table .amount-col {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.admin-data-table .action-col {
  width: 86px;
}

.admin-data-table .date-col {
  width: 118px;
}

.admin-data-table .policy-col {
  width: 136px;
}

.admin-data-table .amount-col {
  width: 160px;
}

.admin-data-table .tenor-col {
  width: 96px;
}

.admin-data-table .decision-col {
  width: 118px;
}

.admin-data-table .reference-col {
  width: 122px;
}

.table-main {
  display: block;
  color: var(--black);
  font-weight: 850;
}

.breakable {
  overflow-wrap: anywhere;
}

.report-empty-state {
  padding: 54px 18px !important;
  text-align: center;
}

.report-empty-state strong,
.report-empty-state span {
  display: block;
}

.report-empty-state strong {
  color: var(--black);
  font-size: 1.15rem;
}

.report-empty-state span {
  margin-top: 6px;
  color: var(--muted);
}

.report-table tbody td {
  border-color: #f0e8e2;
  padding-top: 14px;
  padding-bottom: 14px;
}

.report-table tbody tr:hover {
  background: #fffaf5;
}

.table-date,
.table-sub {
  display: block;
}

.table-sub {
  color: var(--muted);
  font-size: 0.84rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.82rem;
  font-weight: 950;
}

.status-pill.accepted {
  color: #145b43;
  background: #e2f5ec;
}

.status-pill.rejected {
  color: #8a3c08;
  background: #fff0dc;
}

.status-pill.pending {
  color: #675400;
  background: #fff7c9;
}

.status-pill.active-loan {
  color: #145b43;
  background: #e2f5ec;
}

.status-pill.inactive-loan {
  color: #7b271a;
  background: #ffe7e2;
}

.table-action-cell {
  text-align: left;
  white-space: nowrap;
}

.table-view-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 14px;
  border: 1px solid var(--orange);
  border-radius: 8px;
  color: var(--orange-700);
  background: #ffffff;
  font-weight: 950;
  text-decoration: none;
}

.table-view-link:hover {
  color: #ffffff;
  background: var(--orange);
}

.report-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  border-top: 1px solid var(--line);
  background: #fffaf5;
}

.pagination-summary {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

.pagination-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pager-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid #efd4bf;
  border-radius: 8px;
  color: #5d524b;
  background: #ffffff;
  font-weight: 950;
  text-decoration: none;
}

.pager-link:hover,
.pager-link.is-active {
  border-color: var(--orange);
  color: #ffffff;
  background: var(--orange);
}

.pager-link.is-disabled {
  color: #a49a93;
  background: #f4eee8;
  cursor: not-allowed;
}

.loan-detail-hero {
  align-items: center;
}

.loan-detail-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.loan-detail-actions form {
  margin: 0;
}

.danger-action {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  padding: 12px 18px;
  color: #ffffff;
  background: #c73b2f;
  font-weight: 950;
  box-shadow: 0 12px 28px rgba(199, 59, 47, 0.18);
}

.danger-action:hover {
  background: #a93027;
}

.loan-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.62fr);
  gap: 18px;
}

.detail-list,
.detail-status-stack,
.detail-metrics {
  display: grid;
  gap: 12px;
}

.detail-list div,
.detail-status-stack div,
.detail-metrics div {
  min-width: 0;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf4;
}

.detail-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-list span,
.detail-status-stack span,
.detail-metrics span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.detail-list strong,
.detail-status-stack strong,
.detail-metrics strong {
  display: block;
  margin-top: 5px;
  color: var(--black);
  font-size: 1rem;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.rejection-detail-panel {
  border-color: #f4c7b3;
  background: #fff8f2;
}

.rejection-feedback-grid {
  grid-template-columns: minmax(220px, 0.4fr) minmax(0, 1fr);
}

.application-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.registered-email {
  min-width: 260px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--cream);
}

.registered-email span,
.section-kicker {
  display: block;
  color: var(--orange-700);
  font-size: 0.75rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.registered-email strong {
  display: block;
  margin-top: 4px;
  color: var(--black);
  font-size: 1.02rem;
}

.policy-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.policy-item {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #fffaf4);
}

.policy-item span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.policy-item strong {
  display: block;
  color: var(--black);
  font-size: 1.02rem;
  font-weight: 950;
  line-height: 1.25;
}

.loan-request-form {
  display: grid;
  gap: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.full-span {
  grid-column: 1 / -1;
}

.existing-loan-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffaf5;
  color: var(--black);
  font-weight: 850;
  cursor: pointer;
}

.existing-loan-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--orange);
}

.existing-loan-fields {
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 18px;
  border: 1px dashed #f0b078;
  border-radius: 8px;
  background: #fff8ef;
}

.existing-loan-fields.is-visible {
  display: grid;
}

.calculated-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 16px;
  border: 1px solid #efd4bf;
  border-radius: 8px;
  background: #fffaf5;
}

.calculated-action-field {
  align-self: end;
}

.eligibility-status {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 68px;
  padding: 14px 16px;
  border: 1px solid #ddd4cc;
  border-radius: 8px;
  background: #faf9f8;
  color: var(--muted);
}

.eligibility-indicator {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  margin-top: 4px;
  border: 3px solid #a9a29c;
  border-radius: 50%;
  background: #fff;
}

.eligibility-status strong,
.eligibility-status span:not(.eligibility-indicator) {
  display: block;
}

.eligibility-status strong {
  color: var(--black);
  font-weight: 950;
}

.eligibility-status span:not(.eligibility-indicator) {
  margin-top: 3px;
  font-size: 0.88rem;
  line-height: 1.4;
}

.eligibility-status.is-checking {
  border-color: #f1c69f;
  background: #fff8ef;
  color: #805020;
}

.eligibility-status.is-checking .eligibility-indicator {
  border-top-color: var(--orange);
  animation: eligibility-spin 0.8s linear infinite;
}

.eligibility-status.is-eligible {
  border-color: #8fd7b5;
  background: #effaf4;
  color: #145b43;
}

.eligibility-status.is-eligible .eligibility-indicator {
  border-color: #16875f;
  background: #19a974;
  box-shadow: 0 0 0 4px rgba(25, 169, 116, 0.13);
}

.eligibility-status.is-ineligible {
  border-color: #edaaa5;
  background: #fff3f2;
  color: #9b261e;
}

.eligibility-status.is-ineligible .eligibility-indicator {
  border-color: #c9362c;
  background: #dc3e34;
  box-shadow: 0 0 0 4px rgba(220, 62, 52, 0.12);
}

.eligibility-status.is-eligible strong {
  color: #0f6043;
}

.eligibility-status.is-ineligible strong {
  color: #9b261e;
}

@keyframes eligibility-spin {
  to {
    transform: rotate(360deg);
  }
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.secondary-action {
  min-height: 48px;
  border: 2px solid var(--orange);
  border-radius: 8px;
  padding: 12px 20px;
  background: #fff;
  color: var(--orange-700);
  font-weight: 950;
}

.secondary-action:hover {
  background: #fff1e5;
}

.form-actions .primary-action {
  min-width: 170px;
}

.text-danger {
  color: #b42318 !important;
}

.otp-countdown {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 18px;
  padding: 13px 15px;
  border: 1px solid #efd4bf;
  border-radius: 8px;
  background: #fff8ef;
}

.otp-countdown span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.otp-countdown strong {
  color: var(--orange-700);
  font-size: 1.25rem;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.otp-countdown.is-expired {
  border-color: #f2beb7;
  background: #fff0ef;
}

.otp-countdown.is-expired strong {
  color: #b42318;
}

.validation-panel {
  display: flex;
  gap: 14px;
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid #f4c7b3;
  border-left: 5px solid var(--orange);
  border-radius: 8px;
  background: #fff8f2;
  color: #5f2e00;
}

.validation-panel h2 {
  margin: 0 0 6px;
  color: #3d2210;
  font-size: 1rem;
  font-weight: 950;
}

.validation-panel ul {
  margin: 0;
  padding-left: 18px;
}

.validation-icon {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--orange);
  font-weight: 950;
}

.leadway-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(31, 27, 24, 0.58);
}

.leadway-modal-backdrop[hidden] {
  display: none !important;
}

.modal-lock {
  overflow: hidden;
}

.leadway-modal {
  width: min(980px, 100%);
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.26);
}

.leadway-modal-head {
  padding: 22px 28px;
  border-bottom: 1px solid var(--line);
}

.leadway-modal-head h2 {
  margin: 4px 0 0;
  color: var(--black);
  font-weight: 950;
}

.leadway-modal-body {
  overflow: auto;
  padding: 24px 28px;
}

.leadway-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 28px;
  border-top: 1px solid var(--line);
  background: #fffaf5;
}

.modal-close {
  position: absolute;
  margin: 14px;
  align-self: flex-end;
  border: 0;
  background: transparent;
  color: #aaa19a;
  font-size: 1.6rem;
  font-weight: 950;
}

.quote-metrics,
.schedule-modal-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.schedule-data-table .amount-col {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.serial-col {
  width: 48px;
}

@media (max-width: 980px) {
  .portal-entry,
  .admin-signin {
    grid-template-columns: 1fr;
  }

  .entry-story,
  .signin-panel {
    min-height: 420px;
  }

  .story-points {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    margin-top: 28px;
  }

  .admin-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-report-hero,
  .report-panel-head-stacked {
    grid-template-columns: 1fr;
  }

  .admin-report-hero {
    display: grid;
  }

  .report-filter-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-filter-form.simple-report-filter {
    grid-template-columns: 1fr;
  }

  .report-search-field,
  .report-filter-actions {
    grid-column: 1 / -1;
  }

  .policy-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calculated-fields,
  .quote-metrics,
  .schedule-modal-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .existing-loan-fields {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .site-nav {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 16px;
  }

  .nav-links {
    width: 100%;
    justify-content: space-between;
  }

  .app-shell {
    padding: 18px 14px 42px;
  }

  .entry-story,
  .signin-panel,
  .entry-card,
  .signin-card,
  .page-band,
  .admin-hero,
  .report-panel-head {
    padding: 20px;
  }

  .entry-story h1,
  .signin-panel h1 {
    font-size: 2.25rem;
  }

  .story-points,
  .admin-metrics,
  .policy-summary,
  .form-grid,
  .calculated-fields,
  .quote-metrics,
  .schedule-modal-summary {
    grid-template-columns: 1fr;
  }

  .report-filter-form {
    grid-template-columns: 1fr;
  }

  .report-status-tabs {
    overflow-x: auto;
    padding: 12px 16px;
  }

  .report-filter-actions {
    display: grid;
  }

  .application-heading {
    display: block;
  }

  .registered-email {
    margin-top: 16px;
    min-width: 0;
  }

  .form-actions {
    display: grid;
  }

  .secondary-action,
  .form-actions .primary-action {
    width: 100%;
  }
}

.action-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.action-status {
  min-width: 240px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fffaf4, #ffffff);
}

.action-hero-side {
  display: grid;
  gap: 12px;
  justify-items: stretch;
}

.client-logout-form {
  margin: 0;
}

.client-logout-button {
  width: 100%;
  min-height: 44px;
  border-color: #d7cbc2;
  color: #4a4038;
  background: #ffffff;
}

.client-logout-button:hover {
  border-color: var(--orange);
  color: var(--orange-700);
  background: #fff1e5;
}

.action-status span,
.loan-mini-summary span,
.document-summary span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.action-status strong,
.loan-mini-summary strong,
.document-summary strong {
  display: block;
  margin-top: 5px;
  color: var(--black);
  font-size: 1.04rem;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.journey-card {
  min-height: 320px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 102, 0, 0.08), rgba(255, 195, 40, 0.08)),
    #ffffff;
  box-shadow: var(--shadow);
}

.journey-card-content {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 30px;
}

.journey-card h2 {
  margin: 12px 0 10px;
  color: var(--black);
  font-size: 1.8rem;
  font-weight: 950;
  letter-spacing: -0.02em;
}

.journey-card p {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.62;
}

.journey-card small {
  margin-top: 10px;
  color: var(--muted);
  font-weight: 750;
}

.journey-card.is-disabled {
  background: #f7f2ed;
  box-shadow: none;
}

.journey-card.is-disabled h2,
.journey-card.is-disabled p {
  color: #83786f;
}

.journey-card.is-disabled .secondary-action:disabled {
  border-color: #d7cbc2;
  color: #8a817a;
  background: #ffffff;
  cursor: not-allowed;
}

.journey-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: auto;
  text-decoration: none;
}

.loan-mini-summary {
  width: 100%;
  margin: auto 0 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf4;
}

.document-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.56fr) minmax(0, 1.04fr);
  gap: 18px;
}

.document-summary {
  display: grid;
  gap: 12px;
}

.document-summary div {
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf4;
}

.success-panel {
  display: grid;
  gap: 4px;
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid #bfe7d3;
  border-left: 5px solid #19a974;
  border-radius: 8px;
  background: #effaf4;
  color: #145b43;
}

.success-panel strong {
  color: #0e4b35;
  font-weight: 950;
}

.uploaded-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  counter-reset: uploaded-document;
  list-style: none;
}

.uploaded-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf4;
  color: var(--black);
  overflow-wrap: anywhere;
  counter-increment: uploaded-document;
}

.uploaded-list li::before {
  content: counter(uploaded-document);
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 50%;
  background: #fff0df;
  color: var(--orange-700);
  font-size: 0.82rem;
  font-weight: 950;
}

.selected-document-preview {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid #efc49f;
  border-radius: 8px;
  background: #fffaf4;
}

.document-signature-notice {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 18px 0;
  padding: 16px 18px;
  border: 1px solid #f0b46f;
  border-left: 5px solid var(--orange);
  border-radius: 8px;
  background: #fff4e7;
  color: #643700;
}

.document-signature-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  font-weight: 950;
}

.document-signature-notice strong {
  display: block;
  color: #4b2600;
  font-weight: 950;
}

.document-signature-notice p {
  margin: 5px 0 0;
  line-height: 1.45;
  font-weight: 700;
}

.document-requirement-list {
  margin: 10px 0 8px;
  padding-left: 22px;
  color: #4b2600;
  font-weight: 800;
  line-height: 1.6;
}

.document-requirement-list li::marker {
  color: var(--orange);
}

.selected-document-preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.selected-document-preview-heading strong {
  color: var(--black);
  font-weight: 950;
}

.text-action {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--orange-700);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 900;
  cursor: pointer;
}

.text-action:hover,
.text-action:focus-visible {
  text-decoration: underline;
}

.selected-document-list {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding-left: 28px;
}

.selected-document-list li {
  padding-left: 4px;
  color: var(--orange-700);
}

.selected-document-list strong,
.selected-document-list span {
  display: block;
}

.selected-document-list strong {
  color: var(--black);
  font-weight: 850;
  overflow-wrap: anywhere;
}

.selected-document-list span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.8rem;
}

.document-review-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.document-count {
  display: grid;
  min-width: 112px;
  padding: 12px 16px;
  border: 1px solid #f1c69f;
  border-radius: 8px;
  background: #fff6eb;
  text-align: center;
}

.document-count strong {
  color: var(--orange-700);
  font-size: 1.45rem;
  font-weight: 950;
  line-height: 1;
}

.document-count span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 850;
  text-transform: uppercase;
}

.uploaded-file-details {
  flex: 1 1 auto;
  min-width: 0;
}

.uploaded-file-details strong,
.uploaded-file-details span {
  display: block;
}

.uploaded-file-details strong {
  color: var(--black);
  font-weight: 900;
}

.uploaded-file-details span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
}

.uploaded-file-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.uploaded-file-actions form {
  margin: 0;
}

.compact-action {
  min-height: 38px;
  padding: 8px 14px;
  text-decoration: none;
}

.document-empty-state {
  display: grid;
  gap: 5px;
  padding: 24px;
  border: 1px dashed #d9c9bc;
  border-radius: 8px;
  background: #fffcf8;
  color: var(--muted);
  text-align: center;
}

.document-empty-state strong {
  color: var(--black);
  font-weight: 950;
}

.document-submit-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-top: 20px;
  padding: 18px;
  border: 1px solid #efc49f;
  border-radius: 8px;
  background: linear-gradient(180deg, #fff8ef, #fffdfb);
}

.document-submit-panel > div > strong,
.document-submit-panel > div > span {
  display: block;
}

.document-submit-panel > div > strong {
  margin-top: 4px;
  color: var(--black);
  font-size: 1.02rem;
  font-weight: 950;
}

.document-submit-panel > div > span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.88rem;
}

.document-submit-panel form {
  margin: 0;
  flex: 0 0 auto;
}

@media (max-width: 980px) {
  .action-grid,
  .document-layout,
  .loan-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .action-hero {
    display: block;
  }

  .action-status {
    min-width: 0;
    margin-top: 16px;
  }

  .action-hero-side {
    margin-top: 16px;
  }

  .action-hero-side .action-status {
    margin-top: 0;
  }

  .document-review-heading,
  .uploaded-list li,
  .document-submit-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .document-count {
    width: 100%;
  }

  .uploaded-file-actions,
  .uploaded-file-actions a,
  .uploaded-file-actions form,
  .uploaded-file-actions button,
  .document-submit-panel form,
  .document-submit-panel button {
    width: 100%;
  }

  .journey-card-content {
    padding: 22px;
  }

  .journey-action {
    width: 100%;
  }

  .loan-detail-actions,
  .loan-detail-actions .secondary-action,
  .loan-detail-actions form,
  .loan-detail-actions button {
    width: 100%;
  }

  .detail-metrics {
    grid-template-columns: 1fr;
  }
}
