/* ================================================================
   Redesigned loan request, approvals and payment capture
   ================================================================ */
[hidden] { display: none !important; }

.nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  background: var(--gold);
  color: #3a2a08;
  font-size: 10.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
}

.assigned-branch {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid #cfe6db;
  background: linear-gradient(135deg, #f4fbf7, #fff);
  border-radius: 11px;
}
.assigned-branch svg { width: 20px; height: 20px; color: var(--green-700); flex: none; }
.assigned-branch .grow { flex: 1; min-width: 0; }
.assigned-branch strong { display: block; font-size: 13px; }
.assigned-branch small { display: block; font-size: 11.5px; color: var(--muted); }

.loan-notice {
  padding: 13px 16px;
  border-radius: 10px;
  background: var(--info-soft);
  border: 1px solid #d3e2fb;
  color: #124b9f;
  font-size: 12.8px;
}
.loan-notice strong { color: #0d3d87; }

.loan-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 365px;
  gap: 22px;
  align-items: start;
}
.loan-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.loan-side {
  position: sticky;
  top: 78px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.loan-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.loan-panel-head { display: flex; gap: 14px; align-items: flex-start; padding: 20px 22px 0; }
.loan-panel-head h2 { font-size: 19px; }
.loan-panel-head p { margin: 3px 0 0; font-size: 12.2px; color: var(--muted); }
.loan-panel-body { padding: 18px 22px 22px; }
.step-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--green-900), var(--green-700));
  color: var(--gold);
  display: grid;
  place-items: center;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .04em;
  flex: none;
  box-shadow: 0 6px 14px rgba(15, 76, 58, .22);
}

.selected-customer {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid #cfe6db;
  background: linear-gradient(180deg, #f7fcf9, #fff);
  border-radius: 12px;
}
.selected-customer .grow { flex: 1; min-width: 0; }
.selected-customer .strong { font-size: 14px; }
.customer-empty {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  padding: 14px;
  background: #fbfcfa;
}
.customer-empty .empty-icon { margin: 0; width: 38px; height: 38px; flex: none; }

/* Product cards */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 10px; }
.product-option {
  position: relative;
  display: block;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  background: #fff;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.product-option:hover { border-color: #b9d8cb; }
.product-option:has(input:checked),
.product-option.is-selected {
  border-color: var(--green-700);
  background: #f6fbf8;
  box-shadow: 0 0 0 3px rgba(20, 108, 82, .09);
}
.product-radio { position: absolute; opacity: 0; pointer-events: none; }
.product-option-body { display: flex; flex-direction: column; gap: 2px; }
.product-type { font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.product-option strong { font-size: 14.5px; }
.product-meta { font-size: 11.5px; color: var(--muted); }
.product-rate { margin-top: 7px; font-size: 11.5px; font-weight: 700; color: var(--green-800); }

/* Affixed inputs */
.input-prefix, .input-suffix { position: relative; display: flex; align-items: center; }
.input-prefix > span, .input-suffix > span {
  position: absolute;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  pointer-events: none;
}
.input-prefix > span { left: 12px; }
.input-suffix > span { right: 12px; }
.input-prefix input { padding-left: 52px; }
.input-suffix input { padding-right: 58px; }
.input-prefix input, .input-suffix input { min-height: 43px; font-weight: 600; }

/* Purpose */
.purpose-picker { display: flex; gap: 8px; }
.purpose-picker input { flex: 1; background: #fbfcfa; cursor: pointer; }

/* Security */
.security-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.security-tile {
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 13px;
  background: #fff;
  transition: border-color .15s ease, background .15s ease;
}
.security-tile:has(input:checked) { border-color: var(--green-700); background: #f8fcfa; }
.security-check { display: flex; gap: 11px; align-items: flex-start; cursor: pointer; margin: 0; }
.security-check input { width: 17px; height: 17px; accent-color: var(--green-800); margin-top: 2px; flex: none; min-height: 0; }
.security-check strong { display: block; font-size: 13px; }
.security-check small { display: block; font-size: 11.4px; color: var(--muted); line-height: 1.35; }
.security-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--green-100);
  color: var(--green-800);
  display: grid;
  place-items: center;
  font-weight: 700;
  flex: none;
}
.security-detail { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }

/* Live summary */
.loan-summary-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.loan-summary-head { padding: 19px 20px 16px; background: linear-gradient(150deg, var(--green-950), var(--green-800)); color: #fff; }
.loan-summary-head h2 { color: #fff; font-size: 20px; margin-top: 3px; }
.loan-summary-head .eyebrow { color: var(--gold); }
.loan-summary-head .muted { color: rgba(255, 255, 255, .62) !important; }
.loan-summary-body { padding: 18px 20px 20px; }
.summary-facts > div { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dotted var(--line); font-size: 12.4px; }
.summary-facts span { color: var(--muted); }
.summary-facts strong { font-weight: 600; text-align: right; }
.summary-divider { height: 1px; background: var(--line); margin: 15px 0; }
.summary-lines > div { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: 13px; }
.summary-lines .deduct strong { color: var(--danger); }
.summary-lines .net-line { padding: 11px 0 3px; margin-top: 4px; border-top: 1.5px solid var(--ink); font-size: 15px; font-weight: 700; }
.summary-lines .net-line strong { color: var(--green-800); font-family: Georgia, serif; font-size: 21px; }
.summary-lines.subtle span { color: var(--muted); }
.summary-lines.subtle strong { font-weight: 600; }
.summary-footnote {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding: 11px 12px;
  border-radius: 9px;
  background: var(--gold-soft);
  color: #6e4d0d;
  font-size: 11.4px;
  line-height: 1.45;
}
.summary-footnote svg { width: 15px; height: 15px; flex: none; margin-top: 1px; }
.summary-submit { margin-top: 16px; min-height: 44px; font-size: 13.5px; }
.muted-card .loan-summary-head { background: #f7f9f5; color: var(--ink); }
.muted-card .loan-summary-head h2 { color: var(--ink); }
.muted-card .loan-summary-head .eyebrow { color: var(--muted); }
.mini-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 12.2px; color: #41504a; }
.mini-steps li { display: flex; gap: 9px; align-items: flex-start; line-height: 1.4; }
.mini-steps li > span {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--green-100);
  color: var(--green-800);
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex: none;
}
.range-warning {
  background: var(--danger-soft);
  border: 1px solid #f5d2ce;
  color: #7a1c13;
  border-radius: 9px;
  padding: 9px 11px;
  font-size: 12px;
  margin: 12px 0;
}

/* Purpose modal */
body.modal-open { overflow: hidden; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 37, 29, .48);
  backdrop-filter: blur(2px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-card {
  width: 100%;
  max-width: 560px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(8, 37, 29, .35);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-head { display: flex; justify-content: space-between; gap: 12px; padding: 20px 22px 12px; align-items: flex-start; }
.modal-head h2 { font-size: 21px; margin-top: 2px; }
.modal-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.modal-close:hover { background: #f2f4f0; color: var(--ink); }
.modal-search { position: relative; margin: 0 22px 12px; }
.modal-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.modal-search input { padding-left: 36px; min-height: 40px; }
.purpose-list { overflow-y: auto; padding: 0 14px 14px; display: flex; flex-direction: column; gap: 6px; }
.purpose-option {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: #fbfcfa;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  font-family: inherit;
  color: var(--ink);
}
.purpose-option:hover { border-color: #cfe6db; background: #f6fbf8; }
.purpose-option.is-selected { border-color: var(--green-700); background: #f0faf5; }
.purpose-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--green-100);
  color: var(--green-800);
  font-weight: 700;
  display: grid;
  place-items: center;
  flex: none;
  font-size: 13px;
}
.purpose-option .grow { flex: 1; min-width: 0; }
.purpose-option strong { display: block; font-size: 13px; }
.purpose-option small { display: block; font-size: 11.3px; color: var(--muted); }
.purpose-select { font-size: 11px; font-weight: 700; color: var(--green-700); }
.purpose-empty { padding: 22px; text-align: center; color: var(--muted); font-size: 12.5px; }
.modal-loans { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.modal-loan {
  display: inline-block;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

/* Payment source */
.source-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.source-option {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
  background: #fff;
  transition: border-color .15s ease, background .15s ease;
}
.source-option:has(input:checked) { border-color: var(--green-700); background: #f6fbf8; }
.source-option input { accent-color: var(--green-800); margin-top: 2px; width: 15px; height: 15px; min-height: 0; flex: none; }
.source-option strong { display: block; font-size: 12.2px; }
.source-option small { display: block; font-size: 10.8px; color: var(--muted); line-height: 1.3; }

/* Review layout */
.review-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 22px; align-items: start; }
.review-main { min-width: 0; }
.review-side { position: sticky; top: 78px; display: flex; flex-direction: column; gap: 16px; }
.review-reject-card { border-color: #f5d2ce; }
.decision-card .loan-summary-body { padding-top: 16px; }

/* Password toggle */
.password-wrap { position: relative; display: flex; align-items: center; width: 100%; }
.password-wrap input { width: 100%; padding-right: 42px; }
.password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  border-radius: 7px;
}
.password-toggle:hover { background: #eef1eb; color: var(--ink); }
.password-toggle svg { width: 17px; height: 17px; }
.password-toggle .eye-slash { display: none; }
.password-toggle.is-visible { color: var(--green-800); }
.password-toggle.is-visible .eye-slash { display: block; }

/* SweetAlert polish */
.swal2-popup { font-family: "Segoe UI", system-ui, sans-serif !important; border-radius: 16px !important; }
.swal2-title { font-family: Georgia, serif !important; }
.swal-error-list { margin: 0; padding-left: 18px; text-align: left; font-size: 13px; line-height: 1.6; color: #33413b; }
.swal-range p { margin: 0 0 6px; font-size: 13px; color: #33413b; }
.swal-cancel { border: 1px solid var(--line-strong) !important; color: var(--ink) !important; }

@media (max-width: 1200px) {
  .loan-layout, .review-layout { grid-template-columns: 1fr; }
  .loan-side, .review-side { position: static; }
}

@media (max-width: 700px) {
  .loan-panel-head, .loan-panel-body { padding-left: 16px; padding-right: 16px; }
  .product-grid, .security-grid, .source-options { grid-template-columns: 1fr; }
  .purpose-picker { flex-direction: column; }
  .purpose-picker .btn { width: 100%; }
  .modal-backdrop { padding: 12px; align-items: flex-start; padding-top: 40px; }
  .loan-summary-body { padding: 16px; }
}
