/* Shared visual system enhancements. Colors continue to come from the portal theme tokens. */
.master-option-content{display:block;min-height:420px}.master-option-empty{min-height:270px;border:1px dashed var(--color-line);border-radius:18px;background:var(--color-surface-alt);display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:32px;color:var(--color-muted)}.master-option-empty>i{font-size:2rem;color:var(--color-primary);margin-bottom:10px}.master-option-empty>strong{color:var(--color-ink);font-size:1rem}.master-option-empty>span{margin-top:5px;font-size:.85rem}
.option-master-layout{display:grid;grid-template-columns:300px minmax(0,1fr);min-height:650px}.option-group-panel{border-right:1px solid var(--color-line);background:var(--color-surface-alt);padding:20px}.option-group-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}.option-group-heading small{display:block;color:var(--color-muted);font-size:.64rem;font-weight:800;letter-spacing:.08em}.option-group-heading h2{font-size:1.05rem;font-weight:800;margin:2px 0 0}.option-group-create{display:grid;gap:10px;padding:13px;margin-bottom:13px;border:1px solid var(--color-line);border-radius:12px;background:var(--color-surface)}.option-group-create label,.option-group-settings label,.option-add-form label{display:grid;gap:4px;color:var(--color-muted);font-size:.7rem;font-weight:750}.option-group-create .form-control,.option-group-settings .form-control,.option-add-form .form-control,.option-value-row .form-control{min-height:40px;padding:7px 10px}.option-group-list{display:grid;gap:5px;max-height:610px;overflow:auto;padding-right:3px}.option-group-link{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px;border:1px solid transparent;border-radius:10px;color:var(--color-ink)}.option-group-link>span:first-child{display:grid;min-width:0}.option-group-link strong{font-size:.78rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.option-group-link small{color:var(--color-muted);font-size:.62rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.option-group-link:hover{border-color:var(--color-line);background:var(--color-surface);color:var(--color-primary)}.option-group-link.active{border-color:var(--color-primary);background:var(--color-accent-soft);color:var(--color-primary)}.option-count{min-width:25px;height:25px;padding:0 6px;border-radius:999px;display:grid;place-items:center;background:var(--color-surface);color:var(--color-muted);font-size:.66rem;font-weight:800}.option-value-panel{padding:24px;min-width:0}.option-value-heading{display:flex;align-items:start;justify-content:space-between;gap:16px;margin-bottom:17px}.option-value-heading h2{font-size:1.45rem;font-weight:800;margin:3px 0}.option-value-heading p{margin:0;color:var(--color-muted);font-size:.82rem}.option-group-settings{margin-bottom:17px;border:1px solid var(--color-line);border-radius:12px;background:var(--color-surface-alt)}.option-group-settings summary{cursor:pointer;padding:12px 14px;font-size:.78rem;font-weight:750}.option-group-settings form{display:grid;grid-template-columns:1fr 2fr 100px auto auto;gap:10px;align-items:end;padding:0 14px 14px}.option-group-settings .form-check{display:flex;align-items:center;gap:7px;min-height:40px}.option-add-form{display:grid;grid-template-columns:1.1fr 1fr 1fr 90px auto;gap:10px;align-items:end;padding:14px;margin-bottom:17px;border:1px solid var(--color-line);border-radius:13px;background:var(--color-surface-alt)}.option-add-form .btn{min-height:40px}.option-value-table{border:1px solid var(--color-line);border-radius:13px;overflow:hidden}.option-value-table-head,.option-value-row{display:grid;grid-template-columns:1.15fr 1fr 1fr 80px 100px 42px;gap:8px;align-items:center;padding:9px 11px}.option-value-table-head{background:var(--color-sidebar);color:var(--color-inverse);font-size:.65rem;font-weight:800;text-transform:uppercase;letter-spacing:.04em}.option-value-row{border-top:1px solid var(--color-line);background:var(--color-surface)}.option-value-row:first-of-type{border-top:0}.option-value-row:hover{background:var(--color-surface-alt)}.option-code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.75rem}.option-status-toggle{display:flex;align-items:center;gap:6px;font-size:.72rem;color:var(--color-muted)}.option-status-toggle input{accent-color:var(--color-success)}
@media(max-width:1100px){.option-master-layout{grid-template-columns:240px minmax(0,1fr)}.option-group-settings form,.option-add-form{grid-template-columns:repeat(2,minmax(0,1fr))}.option-value-table{overflow-x:auto}.option-value-table-head,.option-value-row{min-width:760px}}
@media(max-width:760px){.option-master-layout{grid-template-columns:1fr}.option-group-panel{border-right:0;border-bottom:1px solid var(--color-line)}.option-group-list{display:flex;max-height:none;overflow:auto}.option-group-link{min-width:180px}.option-value-panel{padding:16px}}
:root {
  --ui-radius-sm: 10px;
  --ui-radius-md: 14px;
  --ui-radius-lg: 20px;
  --ui-shadow-sm: 0 1px 2px color-mix(in srgb, var(--color-ink) 5%, transparent), 0 9px 24px color-mix(in srgb, var(--color-ink) 5%, transparent);
  --ui-shadow-md: 0 2px 5px color-mix(in srgb, var(--color-ink) 7%, transparent), 0 18px 44px color-mix(in srgb, var(--color-ink) 9%, transparent);
}

html { max-width: 100%; overflow-x: hidden; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
.password-field { position: relative; }
.password-field .form-control { padding-right: 52px; }
.password-visibility-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--color-muted);
  font-size: 1.08rem;
  transform: translateY(-50%);
}
.password-visibility-toggle:hover { background: var(--color-accent-soft); color: var(--color-primary); }
.password-visibility-toggle:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 1px; }
body.agent-portal,
body.admin-portal {
  background: radial-gradient(circle at 100% 0, color-mix(in srgb, var(--color-primary) 7%, transparent), transparent 34rem), var(--color-canvas);
}

button,
a,
.btn,
.surface,
.section-card,
.application-card,
.stat-card,
.customer-result,
.kyc-card,
.master-panel {
  transition: color .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

body.agent-portal { height: 100dvh; overflow: hidden; }
.agent-portal .portal-shell {
  height: 100dvh;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  isolation: isolate;
}
@supports (height: 100svh) {
  body.agent-portal,
  .agent-portal .portal-shell { height: 100svh; }
}
.agent-portal .main-content.with-sticky-actions { padding-bottom: 130px; }
.topbar {
  background: color-mix(in srgb, var(--color-surface) 92%, transparent);
  backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--color-line) 70%, transparent);
}
.portal-user-summary { display: flex; align-items: center; gap: 9px; }
.portal-user-summary > span:last-child { display: grid; line-height: 1.15; text-align: right; }
.portal-user-summary small { color: var(--color-muted); font-size: .68rem; }
.portal-user-summary strong { font-size: .84rem; letter-spacing: -.01em; }
.agent-profile-toggle .profile-copy { min-width: 0; }
.agent-profile-toggle .profile-copy small { order: -1; }

.sidebar-eyebrow {
  display: block;
  padding: 0 12px;
  margin: 1px 0 8px;
  color: color-mix(in srgb, var(--color-sidebar-text) 65%, transparent);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .14em;
}
.agent-sidebar,
.admin-sidebar {
  background: radial-gradient(circle at 0 0, color-mix(in srgb, var(--color-primary) 32%, transparent), transparent 18rem), var(--color-sidebar);
  box-shadow: 10px 0 35px color-mix(in srgb, var(--color-ink) 8%, transparent);
}
.sidebar-brand { border: 0; box-shadow: 0 14px 34px color-mix(in srgb, var(--color-ink) 22%, transparent); }
.agent-sidebar .sidebar-nav a,
.agent-sidebar .sidebar-action,
.admin-sidebar .sidebar-nav > a,
.admin-sidebar .sidebar-nav > .sidebar-nav-toggle {
  position: relative;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--color-sidebar-text);
  padding: 10px 12px;
  border-radius: 11px;
  display: flex;
  gap: 10px;
  align-items: center;
  line-height: 1.2;
  text-align: left;
}
.agent-sidebar .sidebar-action { width: 100%; }
.agent-sidebar .sidebar-nav a i,
.agent-sidebar .sidebar-action i,
.admin-sidebar .sidebar-nav > a i { width: 18px; text-align: center; }
.agent-sidebar .sidebar-nav a:hover,
.agent-sidebar .sidebar-action:hover,
.admin-sidebar .sidebar-nav > a:hover {
  background: color-mix(in srgb, var(--color-inverse) 9%, transparent);
  color: var(--color-inverse);
  transform: translateX(2px);
}
.agent-sidebar .sidebar-nav a.active,
.agent-sidebar .sidebar-action.active,
.admin-sidebar .sidebar-nav > a.active {
  background: linear-gradient(135deg, var(--color-sidebar-active), color-mix(in srgb, var(--color-sidebar-active) 78%, var(--color-primary)));
  color: var(--color-inverse);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--color-ink) 18%, transparent);
}

.main-content { animation: page-enter .24s ease both; }
@keyframes page-enter { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
h1, h2, h3, .h1, .h2, .h3 { letter-spacing: -.025em; }
.page-heading { align-items: center; }
.page-heading h1 { margin-bottom: 3px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 26px 0 13px; }

.surface,
.section-card,
.application-card,
.customer-result,
.kyc-card,
.master-panel { box-shadow: var(--ui-shadow-sm); }
.surface,
.section-card,
.application-card,
.customer-result,
.kyc-card { border-color: color-mix(in srgb, var(--color-line) 85%, var(--color-surface)); }
.stat-card { position: relative; overflow: hidden; }
.stat-card::after {
  content: "";
  position: absolute;
  width: 92px;
  height: 92px;
  right: -35px;
  top: -42px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--color-primary) 7%, transparent);
  pointer-events: none;
}
.stat-card > i {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--color-accent-soft);
  color: var(--color-primary);
  font-size: 1.05rem;
  margin-bottom: 14px;
}
.stat-card .number { line-height: 1; letter-spacing: -.045em; margin-bottom: 6px; }
.dashboard-stat-link { display: block; color: inherit; text-decoration: none; }
.dashboard-stat-link:hover { color: inherit; }
.dashboard-stat-link:focus-visible { outline: 3px solid color-mix(in srgb, var(--color-primary) 45%, transparent); outline-offset: 3px; }
.dashboard-approved-summary { max-width: 560px; }
.dashboard-approved-filter { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; gap: 6px; margin-bottom: 8px; }
.dashboard-approved-filter label { display: grid; gap: 2px; min-width: 0; }
.dashboard-approved-filter label span { color: var(--color-muted); font-size: .58rem; font-weight: 800; line-height: 1; text-transform: uppercase; }
.agent-portal .dashboard-approved-filter .form-control,
.agent-portal .dashboard-approved-filter .btn { min-height: 34px; height: 34px; padding-block: 3px; font-size: .7rem; }
.agent-portal .dashboard-approved-filter .date-input-control { padding-right: 2.15rem; padding-left: .55rem; }
.agent-portal .dashboard-approved-filter .date-calendar-button { width: 2.15rem; }
.agent-portal .dashboard-approved-filter .btn { padding-inline: 9px; }
.agent-portal .dashboard-approved-filter .dashboard-approved-filter-button { width: 34px; padding: 0; display: grid; place-items: center; }
.dashboard-approved-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; }
.dashboard-approved-card strong { color: var(--color-primary); font-size: 1.45rem; line-height: 1; }
.dashboard-approved-card span { color: var(--color-muted); font-size: .76rem; font-weight: 750; }
.stat-card:hover,
.application-card:hover,
.customer-result:hover {
  border-color: color-mix(in srgb, var(--color-primary) 38%, var(--color-line));
  box-shadow: var(--ui-shadow-md);
  transform: translateY(-2px);
}
.application-card .btn { margin-top: 4px; }
.co-applicant-summary-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}
.co-applicant-summary-copy { min-width: 0; flex: 1; }
.co-applicant-delete-form { flex: none; }
.co-applicant-delete-button {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  margin-top: 0 !important;
  border-radius: 12px;
  font-size: 1rem;
}
.document-summary-view {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 9px;
}

/* Customer address map */
.customer-location-panel {
  overflow: hidden;
  border: 1px solid var(--color-line);
  border-radius: 14px;
  background: var(--color-surface);
  box-shadow: var(--ui-shadow-sm);
}
.customer-location-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-line);
}
.customer-location-heading > span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--color-success-bg);
  color: var(--color-success);
}
.customer-location-heading h2 { margin: 0; font-size: 1rem; font-weight: 800; }
.customer-location-proofs { display: flex; min-width: 0; margin-left: auto; }
.customer-location-proof-set { display: flex; align-items: center; justify-content: flex-end; gap: 7px; min-width: 0; }
.customer-location-proof-set[hidden] { display: none; }
.customer-location-proof-link,
.customer-location-proof-empty {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 6px 9px;
  border: 1px solid var(--color-line);
  border-radius: 8px;
  background: var(--color-surface-alt);
  color: var(--color-ink);
  font-size: .69rem;
  font-weight: 750;
  white-space: nowrap;
}
.customer-location-proof-link:hover { border-color: var(--color-primary); background: var(--color-accent-soft); color: var(--color-primary); }
.customer-location-proof-link > i:first-child { color: var(--color-primary); }
.customer-location-proof-link > i:last-child { color: var(--color-muted); }
.customer-location-proof-empty { border-style: dashed; color: var(--color-muted); font-weight: 650; }
.customer-location-layout {
  display: grid;
  grid-template-columns: minmax(230px, 290px) minmax(0, 1fr);
  min-height: 440px;
}
.customer-location-choices {
  display: grid;
  align-content: start;
  gap: 9px;
  padding: 12px;
  border-right: 1px solid var(--color-line);
  background: color-mix(in srgb, var(--color-surface-alt) 70%, var(--color-surface));
}
.customer-location-choice {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  padding: 11px;
  border: 1px solid var(--color-line);
  border-radius: 10px;
  background: var(--color-surface);
  color: var(--color-ink);
  text-align: left;
}
.customer-location-choice:not(.is-unavailable):hover {
  border-color: color-mix(in srgb, var(--color-primary) 48%, var(--color-line));
  background: var(--color-accent-soft);
}
.customer-location-choice.active {
  border-color: var(--color-primary);
  box-shadow: inset 0 0 0 1px var(--color-primary);
}
.customer-location-choice-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--color-surface-alt);
  color: var(--color-muted);
}
.customer-location-choice.active .customer-location-choice-icon {
  background: var(--color-primary);
  color: var(--color-primary-text);
}
.customer-location-choice > span:last-child { display: grid; gap: 5px; min-width: 0; }
.customer-location-choice-title { display: flex; align-items: center; gap: 6px; min-width: 0; }
.customer-location-choice strong { font-size: .8rem; }
.customer-location-choice-title em {
  flex: none;
  padding: 2px 5px;
  border-radius: 999px;
  background: var(--color-accent-soft);
  color: var(--color-primary);
  font-size: .55rem;
  font-style: normal;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}
.customer-location-choice small { color: var(--color-muted); font-size: .68rem; line-height: 1.45; overflow-wrap: anywhere; }
.customer-location-choice.is-unavailable { opacity: .68; border-style: dashed; }
.customer-location-map { position: relative; min-width: 0; background: var(--color-surface-alt); }
.customer-location-map iframe { display: block; width: 100%; height: 100%; min-height: 440px; border: 0; }
.customer-location-open {
  position: absolute;
  right: 12px;
  top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--color-line);
  border-radius: 9px;
  background: color-mix(in srgb, var(--color-surface) 94%, transparent);
  color: var(--color-primary);
  font-size: .72rem;
  font-weight: 750;
  box-shadow: var(--ui-shadow-sm);
}
.customer-location-map-empty { display: grid; place-items: center; align-content: center; gap: 9px; min-height: 440px; color: var(--color-muted); text-align: center; }
.customer-location-map-empty i { color: var(--color-primary); font-size: 2rem; }
.customer-tab-content .tab-pane { position: relative; }
.customer-tabbar { display: grid; grid-template-columns: minmax(0, 1fr) 34px; align-items: center; overflow: hidden; }
/* Loan tabs wrap onto a second row on narrow screens so no tab hides behind the download button. */
.customer-tabbar.loan-tabbar { display: flex; flex-wrap: wrap; row-gap: 7px; overflow: visible; }
.loan-tabbar .loan-form-download { position: static; margin-left: auto; flex-shrink: 0; display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border: 1px solid var(--color-sidebar); border-radius: 8px; background: var(--color-sidebar); color: var(--color-sidebar-text, #fff); font-size: .74rem; font-weight: 700; line-height: 1.2; white-space: nowrap; text-decoration: none; }
.loan-tabbar .loan-form-download:hover, .loan-tabbar .loan-form-download:focus-visible { background: var(--color-hero-start, var(--color-primary-hover)); border-color: var(--color-hero-start, var(--color-primary-hover)); color: var(--color-sidebar-text, #fff); }
.loan-tabbar .loan-form-download i { font-size: .82rem; }
.loan-tab-edit-toolbar { display: flex; min-height: 34px; justify-content: flex-end; align-items: center; margin-bottom: 10px; }
.loan-tab-edit-toolbar .application-edit-button { display: inline-grid; width: 34px; height: 34px; min-height: 34px; padding: 0; border-radius: 9px; place-items: center; font-size: .8rem; }
.application-queue-actions { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.application-queue-edit { width: 32px; height: 32px; display: inline-grid; place-items: center; padding: 0; }
.application-review-confirm { display: flex; align-items: flex-start; gap: 8px; margin-top: 13px; padding: 10px 11px; border-radius: 9px; background: var(--color-warning-bg); color: var(--color-ink); font-size: .74rem; font-weight: 700; }
.application-review-confirm input { margin-top: 2px; }

.application-edit-shell { display: grid; gap: 14px; }
.application-edit-header { padding: 16px 18px; border-radius: 16px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.application-edit-header h1 { margin: 2px 0 1px; font-size: 1.35rem; font-weight: 800; }
.application-edit-header p { margin: 0; color: var(--color-muted); font-size: .82rem; }
.application-edit-nav { position: sticky; top: 70px; z-index: 1005; display: flex; gap: 7px; padding: 9px 12px; border-radius: 13px; overflow-x: auto; }
.application-edit-nav a { padding: 8px 13px; border: 1px solid var(--color-line); border-radius: 9px; color: var(--color-ink); background: var(--color-surface); font-size: .82rem; font-weight: 700; white-space: nowrap; }
.application-edit-nav a:hover { border-color: var(--color-primary); color: var(--color-primary); }
.application-edit-card { padding: 18px; border-radius: 16px; scroll-margin-top: 130px; }
.application-edit-card > header { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--color-line); }
.application-edit-card > header small { color: var(--color-primary); font-size: .7rem; font-weight: 800; letter-spacing: .06em; }
.application-edit-card > header h2 { margin: 1px 0; font-size: 1.05rem; font-weight: 800; }
.application-edit-card > header p { margin: 0; color: var(--color-muted); font-size: .78rem; }
.application-edit-fieldset { padding: 16px 0; border-bottom: 1px solid var(--color-line); }
.application-edit-fieldset:last-child { padding-bottom: 0; border-bottom: 0; }
.application-edit-fieldset h3 { margin: 0 0 12px; font-size: .88rem; font-weight: 800; color: var(--color-ink); }
.application-edit-actions { display: flex; justify-content: flex-end; align-items: center; gap: 9px; padding: 14px 18px; border-radius: 14px; }
.application-edit-actions--top { padding: 0; box-shadow: none; border: 0; flex: 0 0 auto; }
.application-edit-repeat-list { display: grid; gap: 14px; }
.application-edit-repeat-row { min-width: 0; margin: 0; padding: 16px; border: 1px solid var(--color-line); border-radius: 13px; background: var(--color-surface-alt); }
.application-edit-repeat-row legend { float: none; width: auto; margin: 0 0 14px; padding: 0; color: var(--color-ink); font-size: .86rem; font-weight: 800; }
.application-edit-repeat-row legend span { margin-left: 7px; color: var(--color-muted); font-size: .68rem; font-weight: 700; }
.application-edit-saved-file { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; padding: 9px 11px; border: 1px solid var(--color-line); border-radius: 10px; background: var(--color-surface); }
.application-edit-saved-file > span { display: flex; min-width: 0; align-items: center; gap: 8px; color: var(--color-success); }
.application-edit-saved-file strong { overflow: hidden; color: var(--color-ink); font-size: .74rem; text-overflow: ellipsis; white-space: nowrap; }
.application-edit-subheading { margin: 18px 0 10px; color: var(--color-ink); font-size: .86rem; font-weight: 800; }
.application-edit-document-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.application-edit-document-row { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 12px; border: 1px solid var(--color-line); border-radius: 11px; background: var(--color-surface-alt); }
.application-edit-document-row > div { display: grid; min-width: 0; }
.application-edit-document-row strong { overflow: hidden; color: var(--color-ink); font-size: .77rem; text-overflow: ellipsis; white-space: nowrap; }
.application-edit-document-row small { overflow: hidden; color: var(--color-muted); font-size: .66rem; text-overflow: ellipsis; white-space: nowrap; }
.application-edit-capture-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.application-edit-capture-card { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 15px; padding: 14px; border: 1px solid var(--color-line); border-radius: 13px; background: var(--color-surface-alt); }
.application-edit-capture-card > div:last-child { min-width: 0; }
.application-edit-capture-card small { color: var(--color-primary); font-size: .65rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.application-edit-capture-card h3 { margin: 2px 0 12px; color: var(--color-ink); font-size: .9rem; font-weight: 800; }
.application-edit-capture-preview { display: grid; min-height: 145px; place-items: center; overflow: hidden; border-radius: 10px; background: color-mix(in srgb, var(--color-primary) 8%, var(--color-surface)); }
.application-edit-capture-preview img { width: 100%; height: 100%; object-fit: cover; }
.application-edit-capture-preview span { display: grid; place-items: center; gap: 6px; color: var(--color-muted); font-size: .7rem; font-weight: 700; }
.application-edit-capture-preview i { font-size: 1.4rem; }

@media (max-width: 767.98px) {
  .application-edit-header { align-items: flex-start; flex-direction: column; }
  .application-edit-actions--top { width: 100%; }
  .application-edit-actions--top .btn { flex: 1; }
  .application-edit-nav { top: var(--portal-topbar-height); }
  .application-edit-document-grid,
  .application-edit-capture-grid { grid-template-columns: 1fr; }
}
@media (max-width: 575px) {
  .application-edit-card { padding: 14px; }
  .application-edit-capture-card { grid-template-columns: 1fr; }
  .application-edit-capture-preview { min-height: 210px; }
  .application-edit-saved-file { align-items: flex-start; flex-direction: column; }
}

.loan-remarks-panel {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--color-line);
  border-radius: 14px;
  background: var(--color-surface);
}

.loan-remarks-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.loan-remarks-icon {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: var(--color-primary);
  background: var(--color-accent-soft);
  font-size: 1.1rem;
}

.loan-remarks-eyebrow {
  display: block;
  margin-bottom: 2px;
  color: var(--color-muted);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.loan-remarks-header h2 {
  margin: 0;
  color: var(--color-ink);
  font-size: 1rem;
  font-weight: 800;
}

.loan-remark-form {
  padding: 14px;
  border: 1px solid var(--color-line);
  border-radius: 12px;
  background: var(--color-surface-alt);
}

.loan-remark-form textarea {
  min-height: 92px;
  resize: vertical;
  background: var(--color-surface);
}

.loan-remark-form--readonly textarea {
  resize: none;
  color: var(--color-ink);
  background: var(--color-surface);
  opacity: 1;
}

.loan-remark-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.loan-remark-readonly {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--color-muted);
  background: var(--color-surface);
  font-size: .68rem;
  font-weight: 700;
}

.loan-remark-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 10px; }
.loan-remark-actions { display: flex; justify-content: flex-end; flex: 0 0 auto; margin-left: auto; }

.loan-remark-audit {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 9px 0 0;
  color: var(--color-muted);
  font-size: .7rem;
  line-height: 1.35;
}

.loan-remark-audit i { color: var(--color-primary); }
.loan-remark-audit strong { color: var(--color-ink); }

@media (max-width: 575.98px) {
  .loan-remark-footer { align-items: stretch; flex-direction: column; }
  .loan-remark-actions { margin-left: 0; }
  .loan-remark-actions .btn {
    width: 100%;
  }
}
.customer-tab-list { display: flex; gap: 6px; min-width: 0; overflow-x: auto; scrollbar-width: thin; }
.customer-common-edit { display: inline-grid; place-items: center; justify-self: end; width: 34px; height: 34px; margin: 0; border: 1px solid color-mix(in srgb, var(--color-warning) 34%, var(--color-line)); border-radius: 9px; background: var(--color-warning-bg); color: var(--color-warning); font-size: .86rem; }
.customer-common-edit:hover { border-color: var(--color-warning); background: color-mix(in srgb, var(--color-warning-bg) 78%, var(--color-warning)); color: var(--color-warning); }
.customer-common-edit:focus-visible { outline: 3px solid color-mix(in srgb, var(--color-warning) 24%, transparent); outline-offset: 2px; }
.customer-common-edit[hidden] { display: inline-grid !important; visibility: hidden; pointer-events: none; }
.kyc-document-toggle {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  flex: none;
  margin-left: auto;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--color-primary) 42%, var(--color-line));
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-primary);
  font-size: .82rem;
}
.kyc-document-toggle:hover:not(:disabled), .kyc-document-toggle[aria-expanded="true"] { border-color: var(--color-primary); background: var(--color-accent-soft); }
.kyc-document-toggle:focus-visible { outline: 3px solid color-mix(in srgb, var(--color-primary) 24%, transparent); outline-offset: 2px; }
.kyc-document-toggle:disabled { border-color: var(--color-line); background: var(--color-surface-alt); color: var(--color-muted); cursor: not-allowed; opacity: .56; }
.kyc-sync-form { display: inline-flex; margin-left: auto; }
.kyc-document-toggle + .kyc-sync-form { margin-left: 0; }
.kyc-sync-form + .kyc-status { margin-left: 0; }
.api-sync-button {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  flex: none;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--color-primary) 42%, var(--color-line));
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-primary);
  font-size: .88rem;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}
.api-sync-button:not(:disabled):hover { border-color: var(--color-primary); background: var(--color-accent-soft); transform: rotate(-18deg); }
.api-sync-button:focus-visible { outline: 3px solid color-mix(in srgb, var(--color-primary) 24%, transparent); outline-offset: 2px; }
.api-sync-button:disabled { border-color: var(--color-line); background: var(--color-surface-alt); color: var(--color-muted); cursor: not-allowed; opacity: .56; }
.kyc-document-drawer { border-bottom: 1px solid var(--color-line); }
.kyc-document-list { display: grid; gap: 7px; padding: 10px 0; }
.kyc-document-item { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid var(--color-line); border-radius: 9px; background: var(--color-surface-alt); }
.kyc-document-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; background: var(--color-surface); color: var(--color-primary); }
.kyc-document-copy { display: grid; min-width: 0; gap: 2px; }
.kyc-document-copy strong { overflow: hidden; color: var(--color-ink); font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.kyc-document-copy small { color: var(--color-muted); font-size: .6rem; }
.kyc-document-actions { display: flex; align-items: center; gap: 6px; }
.kyc-document-actions a { display: inline-flex; align-items: center; gap: 4px; padding: 5px 7px; border: 1px solid var(--color-line); border-radius: 7px; background: var(--color-surface); color: var(--color-primary); font-size: .62rem; font-weight: 800; white-space: nowrap; }
.kyc-document-actions a:hover { border-color: var(--color-primary); background: var(--color-accent-soft); }
.identity-document-modal .modal-dialog { width: min(980px, calc(100% - 32px)); max-width: 980px; }
.identity-document-modal .modal-content { overflow: hidden; border: 0; border-radius: 16px; box-shadow: 0 24px 70px rgba(15, 23, 42, .25); }
.identity-document-modal .modal-header { align-items: center; padding: 12px 16px; }
.identity-document-modal .modal-header small { display: block; color: var(--color-primary); font-size: .62rem; font-weight: 850; letter-spacing: .065em; text-transform: uppercase; }
.identity-document-modal .modal-title { margin-top: 1px; font-size: 1.05rem; font-weight: 850; }
.identity-document-modal .modal-body { padding: 14px; background: var(--color-surface-alt); }
.identity-document-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.identity-document-panel { min-width: 0; overflow: hidden; border: 1px solid var(--color-line); border-radius: 12px; background: var(--color-surface); }
.identity-document-panel > header { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--color-line); }
.identity-document-panel > header > div { display: grid; min-width: 0; gap: 2px; }
.identity-document-panel > header span { color: var(--color-ink); font-size: .8rem; font-weight: 850; }
.identity-document-panel > header small { overflow: hidden; color: var(--color-muted); font-size: .61rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.identity-document-panel nav { display: flex; flex: none; gap: 6px; }
.identity-document-panel nav a { display: inline-flex; align-items: center; gap: 5px; padding: 6px 8px; border: 1px solid var(--color-line); border-radius: 8px; background: var(--color-surface); color: var(--color-primary); font-size: .65rem; font-weight: 800; white-space: nowrap; }
.identity-document-panel nav a:hover { border-color: var(--color-primary); background: var(--color-accent-soft); }
.identity-document-image { display: grid; height: clamp(260px, 36vh, 360px); padding: 10px; place-items: center; background: #eef2f7; cursor: zoom-in; }
.identity-document-image img { display: block; width: 100%; height: 100%; border-radius: 8px; object-fit: contain; }
.consent-audit-shell { display: grid; gap: 16px; }
.consent-panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.consent-panel-heading small { color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .08em; font-size: 10px; font-weight: 800; }
.consent-panel-heading h2 { margin: 2px 0 0; }
.consent-status,.consent-event-status { display: inline-flex; border-radius: 999px; padding: 5px 10px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.consent-summary-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.consent-status--pending,.consent-event-status--pending { color: #805400; background: #fff2cf; }
.consent-status--accepted,.consent-event-status--success { color: #087443; background: #dff7eb; }
.consent-status--rejected,.consent-status--failed,.consent-event-status--failed { color: #b42318; background: #fee4e2; }
.consent-status--expired,.consent-status--not_generated { color: #475467; background: #edf0f5; }
.consent-summary-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); border: 1px solid var(--color-border); border-radius: 12px; overflow: hidden; }
.consent-summary-grid>div { min-width: 0; padding: 12px 14px; background: var(--color-surface-muted); border-right: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); }
.consent-summary-grid small,.consent-document-meta small { display: block; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .06em; font-size: 9px; font-weight: 800; }
.consent-summary-grid strong { display: block; margin-top: 3px; overflow-wrap: anywhere; }
.consent-summary-grid .consent-status { margin-top: 5px; }
.consent-response-ip { display: block; margin-top: 2px; color: var(--color-text-muted); font-family: ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace; font-size: 11px; }
.consent-link-card { display: grid; grid-template-columns: minmax(150px,.28fr) minmax(0,1fr); align-items: center; gap: 12px; margin-top: 12px; padding: 9px 11px; border: 1px solid #bed2ef; border-radius: 10px; background: #f3f7fd; }
.consent-link-card label { display: block; margin: 0; font-size: 12px; font-weight: 800; }
.consent-link-title .form-text { margin: 1px 0 0; font-size: 10px; line-height: 1.25; }
.consent-link-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.consent-link-row input { min-width: 0; }
.consent-link-row .btn { flex: none; white-space: nowrap; }

/* Consent status summary (Audit Trails) */
.cs-panel { padding: 18px; }
.cs-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.cs-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cs-title-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--color-accent-soft); color: var(--color-primary); font-size: 1.15rem; }
.cs-title small { display: block; color: var(--color-muted); text-transform: uppercase; letter-spacing: .08em; font-size: .68rem; font-weight: 700; }
.admin-portal .main-content .cs-panel .cs-title h2, .cs-panel .cs-title h2 { margin: 1px 0 0; font-size: 1.05rem; font-weight: 800; }
.cs-steps { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 0 0 16px; padding: 14px 6px 12px; border: 1px solid var(--color-line); border-radius: 14px; background: var(--color-surface-alt); }
.cs-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 0 6px; text-align: center; min-width: 0; }
.cs-step:not(:first-child)::before { content: ""; position: absolute; top: 15px; right: calc(50% + 19px); left: calc(-50% + 19px); height: 2px; border-radius: 2px; background: var(--color-line); }
.cs-step.is-done:not(:first-child)::before, .cs-step.is-rejected:not(:first-child)::before { background: var(--color-primary); }
.cs-step-dot { position: relative; z-index: 1; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--color-line); background: var(--color-surface); color: var(--color-muted); font-size: .9rem; }
.cs-step.is-done .cs-step-dot { border-color: var(--color-primary); background: var(--color-primary); color: var(--color-primary-text); }
.cs-step.is-rejected .cs-step-dot { border-color: var(--color-danger); background: var(--color-danger); color: #fff; }
.cs-step-text strong { display: block; font-size: .76rem; font-weight: 800; color: var(--color-ink); }
.cs-step:not(.is-done):not(.is-rejected) .cs-step-text strong { color: var(--color-muted); }
.cs-step-text small { display: block; margin-top: 1px; font-size: .68rem; color: var(--color-muted); }
.cs-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.cs-groups--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cs-group { min-width: 0; padding: 14px 16px 6px; border: 1px solid var(--color-line); border-radius: 14px; background: var(--color-surface); }
.admin-portal .main-content .cs-panel .cs-group h3, .cs-panel .cs-group h3 { display: flex; align-items: center; gap: 7px; margin: 0 0 8px; padding-bottom: 9px; border-bottom: 1px solid var(--color-line); font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--color-ink); }
.cs-panel .cs-group h3 i { color: var(--color-primary); font-size: .95rem; }
.cs-group dl { margin: 0; }
.cs-group dl > div { display: grid; gap: 2px; padding: 8px 0; border-bottom: 1px dashed var(--color-line); }
.cs-group dl > div:last-child { border-bottom: 0; }
.cs-group dt { font-size: .68rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--color-muted); }
.cs-group dd { margin: 0; min-width: 0; font-size: .86rem; font-weight: 700; color: var(--color-ink); overflow-wrap: anywhere; }
.cs-group dd .consent-status { margin: 0; }
.cs-empty { font-weight: 600; color: var(--color-muted); font-style: italic; }
.cs-chip { display: inline-block; padding: 1px 8px; border: 1px solid var(--color-line); border-radius: 999px; background: var(--color-surface-alt); font-size: .7rem; font-weight: 700; color: var(--color-muted); vertical-align: 1px; }
.cs-chip--mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--color-ink); }
.cs-verified { display: inline-flex; align-items: center; gap: 4px; color: var(--color-success); }
.cs-sub { display: block; margin-top: 2px; font-size: .7rem; font-weight: 600; color: var(--color-muted); }
.cs-panel .consent-link-card { border-radius: 14px; }
@media (max-width: 1100px) { .cs-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .cs-header { flex-wrap: wrap; }
  .cs-groups { grid-template-columns: 1fr; }
  .cs-steps { grid-template-columns: 1fr; gap: 10px; padding: 12px 14px; }
  .cs-step { flex-direction: row; text-align: left; }
  .cs-step:not(:first-child)::before { display: none; }
}
.consent-document-panel iframe { width: 100%; height: 620px; border: 1px solid var(--color-border); border-radius: 12px; background: #f7f9fc; }
.consent-document-actions { display: flex; gap: 7px; }
.consent-document-meta { display: grid; grid-template-columns: 1fr .5fr 2fr; gap: 10px; margin-bottom: 12px; }
.consent-document-meta span { padding: 10px 12px; border-radius: 9px; background: var(--color-surface-muted); overflow-wrap: anywhere; }
.consent-hash { font-family: ui-monospace,SFMono-Regular,Menlo,monospace; font-size: 11px; }
.consent-timeline { position: relative; display: grid; gap: 0; padding-left: 8px; }
.consent-timeline:before { content: ''; position: absolute; left: 17px; top: 12px; bottom: 12px; width: 2px; background: var(--color-border); }
.consent-timeline article { position: relative; display: grid; grid-template-columns: 20px 1fr; gap: 12px; padding: 0 0 18px; }
.consent-timeline article:last-child { padding-bottom: 0; }
.consent-timeline-dot { position: relative; z-index: 1; width: 12px; height: 12px; margin-top: 5px; border: 3px solid #fff; border-radius: 50%; background: #d7a33c; box-shadow: 0 0 0 2px #d7a33c; }
.consent-timeline-dot--success { background: #15945b; box-shadow: 0 0 0 2px #15945b; }
.consent-timeline-dot--failed { background: #d92d20; box-shadow: 0 0 0 2px #d92d20; }
.consent-timeline p { margin: 2px 0; color: var(--color-text-muted); }
.consent-timeline small { color: var(--color-text-muted); }
.consent-audit-table { min-width: 1050px; }
.consent-audit-table code { color: inherit; white-space: nowrap; }
.consent-audit-meta { margin-top: 6px; color: var(--color-text-muted); font-size: 11px; }
.consent-audit-meta summary { cursor: pointer; color: var(--color-primary); font-weight: 750; }
.consent-audit-meta dl { display: grid; gap: 5px; margin: 7px 0 0; }
.consent-audit-meta dl>div { display: grid; grid-template-columns: minmax(110px,.55fr) minmax(150px,1fr); gap: 8px; }
.consent-audit-meta dt { font-weight: 750; }
.consent-audit-meta dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 900px) { .consent-summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .consent-link-card { grid-template-columns: 1fr; gap: 7px; } .consent-link-row { flex-wrap: wrap; } .consent-link-row input { flex-basis: 100%; } .consent-document-meta { grid-template-columns: 1fr 1fr; } .consent-hash { grid-column: 1/-1; } }

/* Global document viewer -------------------------------------------------- */
.global-document-viewer[hidden] { display: none; }
.global-document-viewer { position: fixed; z-index: 2000; inset: 0; display: grid; padding: clamp(10px, 2.5vw, 28px); place-items: center; }
.global-document-viewer-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .72); backdrop-filter: blur(3px); }
.global-document-viewer-dialog { position: relative; display: grid; grid-template-rows: auto auto minmax(0, 1fr); width: min(95vw, 1500px); height: min(94vh, 980px); overflow: hidden; border: 1px solid rgba(255,255,255,.2); border-radius: 12px; background: var(--color-surface, #fff); box-shadow: 0 32px 90px rgba(2, 8, 23, .4); outline: 0; }
.global-document-viewer.is-generated-document .global-document-viewer-dialog { width: min(92vw, 760px); height: min(94vh, 1040px); border-radius: 6px; }
.global-document-viewer.is-pdf-document .global-document-viewer-dialog { width: min(88vw, 760px); height: min(90vh, 850px); border-radius: 4px; }
.global-document-viewer.is-image-document .global-document-viewer-dialog {
  width: min(92vw, max(420px, calc(var(--document-image-width, 560px) + 36px)));
  height: min(90vh, calc(var(--document-image-height, 420px) + 104px));
  border-radius: 6px;
}
.global-document-viewer.is-image-document .global-document-viewer-toolbar { display: none; }
.global-document-viewer-header { display: flex; min-height: 68px; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 16px 11px 20px; border-bottom: 1px solid var(--color-line, #dce3ed); }
.global-document-viewer-heading { min-width: 0; }
.global-document-viewer-heading h2 { overflow: hidden; margin: 1px 0 0; font-size: clamp(1rem, 2vw, 1.2rem); font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
.global-document-viewer-type { display: block; color: var(--color-primary, #174f9b); font-size: .64rem; font-weight: 850; letter-spacing: .075em; text-transform: uppercase; }
.global-document-viewer-actions { display: flex; flex: none; align-items: center; gap: 9px; }
.global-document-viewer-actions .btn { display: inline-flex; align-items: center; gap: 6px; }
.global-document-viewer-close { display: inline-grid; width: 36px; height: 36px; border: 0; border-radius: 10px; background: var(--color-surface-alt, #f4f7fb); color: var(--color-ink, #172033); place-items: center; }
.global-document-viewer-close:hover, .global-document-viewer-close:focus-visible { background: #e8eef7; color: var(--color-primary, #174f9b); }
.global-document-viewer-toolbar { display: flex; min-height: 42px; align-items: center; justify-content: center; gap: 7px; padding: 6px 12px; border-bottom: 1px solid var(--color-line, #dce3ed); background: var(--color-surface-alt, #f7f9fc); }
.global-document-viewer-toolbar button { min-height: 28px; border: 1px solid var(--color-line, #dce3ed); border-radius: 7px; background: #fff; color: var(--color-ink, #172033); font-size: .72rem; font-weight: 750; }
.global-document-viewer-toolbar button:not([data-document-viewer-fit]) { width: 30px; }
.global-document-viewer-toolbar output { width: 45px; color: var(--color-muted, #667085); font-size: .7rem; font-weight: 750; text-align: center; }
.global-document-viewer-toolbar > span { margin-left: 8px; color: var(--color-muted, #667085); font-size: .67rem; }
.global-document-viewer-body { display: grid; grid-template-rows: minmax(0, 1fr); min-height: 0; overflow: hidden; background: #e9eef5; }
.global-document-viewer-status { display: flex; height: 100%; min-height: 260px; align-items: center; justify-content: center; flex-direction: column; gap: 9px; padding: 24px; color: var(--color-muted, #667085); text-align: center; }
.global-document-viewer-status .spinner-border { color: var(--color-primary, #174f9b); }
.global-document-viewer-status strong { color: var(--color-ink, #172033); }
.global-document-viewer-status small { max-width: 460px; }
.global-document-viewer-error > i { color: #b42318; font-size: 2.25rem; }
.global-document-viewer-canvas { display: grid; grid-template-rows: minmax(0, 1fr); width: 100%; min-height: 0; overflow: auto; padding: clamp(8px, 1.5vw, 18px); }
.global-document-viewer-content { width: 100%; min-height: 100%; transform-origin: top center; }
.global-document-viewer-content.is-image { display: grid; place-items: start center; transform: scale(var(--document-viewer-zoom, 1)); }
.global-document-viewer-content.is-image img { display: block; max-width: 100%; height: auto; border-radius: 8px; background: #fff; box-shadow: 0 8px 30px rgba(15,23,42,.13); }
.global-document-viewer-content.is-frame { height: auto; min-height: 0; }
.global-document-viewer-content iframe { display: block; width: 100%; height: 100%; min-height: 0; border: 0; border-radius: 8px; background: #fff; box-shadow: 0 8px 30px rgba(15,23,42,.13); }
.global-document-viewer.is-generated-document .global-document-viewer-canvas { display: block; }
.global-document-viewer.is-generated-document .global-document-viewer-content.is-frame,
.global-document-viewer.is-generated-document .global-document-viewer-content iframe { height: min(calc(94vh - 104px), 936px); min-height: min(calc(94vh - 104px), 936px); }
.global-document-viewer.is-pdf-document .global-document-viewer-canvas { display: block; }
.global-document-viewer.is-pdf-document .global-document-viewer-content.is-frame,
.global-document-viewer.is-pdf-document .global-document-viewer-content iframe { height: min(calc(90vh - 104px), 746px); min-height: min(calc(90vh - 104px), 746px); }
.document-viewer-open { overscroll-behavior: none; }
.global-document-viewer [hidden] { display: none !important; }

@media (max-width: 720px) {
  .global-document-viewer { padding: 0; }
  .global-document-viewer-dialog { width: 100vw; height: 100dvh; border: 0; border-radius: 0; }
  .global-document-viewer.is-generated-document .global-document-viewer-dialog,
  .global-document-viewer.is-pdf-document .global-document-viewer-dialog,
  .global-document-viewer.is-image-document .global-document-viewer-dialog { width: 100vw; height: 100dvh; border: 0; border-radius: 0; }
  .global-document-viewer-header { min-height: 60px; padding: 9px 10px 9px 14px; }
  .global-document-viewer-actions .btn span { display: none; }
  .global-document-viewer-toolbar > span { display: none; }
  .global-document-viewer-canvas { padding: 7px; }
  .global-document-viewer-content iframe { min-height: 0; }
  .global-document-viewer.is-generated-document .global-document-viewer-content.is-frame,
  .global-document-viewer.is-generated-document .global-document-viewer-content iframe,
  .global-document-viewer.is-pdf-document .global-document-viewer-content.is-frame,
  .global-document-viewer.is-pdf-document .global-document-viewer-content iframe { height: calc(100dvh - 74px); min-height: calc(100dvh - 74px); }
}
.application-document-text-button { padding: 0; border: 0; background: transparent; color: var(--color-primary); font: inherit; font-weight: 800; }
.application-document-text-button:hover { text-decoration: underline; }
@media (max-width: 767.98px) {
  .identity-document-grid { grid-template-columns: 1fr; }
  .identity-document-panel > header { align-items: flex-start; flex-direction: column; }
  .identity-document-panel nav { width: 100%; }
  .identity-document-panel nav a { flex: 1; justify-content: center; }
  .identity-document-image { height: clamp(230px, 45vh, 360px); }
}
.supporting-identity-item { display: grid; align-content: start; }
.supporting-identity-documents { display: grid; gap: 7px; margin-top: 7px; }
.supporting-identity-document { display: grid; min-width: 0; gap: 5px; padding-top: 6px; border-top: 1px dashed var(--color-line); }
.supporting-identity-document-name { display: block; overflow: hidden; color: var(--color-muted); font-size: .6rem; font-weight: 700; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.customer-identity-document-list { display: grid; gap: 9px; }
.customer-identity-document-row { display: grid; grid-template-columns: minmax(150px, .55fr) minmax(220px, 1fr) auto; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--color-line); border-radius: 10px; background: var(--color-surface-alt); }
.customer-identity-document-row label { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--color-ink); font-size: .76rem; font-weight: 800; }
.customer-identity-document-row label i { color: var(--color-primary); font-size: 1rem; }
.customer-identity-document-row label > span { display: grid; min-width: 0; gap: 2px; }
.customer-identity-document-row label strong { font-size: .76rem; }
.customer-identity-document-row label small { overflow: hidden; color: var(--color-muted); font-size: .6rem; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.customer-identity-document-row .form-control { min-height: 34px; padding-block: .3rem; background: var(--color-surface); font-size: .72rem; font-weight: 700; }
.customer-identity-document-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.customer-identity-document-view { width: 34px; height: 34px; display: inline-grid; place-items: center; border: 1px solid var(--color-line); border-radius: 8px; background: var(--color-surface); color: var(--color-primary); }
.customer-identity-document-view:hover { border-color: var(--color-primary); background: var(--color-accent-soft); color: var(--color-primary); }
.customer-identity-document-view.is-empty { color: var(--color-muted); opacity: .65; }
.customer-other-document-grid { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--color-line); }
.customer-document-summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--color-line); }
.customer-document-summary-item { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 11px; border: 1px solid var(--color-line); border-radius: 10px; background: var(--color-surface-alt); }
.customer-document-summary-item > span { display: flex; align-items: center; gap: 9px; min-width: 0; }
.customer-document-summary-item > span i { color: var(--color-primary); font-size: 1.05rem; }
.customer-document-summary-item strong { color: var(--color-ink); font-size: .76rem; }
.customer-document-summary-copy { display: grid; min-width: 0; gap: 2px; }
.customer-document-summary-copy small { overflow: hidden; color: var(--color-muted); font-size: .62rem; text-overflow: ellipsis; white-space: nowrap; }
.customer-document-summary-item > a { width: 32px; height: 32px; display: inline-grid; place-items: center; flex: none; border: 1px solid var(--color-line); border-radius: 8px; background: var(--color-surface); color: var(--color-primary); }
.customer-document-summary-item > a:hover { border-color: var(--color-primary); background: var(--color-accent-soft); }
.customer-context-documents-panel { margin-top: 12px; }
.customer-context-documents-panel > h2 { margin-bottom: 10px; }
.customer-context-document-grid { margin-top: 0; padding-top: 0; border-top: 0; }
.customer-itr-documents { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--color-line); }
.customer-itr-documents h3 { margin: 0 0 8px; color: var(--color-ink); font-size: .78rem; font-weight: 850; letter-spacing: .04em; }
.customer-itr-documents > div { overflow: hidden; border: 1px solid var(--color-line); border-radius: 10px; }
.customer-itr-document-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 44px; padding: 8px 11px; background: var(--color-surface-alt); }
.customer-itr-document-row + .customer-itr-document-row { border-top: 1px solid var(--color-line); }
.customer-itr-document-row > span { display: grid; min-width: 0; gap: 2px; }
.customer-itr-document-row strong { font-size: .75rem; }
.customer-itr-document-row small { overflow: hidden; color: var(--color-muted); font-size: .61rem; text-overflow: ellipsis; white-space: nowrap; }
.customer-itr-document-row a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border: 1px solid var(--color-line); border-radius: 8px; background: var(--color-surface); color: var(--color-primary); font-size: .68rem; font-weight: 800; }
.customer-itr-document-row a:hover { border-color: var(--color-primary); background: var(--color-accent-soft); }
.customer-document-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.customer-document-group { min-width: 0; overflow: hidden; border: 1px solid var(--color-line); border-radius: 11px; background: var(--color-surface-alt); }
.customer-document-group > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--color-line); background: var(--color-surface); }
.customer-document-group h3 { margin: 0; color: var(--color-ink); font-size: .8rem; font-weight: 800; }
.customer-document-group > header > span { flex: none; padding: 3px 7px; border-radius: 999px; background: var(--color-accent-soft); color: var(--color-primary); font-size: .61rem; font-weight: 800; }
.customer-document-file-list { display: grid; }
.customer-document-file + .customer-document-file { border-top: 1px solid var(--color-line); }
.customer-document-file { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 9px; min-height: 54px; padding: 9px 11px; }
.customer-document-file > i { color: var(--color-primary); font-size: 1.15rem; }
.customer-document-file > span { display: grid; min-width: 0; gap: 2px; }
.customer-document-file strong { overflow: hidden; color: var(--color-ink); font-size: .72rem; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.customer-document-file small { overflow: hidden; color: var(--color-muted); font-size: .61rem; text-overflow: ellipsis; white-space: nowrap; }
.customer-document-file > a { display: inline-flex; align-items: center; gap: 5px; padding: 6px 8px; border: 1px solid var(--color-line); border-radius: 8px; background: var(--color-surface); color: var(--color-primary); font-size: .65rem; font-weight: 800; }
.customer-document-file > a:hover { border-color: var(--color-primary); background: var(--color-accent-soft); color: var(--color-primary); }
.customer-period-document-list { display: grid; }
.customer-period-document-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 47px; padding: 8px 11px; }
.customer-period-document-row + .customer-period-document-row { border-top: 1px solid var(--color-line); }
.customer-period-document-row strong { color: var(--color-ink); font-size: .74rem; font-weight: 750; }
.customer-period-document-row a { display: inline-flex; align-items: center; gap: 5px; padding: 6px 9px; border: 1px solid var(--color-line); border-radius: 8px; background: var(--color-surface); color: var(--color-primary); font-size: .66rem; font-weight: 800; }
.customer-period-document-row a:hover { border-color: var(--color-primary); background: var(--color-accent-soft); color: var(--color-primary); }
@media (max-width: 767.98px) {
  .customer-identity-document-row { grid-template-columns: minmax(0, 1fr) auto; }
  .customer-identity-document-row .form-control { grid-column: 1 / -1; grid-row: 2; }
  .customer-identity-document-actions { grid-column: 2; grid-row: 1; }
  .customer-document-summary-grid { grid-template-columns: 1fr; }
  .customer-document-groups { grid-template-columns: 1fr; }
}
.customer-tab-history { margin-top: 14px; border: 1px solid var(--color-line); border-radius: 13px; overflow: hidden; background: var(--color-surface); }
.customer-tab-history-toggle { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 15px; border: 0; background: var(--color-surface); color: var(--color-ink); text-align: left; }
.customer-tab-history-toggle:hover { background: var(--color-surface-alt); }
.customer-tab-history-toggle > span { display: flex; align-items: center; gap: 9px; }
.customer-tab-history-toggle > span > i { color: var(--color-primary); }
.customer-tab-history-toggle small { padding: 3px 8px; border-radius: 999px; background: var(--color-surface-alt); color: var(--color-muted); font-size: .68rem; }
.customer-tab-history-toggle > i { transition: transform .2s ease; }
.customer-tab-history-toggle:not(.collapsed) > i { transform: rotate(180deg); }
.customer-tab-history-body { padding: 14px 16px; border-top: 1px solid var(--color-line); background: var(--color-surface-alt); }
.customer-tab-history-empty { display: flex; align-items: center; gap: 9px; color: var(--color-muted); font-size: .8rem; }
.customer-tab-history-list { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.customer-tab-history-list li { display: grid; grid-template-columns: 12px 1fr; gap: 10px; }
.customer-tab-history-dot { width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: var(--color-primary); box-shadow: 0 0 0 4px var(--color-accent-soft); }
.customer-tab-history-list header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.customer-tab-history-list time { color: var(--color-muted); font-size: .7rem; }
.customer-tab-history-actor { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.customer-tab-history-actor span { color: var(--color-muted); font-size: .72rem; }
.customer-tab-history-summary { display: flex; align-items: flex-start; gap: 7px; color: var(--color-ink); font-size: .79rem; line-height: 1.45; }
.customer-tab-history-summary > i { color: var(--color-primary); margin-top: 2px; }
.customer-tab-history-context { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.customer-tab-history-context span { padding: 3px 7px; border-radius: 999px; background: var(--color-accent-soft); color: var(--color-primary); font-size: .68rem; }
.customer-tab-history-list p { display: grid; grid-template-columns: minmax(120px, .75fr) minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 9px; margin: 5px 0; font-size: .75rem; }
.customer-tab-history-list del { color: #9b3a3a; text-decoration: none; overflow-wrap: anywhere; }
.customer-tab-history-list ins { color: #177245; text-decoration: none; overflow-wrap: anywhere; }
.bank-detail-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.bank-detail-tabs { max-width: 100%; display: flex; flex-wrap: wrap; gap: 5px; padding: 4px; border: 1px solid var(--color-line); border-radius: 11px; background: var(--color-surface); }
.bank-detail-tab { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 7px; padding: 7px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--color-muted); font-size: .76rem; font-weight: 800; white-space: nowrap; }
.bank-detail-tab:hover { color: var(--color-primary); background: var(--color-surface-alt); }
.bank-detail-tab.active { color: var(--color-primary-text); background: var(--color-primary); box-shadow: 0 3px 9px color-mix(in srgb, var(--color-primary) 20%, transparent); }
.bank-detail-tab-content .customer-data-panel { min-height: 120px; }
.bank-verification-list { display: grid; gap: 14px; }
.bank-verification-card { overflow: hidden; border: 1px solid var(--color-line); border-radius: 13px; background: var(--color-surface-alt); }
.bank-verification-card > header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 15px; border-bottom: 1px solid var(--color-line); background: var(--color-surface); }
.bank-verification-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.bank-verification-icon { width: 35px; height: 35px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 9px; background: var(--color-accent-soft); color: var(--color-primary); }
.bank-verification-title strong, .bank-verification-title small { display: block; }
.bank-verification-title strong { color: var(--color-ink); font-size: .82rem; }
.bank-verification-title small { margin-top: 2px; color: var(--color-muted); font-size: .66rem; }
.bank-verification-actions { display: flex; align-items: center; gap: 8px; }
.bank-verification-detail-grid { display: grid; gap: 12px; padding: 13px; }
.bank-verification-detail-grid > section { min-width: 0; padding: 12px; border: 1px solid var(--color-line); border-radius: 10px; background: var(--color-surface); }
.bank-verification-detail-grid h3 { margin: 0 0 9px; color: var(--color-ink); font-size: .73rem; font-weight: 850; }
.bank-api-result-table { width: 100%; min-width: 0; margin: 0; table-layout: fixed; }
.bank-api-result-table th { white-space: normal; }
.bank-api-result-table td { min-width: 0; overflow-wrap: anywhere; }
.bank-verification-summary { margin-top: 12px; }
.bank-primary-check { display: inline-grid; min-width: 28px; min-height: 28px; place-items: center; color: #111827; font-size: 1.25rem; line-height: 1; }
.bank-account-summary .table-responsive, .bank-verification-summary .table-responsive { overflow-x: visible; }
.bank-account-table { width: 100%; min-width: 0; table-layout: fixed; }
.bank-account-table th, .bank-account-table td, .bank-verification-summary .bank-api-result-table th, .bank-verification-summary .bank-api-result-table td { padding-right: .45rem; padding-left: .45rem; font-size: .68rem; }
.bank-serial-column { width: 46px; text-align: center; white-space: nowrap !important; }
.bank-account-table th:last-child, .bank-account-table td:last-child { width: 70px; }
.bank-verification-summary .bank-api-result-table th:last-child, .bank-verification-summary .bank-api-result-table td:last-child { width: 44px; text-align: center; }
.bank-verification-summary .bank-api-result-table th, .bank-verification-summary .bank-api-result-table td { padding-right: .28rem; padding-left: .28rem; line-height: 1.18; }
.bank-verification-summary .bank-api-result-table th { overflow-wrap: anywhere; font-size: .6rem; }
.bank-verification-summary .bank-api-result-table th:nth-child(2) { width: 16%; }
.bank-verification-summary .bank-api-result-table th:nth-child(3) { width: 14%; }
.bank-verification-summary .bank-api-result-table th:nth-child(4) { width: 6%; }
.bank-verification-summary .bank-api-result-table th:nth-child(5) { width: 8%; }
.bank-verification-summary .bank-api-result-table th:nth-child(6) { width: 12%; }
.bank-verification-summary .bank-api-result-table th:nth-child(7) { width: 7%; }
.bank-verification-summary .bank-api-result-table th:nth-child(8) { width: 9%; }
.bank-verification-summary .bank-api-result-table th:nth-child(9) { width: 16%; }
.bank-verification-account { min-width: 0; }
.bank-verification-name { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; }
.bank-verification-result-icon { display: inline-grid; flex: 0 0 auto; place-items: center; font-size: .9rem; line-height: 1; }
.bank-verification-result-icon.is-verified { color: var(--color-success); }
.bank-verification-result-icon.is-failed { color: var(--color-danger); }
.bank-verification-result-icon.is-pending { color: var(--color-warning); }
.bank-verification-error { display: flex; align-items: flex-start; gap: 6px; margin: 9px 0 0; color: var(--color-danger); font-size: .68rem; }
.bank-account-number-status { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.bank-account-verification-icon { display: inline-grid; place-items: center; font-size: .9rem; line-height: 1; }
.bank-account-verification-icon.is-verified { color: var(--color-success); }
.bank-account-verification-icon.is-not-verified { color: var(--color-danger); }
.bank-account-verification-icon.is-error { color: var(--color-warning); }
.customer-edit-shell { display: grid; gap: 12px; }
.customer-edit-header { display: flex; align-items: center; justify-content: space-between; padding: 15px 17px; border-radius: 15px; }
.customer-edit-header h1 { margin: 0; font-size: 1.25rem; font-weight: 850; }
.customer-edit-header p { margin: 2px 0 0; color: var(--color-muted); font-size: .78rem; }
.customer-edit-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 8px; border: 1px solid var(--color-line); border-radius: 12px; background: var(--color-surface); }
.customer-edit-tabs a { padding: 7px 11px; border: 1px solid var(--color-line); border-radius: 8px; color: var(--color-ink); font-size: .75rem; font-weight: 750; white-space: nowrap; }
.customer-edit-tabs a.active { border-color: var(--color-primary); background: var(--color-primary); color: var(--color-primary-text); }
.customer-edit-form { padding: 18px; border-radius: 15px; }
.customer-edit-row { margin: 0 0 15px; padding: 15px; border: 1px solid var(--color-line); border-radius: 12px; }
.customer-edit-row legend { float: none; width: auto; margin: 0 0 10px; padding: 0 6px; font-size: .85rem; font-weight: 800; }
.customer-edit-row-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.customer-edit-row-heading legend { margin-bottom: 10px; }
.customer-edit-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--color-line); }

@media (max-width: 767.98px) {
  .bank-detail-toolbar { align-items: stretch; flex-direction: column; }
  .bank-detail-tabs { flex-wrap: nowrap; overflow-x: auto; }
  .bank-detail-tab { justify-content: center; text-align: center; }
  .bank-detail-toolbar > .btn { align-self: flex-end; }
  .bank-verification-card > header { align-items: flex-start; }
  .customer-location-layout { grid-template-columns: 1fr; }
  .customer-location-heading { align-items: flex-start; flex-wrap: wrap; }
  .customer-location-proofs { flex-basis: 100%; margin-left: 40px; }
  .customer-location-proof-set { justify-content: flex-start; flex-wrap: wrap; }
  .customer-location-choices { border-right: 0; border-bottom: 1px solid var(--color-line); }
  .customer-location-map iframe,
  .customer-location-map-empty { min-height: 320px; }
  .customer-tab-history-list p { grid-template-columns: 1fr; gap: 3px; }
  .customer-tab-history-list p > i { transform: rotate(90deg); }
}

.btn {
  border-radius: var(--ui-radius-sm);
  font-weight: 700;
  box-shadow: 0 1px 2px color-mix(in srgb, var(--color-ink) 8%, transparent);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px color-mix(in srgb, var(--color-ink) 11%, transparent); }
.btn:active { transform: translateY(0); }
.btn:focus-visible,
.bottom-nav-item:focus-visible,
.sidebar-action:focus-visible { outline: 3px solid color-mix(in srgb, var(--color-primary) 28%, transparent); outline-offset: 2px; }

.form-control,
.form-select,
.bounded-select-trigger {
  background: color-mix(in srgb, var(--color-surface) 97%, var(--color-canvas));
  box-shadow: inset 0 1px 1px color-mix(in srgb, var(--color-ink) 3%, transparent);
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.form-control:hover,
.form-select:hover,
.bounded-select-trigger:hover { border-color: color-mix(in srgb, var(--color-primary) 38%, var(--color-line)); }
.form-label { margin-bottom: 7px; color: color-mix(in srgb, var(--color-ink) 92%, var(--color-muted)); font-size: .82rem; letter-spacing: .005em; }
.currency-input .currency-input-symbol {
  min-width: 2.6rem;
  justify-content: center;
  background: var(--color-surface-alt);
  border-color: var(--color-line);
  color: var(--color-muted);
  font-weight: 700;
}
.currency-input .form-control,
.mobile-pair .currency-input .form-control { padding-left: .75rem; }
.input-group-text { border-color: var(--color-line); }

.table-responsive { border-radius: inherit; }
.table { margin-bottom: 0; }
.table thead th {
  padding: 12px 14px;
  background: var(--color-surface-alt);
  color: var(--color-muted);
  border-bottom: 1px solid var(--color-line);
  font-size: .69rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.table tbody td { padding: 14px; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { --bs-table-bg: color-mix(in srgb, var(--color-accent-soft) 42%, var(--color-surface)); }
.badge { padding: .43rem .62rem; border-radius: 999px; font-size: .65rem; font-weight: 800; letter-spacing: .025em; }
.alert { border-width: 0 0 0 4px; border-style: solid; border-left-color: currentColor; border-radius: 12px; box-shadow: var(--ui-shadow-sm); }

.loan-head {
  background: linear-gradient(135deg, var(--color-sidebar), color-mix(in srgb, var(--color-sidebar) 72%, var(--color-primary)));
  border: 1px solid color-mix(in srgb, var(--color-inverse) 10%, transparent);
  box-shadow: 0 15px 34px color-mix(in srgb, var(--color-sidebar) 20%, transparent);
}
.loan-head-title-row { display: flex; align-items: center; gap: 8px; min-height: 28px; }
.loan-head-back {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border: 1px solid color-mix(in srgb, var(--color-inverse) 45%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--color-inverse) 10%, transparent);
  color: var(--color-inverse);
  line-height: 1;
}
.loan-head-back:hover,
.loan-head-back:focus-visible { background: var(--color-inverse); color: var(--color-sidebar); }
.loan-head-back:focus-visible { outline: 3px solid color-mix(in srgb, var(--color-inverse) 35%, transparent); outline-offset: 2px; }
.loan-application-date { min-width: 112px; color: var(--color-inverse); }
.loan-application-date strong { font-size: .9rem; letter-spacing: .02em; }
.identity-upload-card { padding: 16px; border: 1px solid var(--color-line); border-radius: 14px; background: var(--color-surface-alt); }
.upload-password-fields { min-width: 0; padding: .7rem .8rem; border: 1px solid var(--color-line); border-radius: 10px; background: var(--color-surface); }
.upload-password-fields legend { float: none; width: auto; margin: 0 0 .35rem; padding: 0; color: var(--color-secondary); font-size: .8rem; font-weight: 700; }
.upload-password-fields .form-check-label { width: auto; height: auto; display: inline; border: 0; background: transparent; color: inherit; font-size: .86rem; }
.upload-password-popover { position: absolute; z-index: 20; right: 0; top: calc(100% + 8px); width: min(290px, 82vw); box-shadow: 0 12px 30px rgba(25, 35, 45, .18); text-align: left; }
.document-row-upload-form, .financial-upload-icon-actions form { position: relative; }
.upload-password-fields .password-visibility-toggle { width: 42px; height: auto; border: 0; border-left: 1px solid var(--color-line); border-radius: 0 .375rem .375rem 0; }
.upload-password-fields [data-upload-password-submit] { width: auto; height: auto; display: inline-flex; padding: .35rem .65rem; }
.identity-upload-details { padding-top: 2px; }
.identity-number-col,
.identity-file-col { min-width: 0; }
.agent-portal input[type="file"].form-control {
  min-height: 52px;
  padding: 0;
  overflow: hidden;
  background: var(--color-surface);
  color: var(--color-muted);
  cursor: pointer;
}
.agent-portal input[type="file"].form-control::file-selector-button,
.agent-portal input[type="file"].form-control::-webkit-file-upload-button {
  min-height: 50px;
  margin: 0 .75rem 0 0;
  padding: 0 1rem;
  border: 0;
  border-right: 1px solid color-mix(in srgb, var(--color-primary) 72%, var(--color-line));
  background: linear-gradient(135deg, var(--color-primary), color-mix(in srgb, var(--color-primary) 78%, var(--color-sidebar)));
  color: var(--color-primary-text);
  font-weight: 800;
  cursor: pointer;
}
.agent-portal input[type="file"].form-control:hover::file-selector-button,
.agent-portal input[type="file"].form-control:hover::-webkit-file-upload-button { filter: brightness(.96); }
.date-input-shell { position: relative; }
.date-input-control { cursor: text; padding-right: 3rem; }
.date-calendar-button { position: absolute; z-index: 2; top: 0; right: 0; display: grid; place-items: center; width: 3rem; height: 100%; margin: 0; padding: 0; border: 0; border-radius: 0 11px 11px 0; background: transparent; color: var(--color-ink); cursor: pointer; }
.date-calendar-button:hover { color: var(--color-primary); background: var(--color-accent-soft); }
.date-calendar-button:focus-visible { outline: 2px solid var(--color-primary); outline-offset: -3px; }
.date-calendar-popover { position: fixed; z-index: 2000; padding: 12px; border: 1px solid var(--color-line); border-radius: 14px; background: var(--color-surface); color: var(--color-ink); box-shadow: 0 18px 42px color-mix(in srgb, var(--color-ink) 22%, transparent); }
.date-calendar-header { display: grid; grid-template-columns: 34px minmax(0, 1fr) 82px 34px; gap: 6px; align-items: center; margin-bottom: 10px; }
.date-calendar-nav { width: 34px; height: 34px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--color-ink); }
.date-calendar-nav:hover:not(:disabled) { background: var(--color-accent-soft); color: var(--color-primary); }
.date-calendar-nav:disabled { color: var(--color-muted); opacity: .45; }
.date-calendar-period { width: 100%; min-width: 0; height: 34px; padding: 4px 7px; border: 1px solid var(--color-line); border-radius: 8px; background: var(--color-surface); color: var(--color-ink); font-size: .82rem; font-weight: 700; }
.date-calendar-weekdays,
.date-calendar-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.date-calendar-weekdays { margin-bottom: 4px; color: var(--color-muted); font-size: .68rem; font-weight: 800; text-align: center; text-transform: uppercase; }
.date-calendar-weekdays span { padding: 5px 0; }
.date-calendar-spacer,
.date-calendar-day { aspect-ratio: 1; }
.date-calendar-day { display: grid; place-items: center; min-width: 0; padding: 0; border: 0; border-radius: 9px; background: transparent; color: var(--color-ink); font-size: .82rem; font-weight: 650; }
.date-calendar-day:hover:not(:disabled),
.date-calendar-day:focus-visible { outline: 0; background: var(--color-accent-soft); color: var(--color-primary); }
.date-calendar-day.is-today { box-shadow: inset 0 0 0 1px var(--color-primary); }
.date-calendar-day.is-selected { background: var(--color-primary); color: var(--color-primary-text); box-shadow: none; }
.date-calendar-day:disabled { color: var(--color-muted); opacity: .35; }
.date-calendar-footer { display: flex; justify-content: space-between; gap: 8px; margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--color-line); }
.date-calendar-footer button { padding: 5px 7px; border: 0; background: transparent; color: var(--color-primary); font-size: .8rem; font-weight: 750; }
.date-calendar-footer button:hover { text-decoration: underline; }
[hidden] { display: none !important; }
.final-media-grid { display: grid; gap: 1rem; }
.final-media-card { border: 1px solid var(--color-line); border-radius: 1rem; padding: 1rem; background: var(--color-surface); }
.final-media-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.final-media-heading small,
.final-media-heading strong,
.final-media-preview { display: block; }
.final-media-heading small { color: var(--color-muted); }
.final-media-preview { margin-top: .4rem; font-size: .82rem; font-weight: 600; }
.capture-media-grid { display: grid; gap: 1rem; }
.live-media-card { margin-bottom: 0; }
.live-media-photo { width: 100%; max-width: 720px; margin-inline: auto; }
.camera-stage { position: relative; display: grid; place-items: center; min-height: 280px; overflow: hidden; border: 1px solid var(--color-line); border-radius: 14px; background: #101827; }
.camera-stage video,
.camera-stage img { width: 100%; height: 280px; object-fit: cover; }
.camera-placeholder { display: grid; place-items: center; gap: .6rem; color: #d8dfeb; text-align: center; }
.camera-placeholder i { font-size: 3rem; }
[data-capture-error][hidden] { display: none; }
.conditional-split-field > .conditional-choice { transition: width .18s ease; }
.conditional-split-field:not(.is-split) > .conditional-choice { width: 100%; }
.source-choice { box-shadow: var(--ui-shadow-sm); }
.source-choice:hover { box-shadow: var(--ui-shadow-md); }
.customer-result:hover { background: color-mix(in srgb, var(--color-accent-soft) 25%, var(--color-surface)); }
.accordion { --bs-accordion-border-radius: var(--ui-radius-md); --bs-accordion-inner-border-radius: calc(var(--ui-radius-md) - 1px); }
.accordion-item { overflow: hidden; }
.modal-content,
.dropdown-menu,
.bounded-select-menu { box-shadow: var(--ui-shadow-md); }
.bounded-select-group { display: grid; gap: 2px; }
.bounded-select-group + .bounded-select-group { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--color-line); }
.bounded-select-group-label {
  padding: 7px 10px 3px;
  color: var(--color-muted);
  font-size: .6rem;
  font-weight: 850;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.modal-dialog-scrollable .modal-content > form {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}
.modal-dialog-scrollable .modal-content > form > .modal-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.empty-state i { color: var(--color-primary); }
.pagination { gap: 4px; }
.page-link { border-radius: 9px !important; }
.reference-card-actions { display: flex; align-items: center; gap: 8px; }
.reference-card-action { width: 38px; height: 38px; display: inline-grid; place-items: center; padding: 0; }
.reference-details-card { display: grid; align-content: start; min-width: 0; }
.reference-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-line);
}
.reference-detail-list { display: grid; gap: 7px; min-width: 0; margin: 0; padding-top: 12px; }
.reference-detail-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  margin: 0;
}
.reference-detail-row dt {
  color: var(--color-muted);
  font-size: .7rem;
  font-weight: 750;
  line-height: 1.35;
  text-transform: uppercase;
}
.reference-detail-row dt::after { content: ":"; }
.reference-detail-row dd {
  min-width: 0;
  margin: 0;
  color: var(--color-ink);
  font-size: .82rem;
  font-weight: 650;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.reference-details-card .reference-card-actions { flex: none; }
.reference-details-card .reference-card-action {
  display: inline-flex;
  width: auto;
  min-width: 82px;
  height: 38px;
  justify-content: center;
  gap: 7px;
  padding-inline: 11px;
  font-weight: 750;
}
@media (max-width: 575.98px) {
  .reference-card-header { align-items: flex-start; }
  .reference-details-card .reference-card-action { min-width: 38px; padding-inline: 9px; }
  .reference-details-card .reference-card-action span { display: none; }
  .reference-detail-row { grid-template-columns: 94px minmax(0, 1fr); }
}

.document-person-card { padding: 0; overflow: hidden; }
.document-person-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 18px; background: color-mix(in srgb, var(--color-accent-soft) 40%, var(--color-surface)); }
.document-count-badge { flex: 0 0 auto; padding: .35rem .65rem; border-radius: 999px; background: var(--color-surface); color: var(--color-primary); font-size: .75rem; font-weight: 700; }
.document-upload-list { display: grid; min-width: 0; }
.document-saved-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 8px 0;
  border-top: 1px solid var(--color-line);
}
.document-saved-copy { display: grid; min-width: 0; }
.document-saved-title,
.document-row-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.document-saved-title > strong,
.document-row-title > strong,
.document-saved-filename {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.document-saved-filename { color: var(--color-muted); font-size: .78rem; }
.document-saved-title > strong,
.document-row-title > strong { flex: 0 1 auto; }
.document-upload-check { flex: none; color: var(--color-success); font-size: .78rem; line-height: 1; }
.document-group-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 9px 18px; border-top: 1px solid var(--color-line); background: color-mix(in srgb, var(--color-primary) 5%, var(--color-surface)); }
.document-group-title { margin: 0; color: var(--color-primary); font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.document-group-selector { display: grid; grid-template-columns: auto 112px; align-items: center; gap: 7px; margin: 0; }
.document-group-selector > span { color: var(--color-muted); font-size: .6rem; font-weight: 700; }
.agent-portal .document-group-selector .form-select { min-height: 32px; padding-block: .2rem; font-size: .7rem; }
.document-subgroup-heading { padding: 10px 18px 7px; border-top: 1px solid var(--color-line); background: color-mix(in srgb, var(--color-surface-alt) 70%, var(--color-surface)); color: var(--color-ink); font-size: .78rem; font-weight: 800; letter-spacing: .025em; }
.document-upload-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1rem; min-height: 72px; padding: 12px 18px; border-top: 1px solid var(--color-line); }
.document-upload-copy { min-width: 0; display: grid; gap: .2rem; }
.document-upload-copy > strong,
.document-row-title > strong { line-height: 1.25; }
.document-upload-copy > span { overflow: hidden; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.document-uploaded-file { color: var(--color-success); }
.document-uploaded-file i { margin-right: .35rem; }
.document-upload-metadata { color: var(--color-muted); font-size: .68rem; }
.document-upload-actions { display: flex; align-items: center; justify-content: flex-end; gap: .45rem; }
.document-upload-actions form { margin: 0; }
.document-row-upload-form { display: flex; align-items: flex-end; justify-content: flex-end; gap: .45rem; }
.financial-upload-control { position: relative; }
.financial-bank-core-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: end; }
.financial-bank-core-field { min-width: 0; }
.financial-bank-core-field .form-label { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.financial-bank-core-field .form-control,
.financial-bank-core-field .form-select { min-width: 0; padding-inline: 9px; }
.financial-bank-other-field { grid-column: 1 / -1; }
.financial-upload-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-height: 72px;
  padding: 11px 12px;
  border: 1.5px dashed color-mix(in srgb, var(--color-primary) 52%, var(--color-line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--color-accent-soft) 42%, var(--color-surface));
  cursor: pointer;
  transition: border-color .2s, background .2s, box-shadow .2s, transform .2s;
}
.financial-upload-card:hover,
.financial-upload-card:focus-within { border-color: var(--color-primary); background: color-mix(in srgb, var(--color-accent-soft) 66%, var(--color-surface)); box-shadow: 0 8px 20px color-mix(in srgb, var(--color-primary) 11%, transparent); transform: translateY(-1px); }
.financial-upload-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--color-surface); color: var(--color-primary); box-shadow: inset 0 0 0 1px var(--color-line); font-size: 1.08rem; }
.financial-upload-copy { display: grid; min-width: 0; gap: 4px; }
.financial-upload-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; line-height: 1.15; }
.financial-upload-heading strong { color: var(--color-ink); font-size: .88rem; }
.financial-upload-copy small { overflow: hidden; color: var(--color-muted); font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.financial-upload-optional { padding: 3px 6px; border-radius: 999px; background: var(--color-surface); color: var(--color-muted); font-size: .56rem; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.financial-upload-action { padding: 6px 9px; border-radius: 9px; background: var(--color-primary); color: var(--color-primary-text); font-size: .66rem; font-weight: 800; }
.financial-upload-card.is-selected { border-style: solid; border-color: var(--color-success); background: var(--color-success-bg); }
.financial-upload-card.is-selected .financial-upload-icon { color: var(--color-success); }
.financial-upload-card.is-selected .financial-upload-action { display: none; }
.financial-upload-icon-actions { display: flex; align-items: center; gap: 5px; }
.financial-upload-control > .financial-upload-icon-actions { position: absolute; z-index: 2; right: 10px; top: 50%; transform: translateY(-50%); }
.financial-upload-icon-actions form { margin: 0; }
.financial-upload-icon-actions a,
.financial-upload-icon-actions button,
.financial-upload-icon-actions label { width: 32px; height: 32px; display: grid; place-items: center; margin: 0; padding: 0; border: 1px solid color-mix(in srgb, var(--color-primary) 24%, var(--color-line)); border-radius: 9px; background: var(--color-surface); color: var(--color-primary); cursor: pointer; font-size: .88rem; line-height: 1; text-decoration: none; }
.financial-upload-icon-actions a:hover,
.financial-upload-icon-actions button:hover,
.financial-upload-icon-actions label:hover { border-color: var(--color-primary); background: var(--color-accent-soft); color: var(--color-primary); }
.financial-upload-icon-actions form:last-child button,
.financial-upload-control .financial-upload-icon-actions button:last-child { color: var(--color-danger); }
.financial-upload-icon-actions form:last-child button:hover,
.financial-upload-control .financial-upload-icon-actions button:last-child:hover { border-color: var(--color-danger); background: var(--color-danger-bg); color: var(--color-danger); }
.financial-upload-saved { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px; border: 1px solid var(--color-line); border-radius: 12px; background: var(--color-surface-alt); }
.financial-upload-saved .financial-upload-copy > strong { font-size: .78rem; }
.financial-upload-saved .financial-upload-copy > small { max-width: 190px; }

@media (max-width: 430px) {
  .financial-upload-card.is-selected { padding-right: 116px; }
  .financial-upload-card.is-selected .financial-upload-heading { display: block; }
  .financial-upload-card.is-selected .financial-upload-optional { display: none; }
}
.document-metadata-field { display: grid; gap: 2px; min-width: 138px; margin: 0; }
.document-metadata-field > span { color: var(--color-muted); font-size: .6rem; font-weight: 700; line-height: 1.1; }
.agent-portal .document-metadata-field .form-control,
.agent-portal .document-metadata-field .form-select { min-height: 36px; padding-block: .25rem; font-size: .72rem; }
.document-icon-button { width: 38px; height: 38px; display: inline-grid; place-items: center; padding: 0; }

@media (max-width: 540px) {
  .document-person-heading { padding: 14px; }
  .document-group-heading { padding-inline: 14px; }
  .document-subgroup-heading { padding-inline: 14px; }
  .document-group-selector { grid-template-columns: auto 105px; }
  .document-upload-row { gap: .7rem; padding: 12px 14px; }
  .document-upload-actions { flex-wrap: wrap; }
  .document-upload-row.has-document-metadata .document-upload-actions { grid-column: 1 / -1; width: 100%; }
  .document-upload-row.has-document-metadata .document-row-upload-form { flex: 1 1 100%; flex-wrap: wrap; }
  .document-metadata-field { flex: 1 1 135px; min-width: 0; }
  .document-upload-actions .btn { min-height: 36px; }
}

.bottom-nav {
  background: color-mix(in srgb, var(--color-surface) 94%, transparent);
  backdrop-filter: blur(16px);
  box-shadow: 0 -9px 28px color-mix(in srgb, var(--color-ink) 7%, transparent);
}
.bottom-nav-item { transition: color .18s ease, background-color .18s ease, border-color .18s ease; }
.bottom-nav-item i { font-size: 1.05rem; }
.bottom-nav-item.active { background: linear-gradient(180deg, var(--color-accent-soft), color-mix(in srgb, var(--color-accent-soft) 25%, transparent)); }

@media (min-width: 992px) {
  .main-content { padding: 32px 36px 56px; }
  .topbar { padding-left: 16px; padding-right: 24px; }
}

/* Customer details overview mirrors the field-and-photograph layout used during capture. */
.customer-overview-card {
  overflow: hidden;
  border: 1px solid var(--color-line);
  border-radius: 12px;
  background: var(--color-surface);
  box-shadow: var(--ui-shadow-sm);
}
.customer-overview-heading {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 0 8px;
}
.customer-overview-heading > span {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: none;
  border: 1px solid color-mix(in srgb, var(--color-primary) 22%, var(--color-line));
  border-radius: 50%;
  background: var(--color-accent-soft);
  color: var(--color-primary);
}
.customer-overview-heading h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}
.customer-overview-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: clamp(32px, 7vw, 100px);
  align-items: start;
  padding: 16px clamp(18px, 3vw, 34px) 22px;
}
.customer-overview-groups { min-width: 0; }
.customer-overview-group + .customer-overview-group {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--color-line);
}
.customer-overview-details {
  display: grid;
  gap: 0;
  max-width: 820px;
  margin: 0;
}
.customer-overview-row {
  display: grid;
  grid-template-columns: 22px minmax(145px, .7fr) minmax(0, 1.3fr);
  gap: 12px;
  align-items: start;
  min-height: 33px;
  padding: 7px 0;
}
.customer-overview-row > i {
  color: var(--color-muted);
  font-size: 1rem;
  line-height: 1.3;
  text-align: center;
}
.customer-overview-row dt {
  color: var(--color-muted);
  font-size: .78rem;
  font-weight: 500;
}
.customer-overview-row dd {
  min-width: 0;
  margin: 0;
  color: var(--color-ink);
  font-size: .8rem;
  font-weight: 650;
  overflow-wrap: anywhere;
}
.customer-overview-photo {
  display: grid;
  justify-items: center;
  gap: 9px;
  margin: 8px 0 0;
}
.customer-overview-photo img,
.customer-overview-photo-placeholder {
  width: min(100%, 230px);
  aspect-ratio: 1 / 1.08;
  border: 3px solid color-mix(in srgb, var(--color-primary) 28%, var(--color-line));
  border-radius: 22px;
  background: var(--color-surface-alt);
  box-shadow: 0 12px 30px color-mix(in srgb, var(--color-primary) 18%, transparent);
}
.customer-overview-photo img { display: block; object-fit: cover; }
.customer-overview-photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
}
.customer-overview-photo-placeholder span { font-size: 2.5rem; font-weight: 850; }
.customer-overview-photo-placeholder small { margin-top: 8px; color: var(--color-muted); }
@media (max-width: 850px) {
  .customer-overview-layout { grid-template-columns: 1fr; gap: 18px; }
  .customer-overview-photo { grid-row: 1; justify-items: start; }
  .customer-overview-photo img,
  .customer-overview-photo-placeholder { width: 180px; }
}

@media (max-width: 520px) {
  .customer-overview-row { grid-template-columns: 20px minmax(108px, .8fr) minmax(0, 1.2fr); gap: 8px; }
}

/* Income and employment detail view with customer-owned salary slip records. */
.income-employment-layout { display: grid; grid-template-columns: 1fr; gap: 12px; align-items: start; }
.income-employment-layout.has-payslips { grid-template-columns: minmax(0, 1.05fr) minmax(390px, .95fr); }
.employment-profile-card,
.salary-slip-panel,
.employment-supporting-panel {
  min-width: 0;
  padding: 16px 18px 20px;
  border: 1px solid var(--color-line);
  border-radius: 14px;
  background: var(--color-surface);
  box-shadow: var(--ui-shadow-sm);
}
.employment-section-heading {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 9px;
}
.employment-section-heading > span {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: none;
  border: 1px solid color-mix(in srgb, var(--color-primary) 22%, var(--color-line));
  border-radius: 50%;
  background: var(--color-accent-soft);
  color: var(--color-primary);
}
.employment-section-heading h2 { margin: 0; font-size: 1rem; font-weight: 800; }
.employment-detail-group + .employment-detail-group {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--color-line);
}
.employment-detail-list { display: grid; gap: 0; margin: 0; }
.employment-detail-row {
  display: grid;
  grid-template-columns: 22px minmax(150px, .75fr) minmax(0, 1.25fr);
  gap: 11px;
  align-items: start;
  padding: 7px 0;
}
.employment-detail-row > i { color: var(--color-muted); text-align: center; }
.employment-detail-row dt { color: var(--color-muted); font-size: .76rem; font-weight: 500; }
.employment-detail-row dd { min-width: 0; margin: 0; font-size: .79rem; font-weight: 650; overflow-wrap: anywhere; }
.employment-detail-group-paired .employment-detail-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.employment-detail-group-paired .employment-detail-row { grid-template-columns: 20px minmax(105px, .9fr) minmax(0, 1.1fr); gap: 8px; }
.employment-detail-group-paired .employment-detail-row-wide {
  grid-column: 1 / -1;
  grid-template-columns: 20px 105px minmax(0, 1fr);
}
.employment-detail-group-paired .employment-detail-row-vintage {
  grid-template-columns: 20px max-content minmax(0, 1fr);
}
.employment-detail-row-vintage dt { white-space: nowrap; }
.employment-detail-group-business .employment-detail-list {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0 18px;
}
.employment-detail-group-business .employment-detail-row { grid-column: 1 / -1; }
.employment-detail-group-business .employment-detail-row:not(.employment-detail-row-half):not(.employment-detail-row-third) {
  grid-template-columns: 20px max-content minmax(0, 1fr);
  gap: 8px;
}
.employment-detail-group-business .employment-detail-row-half {
  grid-column: span 3;
  grid-template-columns: 20px minmax(105px, .9fr) minmax(0, 1.1fr);
  gap: 8px;
}
.employment-detail-group-business .employment-detail-row-third {
  grid-column: span 2;
  grid-template-columns: 20px minmax(45px, .9fr) minmax(0, 1.1fr);
  gap: 6px;
}
.employment-detail-group-inline .employment-detail-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.employment-detail-group-inline .employment-detail-row {
  grid-template-columns: 20px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 3px 8px;
  padding: 10px;
  border: 1px solid var(--color-line);
  border-radius: 9px;
  background: var(--color-surface-alt);
}
.employment-detail-group-inline .employment-detail-row > i { grid-row: 1 / 3; }
.employment-detail-group-inline .employment-detail-row dt { font-size: .65rem; letter-spacing: -.01em; white-space: nowrap; }
.employment-detail-group-inline .employment-detail-row dd { grid-column: 2; }
.gstin-verification-trigger-row { position: relative; cursor: pointer; transition: border-color .16s ease, background .16s ease, box-shadow .16s ease; }
.gstin-verification-trigger-row:hover { border-color: color-mix(in srgb, var(--color-primary) 42%, var(--color-line)); background: color-mix(in srgb, var(--color-accent-soft) 52%, var(--color-surface-alt)); box-shadow: 0 4px 12px color-mix(in srgb, var(--color-primary) 10%, transparent); }
.gstin-verification-trigger-row.is-verified { border-color: color-mix(in srgb, var(--color-success) 34%, var(--color-line)); }
.gstin-verification-trigger { position: absolute; inset: 0; z-index: 1; width: 100%; border: 0; border-radius: inherit; background: transparent; cursor: pointer; }
.gstin-verification-trigger:focus-visible { outline: 3px solid color-mix(in srgb, var(--color-primary) 28%, transparent); outline-offset: 2px; }
.gstin-verification-trigger-row dd { display: flex; align-items: center; gap: 6px; }
.gstin-verified-tick { display: inline-grid; place-items: center; color: var(--color-success); font-size: .9rem; line-height: 1; }
.verification-modal-header .verification-modal-sync { margin-left: auto; }
.verification-modal-header .verification-modal-sync + .kyc-status { margin-left: 0; }
.income-document-column { display: grid; gap: 12px; position: sticky; top: calc(var(--portal-topbar-height, 70px) + 54px); }
.income-document-column .salary-slip-panel { position: static; }
.employment-document-group > h3 { margin: 0 0 8px; color: var(--color-ink); font-size: .78rem; font-weight: 850; letter-spacing: .04em; }
.employment-document-group-separated { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--color-line); }
.employment-supporting-panel .customer-context-document-grid { grid-template-columns: 1fr; }
.salary-slip-table-wrap { overflow-x: auto; border: 1px solid var(--color-line); border-radius: 11px; }
.salary-slip-table { width: 100%; min-width: 530px; border-collapse: collapse; }
.salary-slip-table th {
  padding: 10px 11px;
  border-bottom: 1px solid var(--color-line);
  background: var(--color-surface-alt);
  color: var(--color-ink);
  font-size: .71rem;
  font-weight: 800;
  text-align: left;
}
.salary-slip-table th:first-child { width: 54px; }
.salary-slip-table td {
  padding: 11px;
  border-bottom: 1px solid color-mix(in srgb, var(--color-line) 70%, transparent);
  color: var(--color-muted);
  font-size: .72rem;
  vertical-align: middle;
}
.salary-slip-table tbody tr:last-child td { border-bottom: 0; }
.salary-slip-number {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--color-surface-alt);
  color: var(--color-ink);
  font-weight: 800;
}
.salary-slip-table td:nth-child(2) { min-width: 210px; }
.salary-slip-table td:nth-child(2) a { display: inline-flex; align-items: center; gap: 6px; color: var(--color-primary); font-weight: 750; }
.salary-slip-table td:nth-child(2) a span { overflow-wrap: anywhere; }
.salary-slip-table td:nth-child(2) small { display: block; max-width: 250px; margin-top: 3px; overflow: hidden; color: var(--color-muted); text-overflow: ellipsis; white-space: nowrap; }
.salary-slip-empty { display: grid; place-items: center; gap: 8px; min-height: 180px; padding: 24px; color: var(--color-muted); text-align: center; }
.salary-slip-empty i { color: var(--color-primary); font-size: 1.7rem; }

@media (min-width: 992px) {
  .income-employment-layout.is-self-employed .employment-profile-card { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .is-self-employed .employment-detail-group + .employment-detail-group { margin-top: 0; padding-top: 0; border-top: 0; }
  .is-self-employed .employment-detail-group-inline { grid-column: 1 / -1; padding-top: 16px !important; border-top: 1px solid var(--color-line) !important; }
  .income-employment-layout.has-payslips.is-self-employed .employment-profile-card { display: block; }
  .income-employment-layout.has-payslips.is-self-employed .employment-detail-group + .employment-detail-group { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--color-line); }
}

@media (max-width: 1279.98px) {
  .income-employment-layout.has-payslips { grid-template-columns: 1fr; }
  .income-document-column { position: static; }
}

@media (max-width: 520px) {
  .employment-profile-card,
  .salary-slip-panel,
  .employment-supporting-panel { padding: 14px; }
  .employment-detail-row { grid-template-columns: 20px minmax(115px, .8fr) minmax(0, 1.2fr); gap: 8px; }
  .employment-detail-group-paired .employment-detail-list { grid-template-columns: 1fr; }
  .employment-detail-group-paired .employment-detail-row { grid-template-columns: 20px minmax(115px, .8fr) minmax(0, 1.2fr); }
  .employment-detail-group-paired .employment-detail-row-wide { grid-column: auto; }
  .employment-detail-group-business .employment-detail-list { grid-template-columns: 1fr; }
  .employment-detail-group-business .employment-detail-row,
  .employment-detail-group-business .employment-detail-row-half,
  .employment-detail-group-business .employment-detail-row-third {
    grid-column: auto;
    grid-template-columns: 20px minmax(115px, .8fr) minmax(0, 1.2fr);
    gap: 8px;
  }
  .employment-detail-group-business .employment-detail-row:not(.employment-detail-row-half):not(.employment-detail-row-third) {
    grid-template-columns: 20px minmax(115px, .8fr) minmax(0, 1.2fr);
  }
  .employment-detail-group-inline .employment-detail-list { grid-template-columns: 1fr; }
  .employment-detail-group-inline .employment-detail-row { grid-template-columns: 20px minmax(0, 1fr); }
}

@media (max-width: 991.98px) {
  body.agent-portal,
  .agent-portal .portal-shell,
  .agent-portal .main-content,
  .agent-portal .main-content > * { width: 100%; max-width: 100%; }
  .agent-portal .main-content,
  .agent-portal form,
  .agent-portal .row,
  .agent-portal [class*="col-"],
  .agent-portal .input-group { min-width: 0; }
  .agent-portal input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="button"]):not([type="submit"]),
  .agent-portal textarea,
  .agent-portal select,
  .agent-portal .form-control,
  .agent-portal .form-select { font-size: 16px !important; }
  .topbar { height: 64px; }
  .main-content { padding: 20px 14px 96px; }
  .agent-portal .main-content.with-sticky-actions { padding-bottom: 180px; }
  .surface, .section-card { border-radius: 16px; }
  .page-heading { gap: 12px; }
  .page-heading h1, .main-content > h1.h2 { font-size: 1.55rem; }
  .stat-card { padding: 15px; }
  .stat-card > i { width: 38px; height: 38px; margin-bottom: 11px; }
  .stat-card .number { font-size: 1.5rem; }
}

@media (max-width: 575.98px) {
  .bottom-nav-item { min-height: 66px; font-size: .67rem; padding-inline: 2px; }
  .admin-bottom .bottom-nav-item { font-size: .61rem; }
  .page-heading { align-items: flex-start; }
  .section-heading { margin-top: 22px; }
  .participant-inline-third { padding-inline: 4px; }
  .participant-inline-third .form-label { font-size: .72rem; white-space: nowrap; }
  .participant-inline-third .form-control { min-height: 44px; padding-inline: .5rem; }
  .participant-inline-half .form-label { font-size: .78rem; white-space: nowrap; }
  .agent-profile-toggle { min-height: 44px; padding: 4px 7px; gap: 7px; }
  .agent-profile-toggle .profile-avatar { width: 34px; height: 34px; }
  .agent-profile-toggle .profile-copy strong { max-width: 105px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .agent-profile-toggle .profile-chevron { display: none; }
  .identity-upload-details { --bs-gutter-x: .65rem; }
  .identity-number-col .form-label,
  .identity-file-col .form-label { display: flex; align-items: flex-end; min-height: 2.2em; font-size: .68rem; line-height: 1.1; }
  .agent-portal .identity-file-col input[type="file"].form-control { min-width: 0; font-size: .64rem; }
  .agent-portal .identity-file-col input[type="file"].form-control::file-selector-button,
  .agent-portal .identity-file-col input[type="file"].form-control::-webkit-file-upload-button { padding-inline: .55rem; font-size: .68rem; }
  .identity-file-col small { display: block; margin-top: 4px; font-size: .6rem; line-height: 1.2; }
}

/* API integration settings and verification results. */
.api-settings-shell { display: grid; gap: 14px; max-width: 1120px; margin: 0 auto; }
.api-settings-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.api-settings-heading h1 { margin: 2px 0 4px; font-size: 1.45rem; font-weight: 850; color: var(--color-ink); }
.api-settings-heading p { margin: 0; color: var(--color-muted); font-size: .78rem; }
.api-provider-pill { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border: 1px solid var(--color-line); border-radius: 999px; background: var(--color-surface); color: var(--color-primary); font-size: .72rem; font-weight: 800; }
.api-settings-form { overflow: hidden; }
.api-master-switch { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 18px; border-bottom: 1px solid var(--color-line); background: color-mix(in srgb, var(--color-primary) 5%, var(--color-surface)); }
.api-master-switch > div { display: grid; gap: 3px; }
.api-master-switch strong { color: var(--color-ink); font-size: .88rem; }
.api-master-switch span { color: var(--color-muted); font-size: .68rem; }
.api-switch { display: flex; align-items: center; gap: 7px; margin: 0; white-space: nowrap; }
.api-switch .form-check-input { width: 2.3rem; height: 1.2rem; margin: 0; cursor: pointer; }
.api-switch > span { color: var(--color-ink); font-size: .68rem; font-weight: 800; }
.api-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 14px 16px; }
.api-config-card { padding: 14px; border: 1px solid var(--color-line); border-radius: 11px; background: var(--color-surface); }
.api-config-card > header { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 10px; margin-bottom: 13px; }
.api-config-card > header h2 { margin: 0 0 2px; font-size: .84rem; font-weight: 850; color: var(--color-ink); }
.api-config-card > header p { margin: 0; color: var(--color-muted); font-size: .64rem; line-height: 1.4; }
.api-card-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; background: var(--color-accent-soft); color: var(--color-primary); }
.api-card-icon.aadhaar { background: #eef2ff; color: #4f46e5; }
.api-card-icon.pan { background: #fff7e6; color: #a36200; }
.api-card-icon.bank { background: var(--color-success-bg); color: var(--color-success); }
.api-config-card .form-label { margin-bottom: 5px; color: var(--color-ink); font-size: .67rem; font-weight: 750; }
.api-config-card .form-control, .api-config-card .input-group-text { min-height: 37px; border-color: var(--color-line); background-color: var(--color-surface-alt); font-size: .72rem; }
.api-compliance-note { display: flex; gap: 9px; margin: 0 16px 14px; padding: 10px 12px; border-radius: 9px; background: #edf6ff; color: #24577d; font-size: .68rem; line-height: 1.5; }
.api-settings-actions { display: flex; justify-content: flex-end; padding: 12px 16px; border-top: 1px solid var(--color-line); }
.api-settings-actions .btn { min-height: 37px; font-size: .72rem; font-weight: 800; }
.api-result-list { display: grid; gap: 9px; }
.api-result-card { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: start; gap: 10px; padding: 11px; border: 1px solid var(--color-line); border-radius: 9px; background: var(--color-surface-alt); }
.api-result-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; background: var(--color-surface); color: var(--color-primary); }
.api-result-copy > div { display: flex; gap: 7px; align-items: baseline; flex-wrap: wrap; }
.api-result-copy strong { color: var(--color-ink); font-size: .74rem; }
.api-result-copy span, .api-result-copy small { color: var(--color-muted); font-size: .64rem; }
.api-result-copy p { margin: 5px 0 0; color: var(--color-danger); font-size: .66rem; }
.api-result-copy details { margin-top: 7px; }
.api-result-copy summary { color: var(--color-primary); cursor: pointer; font-size: .64rem; font-weight: 750; }
.api-result-copy pre { max-height: 300px; margin: 7px 0 0; padding: 9px; border-radius: 7px; overflow: auto; background: #17202a; color: #eef4fa; font-size: .62rem; white-space: pre-wrap; }
.api-result-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.participant-media-grid { display: flex; flex-wrap: wrap; gap: 16px; }
.participant-media-item { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; gap: 7px; }
.participant-media-preview { display: block; width: 180px; height: 150px; border: 1px solid var(--color-line); border-radius: 8px; background: var(--color-surface-alt); object-fit: contain; overflow: hidden; }
.participant-media-file { display: grid; width: 180px; height: 150px; place-items: center; align-content: center; gap: 7px; border: 1px solid var(--color-line); border-radius: 8px; background: var(--color-surface-alt); color: var(--color-primary); font-size: .72rem; font-weight: 700; }
.participant-media-file i { font-size: 1.5rem; }
.detail-value-with-actions { display: flex; min-width: 0; flex-wrap: wrap; align-items: center; gap: 7px; }
.participant-document-filename { min-width: 0; max-width: 100%; overflow: hidden; color: var(--color-ink); font-size: .7rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.application-activity-panel { padding: 15px 16px; }
.application-activity-timeline { margin-top: 2px; }
.application-activity-item { padding-bottom: 18px; }
.application-activity-item:last-child { padding-bottom: 2px; }
.application-activity-content { min-width: 0; }
.application-activity-title { display: flex; align-items: center; gap: 8px; }
.application-activity-title > strong { color: var(--color-ink); font-size: .77rem; }
.application-activity-title > span { padding: 3px 7px; border-radius: 999px; background: var(--color-accent-soft); color: var(--color-primary); font-size: .56rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.application-activity-content > p { font-size: .7rem; }
.application-activity-content > small { font-size: .62rem; }
.application-activity-content code { color: var(--color-primary); }
.timeline-dot--failed { border-color: var(--color-danger-bg); background: var(--color-danger); }
.application-change-list { display: grid; gap: 5px; margin: 8px 0; padding: 0; list-style: none; }
.application-change-list li { display: grid; grid-template-columns: minmax(100px, .8fr) minmax(90px, 1fr) auto minmax(90px, 1fr); align-items: center; gap: 7px; padding: 6px 8px; border: 1px solid var(--color-line); border-radius: 8px; background: var(--color-surface-alt); font-size: .64rem; }
.application-change-list span { color: var(--color-muted); font-weight: 800; }
.application-change-list del { color: var(--color-danger); text-decoration: none; overflow-wrap: anywhere; }
.application-change-list ins { color: var(--color-success); font-weight: 750; text-decoration: none; overflow-wrap: anywhere; }
.application-change-list i { color: var(--color-muted); }
.verification-detail-item { position: relative; cursor: pointer; transition: background-color .15s ease; }
.verification-detail-item:hover { background: color-mix(in srgb, var(--color-primary) 5%, transparent); }
.verification-detail-item > .detail-label,
.verification-detail-item > .detail-value { position: relative; z-index: 1; pointer-events: none; }
.verification-row-trigger { position: absolute; z-index: 1; inset: 0; width: 100%; border: 0; border-radius: 7px; background: transparent; }
.verification-row-trigger:focus-visible { outline: 2px solid var(--color-primary); outline-offset: -2px; }
.verification-details-link { display: inline-block; margin-left: 2px; color: var(--color-primary); font-size: .62rem; font-weight: 800; white-space: nowrap; }
.bank-verification-row .verification-details-link { margin-left: 6px; vertical-align: middle; }
.participant-document-actions { position: relative; z-index: 2; display: inline-flex; flex: 0 0 auto; margin-left: auto; overflow: hidden; border: 1px solid color-mix(in srgb, var(--color-primary) 32%, var(--color-line)); border-radius: 999px; background: var(--color-accent-soft); pointer-events: auto; }
.participant-document-action { display: inline-grid; width: 29px; height: 27px; padding: 0; border: 0; place-items: center; background: transparent; color: var(--color-primary); font-size: .9rem; }
.participant-document-action + .participant-document-action { border-left: 1px solid color-mix(in srgb, var(--color-primary) 24%, var(--color-line)); }
.participant-document-action:hover { background: var(--color-primary); color: var(--color-primary-text); }
.participant-document-actions-multiple { overflow: visible; }
.participant-document-actions-multiple > .dropdown + .dropdown { border-left: 1px solid color-mix(in srgb, var(--color-primary) 24%, var(--color-line)); }
.participant-document-actions-multiple > .participant-document-action + .dropdown { border-left: 1px solid color-mix(in srgb, var(--color-primary) 24%, var(--color-line)); }
.participant-document-actions-multiple .participant-document-action { padding: 0; border: 0; background: transparent; }
.participant-document-actions-multiple .participant-document-action:hover,
.participant-document-actions-multiple .participant-document-action[aria-expanded="true"] { background: var(--color-primary); color: var(--color-primary-text); }
.participant-document-menu { min-width: 150px; padding: 5px; border-color: var(--color-line); border-radius: 10px; box-shadow: 0 12px 30px rgb(15 23 42 / 16%); }
.participant-document-menu .dropdown-item { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 7px; color: var(--color-ink); font-size: .68rem; font-weight: 750; }
.participant-document-menu .dropdown-item i { color: var(--color-primary); }
.participant-document-menu .dropdown-item:hover { background: var(--color-accent-soft); color: var(--color-primary); }
.verification-modal-header { align-items: center; gap: 12px; }
.verification-details-modal .modal-dialog { max-width: 680px; }
.verification-details-modal .modal-header { padding: 11px 14px; }
.verification-details-modal .modal-body { padding: 8px 14px 12px; }
.verification-modal-header > div { min-width: 0; }
.verification-modal-header small { display: block; color: var(--color-muted); font-size: .66rem; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.verification-modal-header .modal-title { margin: 1px 0 0; font-size: 1.2rem; font-weight: 850; }
.verification-modal-header .kyc-status { gap: 7px; margin-left: auto; padding: 7px 11px; font-size: .78rem; }
.verification-modal-header .kyc-status i { font-size: .84rem; }
.verification-modal-header .btn-close { margin-left: 0; }
.verification-modal-icon { display: inline-grid; width: 40px; height: 40px; flex: 0 0 40px; place-items: center; border: 1px solid color-mix(in srgb, var(--color-primary) 28%, var(--color-line)); border-radius: 50%; background: var(--color-accent-soft); color: var(--color-primary); font-size: 1rem; }
.verification-modal-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
.verification-modal-layout.has-photo { grid-template-columns: minmax(0, 1fr) 145px; gap: 18px; }
.verification-modal-facts { padding-top: 0; }
.verification-modal-facts .kyc-fact { grid-template-columns: 22px minmax(125px, .7fr) minmax(0, 1.3fr); padding: 7px 0; }
.verification-modal-facts .kyc-fact > strong { font-size: .82rem; }
.verification-modal-photo { margin: 8px 0 0; }
.verification-modal-photo img { display: block; width: 100%; aspect-ratio: 4 / 5; border: 3px solid var(--color-accent-soft); border-radius: 18px; background: var(--color-surface-alt); object-fit: cover; box-shadow: 0 8px 22px color-mix(in srgb, var(--color-primary) 16%, transparent); }
.borrowers-layout { display: grid; gap: 18px; }
.borrowers-layout-paired { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.borrower-section { min-width: 0; }
.borrower-heading { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 1.05rem; font-weight: 800; }
.borrower-heading i { color: var(--color-primary); }
.borrower-disclosure > summary { list-style: none; }
.borrower-disclosure > summary::-webkit-details-marker { display: none; }
.borrower-summary-card { position: relative; display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 7fr); gap: 14px; align-items: start; padding: 16px; border: 1px solid var(--color-line); border-radius: 13px; background: var(--color-surface); box-shadow: 0 5px 18px color-mix(in srgb, var(--color-ink) 4%, transparent); cursor: pointer; }
.borrower-summary-card:hover { border-color: color-mix(in srgb, var(--color-primary) 38%, var(--color-line)); }
.borrower-summary-card:focus-visible { outline: 3px solid color-mix(in srgb, var(--color-primary) 22%, transparent); outline-offset: 2px; }
.borrower-summary-photo { position: relative; width: 100%; min-height: 0; align-self: stretch; border-radius: 10px; overflow: hidden; background: var(--color-accent-soft); }
.borrower-summary-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.borrower-summary-photo > span { position: absolute; inset: 0; display: grid; width: 100%; height: 100%; place-items: center; color: var(--color-primary); font-size: 1.5rem; }
.borrower-summary-photo[href] { cursor: zoom-in; }
.borrower-summary-photo[href]:focus-visible { outline: 3px solid color-mix(in srgb, var(--color-primary) 28%, transparent); outline-offset: 2px; }
.borrower-photo-modal .modal-dialog { width: min(680px, calc(100% - 28px)); max-width: 680px; }
.borrower-photo-modal .modal-content { overflow: hidden; border: 0; border-radius: 14px; box-shadow: 0 22px 65px rgba(15, 23, 42, .24); }
.borrower-photo-modal .modal-header { align-items: center; padding: 11px 14px; }
.borrower-photo-modal .modal-header small { display: block; color: var(--color-primary); font-size: .62rem; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.borrower-photo-modal .modal-title { margin-top: 1px; font-size: 1rem; font-weight: 850; }
.borrower-photo-modal .modal-body { display: grid; max-height: 76vh; padding: 10px; place-items: center; background: var(--color-surface-alt); }
.borrower-photo-modal .modal-body img { display: block; width: auto; max-width: 100%; height: auto; max-height: calc(76vh - 20px); border-radius: 9px; object-fit: contain; }
.borrower-summary-details { position: relative; display: grid; min-width: 0; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; gap: 12px 14px; }
.borrower-summary-identity { display: flex; min-width: 0; flex-wrap: wrap; align-items: baseline; gap: 3px 8px; }
.borrower-summary-role { width: 100%; display: flex; align-items: center; gap: 8px; color: var(--color-primary); font-size: .64rem; font-weight: 800; letter-spacing: .055em; text-transform: uppercase; }
.borrower-summary-role small { color: var(--color-muted); font-size: .6rem; font-weight: 750; letter-spacing: .025em; }
.borrower-summary-identity > strong { min-width: 0; overflow: hidden; font-size: .94rem; text-overflow: ellipsis; white-space: nowrap; }
.borrower-summary-identity > small { color: var(--color-muted); font-size: .66rem; font-weight: 750; }
.borrower-summary-relationship { position: absolute; top: 27px; right: 0; display: inline-flex; align-items: center; padding: 3px 7px; border-radius: 999px; background: var(--color-accent-soft); color: var(--color-primary); font-size: .6rem; font-weight: 800; white-space: nowrap; }
.borrower-summary-toggle { display: inline-flex; align-items: center; align-self: start; gap: 6px; color: var(--color-primary); font-size: .66rem; font-weight: 800; white-space: nowrap; }
.borrower-summary-toggle i { transition: transform .2s ease; }
.borrower-disclosure[open] .borrower-summary-toggle i { transform: rotate(180deg); }
.borrower-disclosure[open] .borrower-summary-toggle span { font-size: 0; }
.borrower-disclosure[open] .borrower-summary-toggle span::after { content: 'Hide details'; font-size: .66rem; }
.borrower-summary-facts { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; padding-top: 11px; border-top: 1px solid var(--color-line); }
.borrower-summary-facts > span { min-width: 0; }
.borrower-summary-facts small { display: block; margin-bottom: 2px; color: var(--color-muted); font-size: .6rem; font-weight: 700; letter-spacing: .035em; text-transform: uppercase; }
.borrower-summary-facts strong { display: block; overflow: hidden; font-size: .71rem; text-overflow: ellipsis; white-space: nowrap; }
.borrower-summary-facts .borrower-summary-verified-value { display: flex; align-items: center; gap: 6px; overflow: visible; }
.borrower-summary-verified-value > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.borrower-verification-icon { width: 17px; height: 17px; display: inline-grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: #fff; font-size: .58rem; line-height: 1; }
.borrower-verification-icon.is-verified { background: var(--color-success); }
.borrower-verification-icon.is-unverified { background: var(--color-danger); }
.borrower-summary-address strong { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.borrower-expanded { margin-top: 12px; }
.participant-financial-section { display: grid; gap: 10px; }
.participant-financial-tabs { display: flex; width: max-content; max-width: 100%; gap: 3px; margin-bottom: 10px; padding: 3px; overflow-x: auto; border: 1px solid var(--color-line); border-radius: 9px; background: var(--color-surface); }
.participant-financial-tab { display: flex; min-width: 152px; align-items: center; gap: 7px; padding: 5px 8px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--color-muted); text-align: left; }
.participant-financial-tab > i { display: grid; width: 24px; height: 24px; flex: 0 0 24px; place-items: center; border-radius: 6px; background: var(--color-surface-alt); color: var(--color-primary); font-size: .72rem; }
.participant-financial-tab > span { display: grid; min-width: 0; }
.participant-financial-tab strong { color: inherit; font-size: .62rem; font-weight: 850; letter-spacing: .035em; text-transform: uppercase; }
.participant-financial-tab small { overflow: hidden; color: inherit; font-size: .58rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.participant-financial-tab:hover { border-color: color-mix(in srgb, var(--color-primary) 28%, var(--color-line)); color: var(--color-primary); }
.participant-financial-tab.active { border-color: var(--color-primary); background: var(--color-primary); color: var(--color-primary-text); box-shadow: 0 4px 10px color-mix(in srgb, var(--color-primary) 20%, transparent); }
.participant-financial-tab.active > i { background: color-mix(in srgb, var(--color-primary-text) 18%, transparent); color: var(--color-primary-text); }
.participant-financial-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.participant-financial-group { display: grid; gap: 10px; }
.participant-financial-group + .participant-financial-group { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--color-line); }
.participant-financial-group-title { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--color-ink); font-size: .82rem; font-weight: 850; letter-spacing: .045em; text-transform: uppercase; }
.participant-financial-group-title i { color: var(--color-primary); font-size: 1rem; }
.financial-account-grid { grid-template-columns: 1fr; margin-top: 0; }
.present-obligations-panel { margin-top: 10px; }
.present-obligations-panel > h2 { gap: 10px; }
.present-obligations-totals { display: grid; grid-template-columns: repeat(2, minmax(150px, 1fr)); gap: 8px; margin-left: auto; }
.present-obligations-total { display: grid; min-width: 150px; gap: 1px; padding: 5px 10px; border: 1px solid color-mix(in srgb, var(--color-primary) 18%, var(--color-line)); border-radius: 9px; background: var(--color-surface-alt); }
.present-obligations-total small { color: var(--color-muted); font-size: .57rem; font-weight: 750; letter-spacing: .025em; text-transform: uppercase; }
.present-obligations-total strong { color: var(--color-primary); font-size: .76rem; font-weight: 850; }
.present-obligation-source { padding-top: 10px; }
.present-obligation-source + .present-obligation-source { margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--color-line); }
.present-obligation-source-heading { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.present-obligation-source-heading h3 { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 5px 9px; border-radius: 999px; background: var(--color-accent-soft); color: var(--color-primary); font-size: .66rem; font-weight: 850; letter-spacing: .03em; text-transform: uppercase; }
.present-obligation-source-heading h3 i { color: inherit; font-size: .76rem; }
.bank-verification-row { cursor: pointer; transition: background-color .15s ease; }
.bank-verification-row:hover { background: color-mix(in srgb, var(--color-primary) 6%, transparent); }
.bank-verification-row:focus-visible { outline: 2px solid var(--color-primary); outline-offset: -2px; }
.bank-verification-modal .modal-dialog { max-width: 720px; }
.bank-verification-modal-body { display: grid; gap: 8px; }
.bank-verification-modal-body > section { padding: 10px; border: 1px solid var(--color-line); border-radius: 10px; background: var(--color-surface-alt); }
.bank-verification-modal-body h3 { margin: 0 0 6px; color: var(--color-ink); font-size: .72rem; font-weight: 850; text-transform: uppercase; }
.bank-verification-modal .verification-modal-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; }
.bank-verification-modal .verification-modal-facts .kyc-fact { grid-template-columns: 18px minmax(0, 1fr); grid-template-rows: auto auto; gap: 1px 7px; padding: 5px 0; }
.bank-verification-modal .verification-modal-facts .kyc-fact > i { grid-row: 1 / 3; font-size: .82rem; }
.bank-verification-modal .verification-modal-facts .kyc-fact > span,
.bank-verification-modal .verification-modal-facts .kyc-fact > strong { grid-column: 2; font-size: .7rem; line-height: 1.25; }
.application-credit-report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.application-credit-report-card { padding: 0; overflow: hidden; }
.application-credit-report-header { display: flex; align-items: center; gap: 10px; padding: 13px 15px; border-bottom: 1px solid var(--color-line); background: linear-gradient(135deg, var(--color-surface-alt), var(--color-surface)); }
.application-credit-report-header > div { min-width: 0; }
.application-credit-report-header small { display: block; color: var(--color-muted); font-size: .62rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.application-credit-report-header h2 { display: block; margin: 1px 0 0; overflow: hidden; font-size: .95rem; text-overflow: ellipsis; white-space: nowrap; }
.application-credit-report-header .credit-status { margin-left: auto; }
.application-credit-report-icon { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border-radius: 10px; background: var(--color-accent-soft); color: var(--color-primary); }
.application-credit-report-body { padding: 0 15px 14px; }
.application-credit-report-body .credit-score-gauge { width: min(100%, 225px); margin-top: 12px; }
.application-credit-report-body .credit-score-range { margin-bottom: 12px; max-width: 185px; }
.application-credit-report-body .credit-score-metrics > div { padding: 8px 0; }
.application-credit-report-fetched { display: flex; align-items: center; gap: 5px; margin: 10px 0 0; color: var(--color-muted); font-size: .67rem; }
.application-credit-report-fetched .customer-panel-source { margin-left: auto; }
.application-credit-report-empty { display: grid; min-height: 168px; place-items: center; align-content: center; gap: 6px; padding: 12px; text-align: center; }
.application-credit-report-empty > i { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 50%; background: var(--color-surface-alt); color: var(--color-muted); font-size: 1.15rem; }
.application-credit-report-empty > strong { color: var(--color-ink); font-size: .82rem; }
.application-credit-report-empty > span { max-width: 310px; color: var(--color-muted); font-size: .7rem; line-height: 1.5; }
.capture-upload-chooser { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.file-source-trigger { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; }
.capture-upload-filename { min-width: 0; flex: 1 1 150px; overflow: hidden; color: var(--color-muted); font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.capture-upload-chooser.has-file .capture-upload-filename { color: var(--color-success); font-weight: 750; }
.gold-invoice-pair .capture-upload-chooser { align-items: flex-start; }
.gold-invoice-pair .capture-upload-chooser.has-file {
  box-sizing: border-box;
  width: min(100%, 220px);
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--color-line);
  border-radius: 12px;
  background: var(--color-surface-alt);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--color-sidebar) 8%, transparent);
}
.gold-invoice-pair .capture-upload-chooser.has-file .gold-invoice-icon-actions { order: 1; min-height: 40px; }
.gold-invoice-pair .capture-upload-chooser.has-file .capture-upload-filename { order: 2; width: 100%; flex: 0 1 auto; }
.gold-invoice-icon-actions { width: 100%; }
.capture-upload-native-input,
.capture-upload-camera-input { position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; opacity: 0 !important; }
.file-source-dialog[hidden] { display: none; }
.file-source-dialog { position: fixed; z-index: 1095; inset: 0; display: grid; place-items: center; padding: 20px; background: rgb(15 23 42 / 58%); backdrop-filter: blur(3px); }
.file-source-dialog-open { overflow: hidden; }
.file-source-dialog-panel { box-sizing: border-box; width: min(390px, 100%); padding: 18px; border: 1px solid var(--color-line); border-radius: 20px; background: var(--color-surface); box-shadow: 0 24px 70px rgb(15 23 42 / 28%); }
.file-source-dialog-panel > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.file-source-dialog-panel > header small { display: block; overflow: hidden; max-width: 280px; color: var(--color-primary); font-size: .62rem; font-weight: 800; letter-spacing: .07em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.file-source-dialog-panel > header h2 { margin: 2px 0 0; color: var(--color-ink); font-size: 1.15rem; font-weight: 800; }
.file-source-dialog-panel > header button { width: 34px; height: 34px; display: grid; flex: 0 0 34px; place-items: center; padding: 0; border: 1px solid var(--color-line); border-radius: 10px; background: var(--color-surface-alt); color: var(--color-muted); }
.file-source-dialog-panel > p { margin: 8px 0 16px; color: var(--color-muted); font-size: .78rem; }
.file-source-dialog-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.file-source-dialog-actions > button { display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: center; gap: 10px; padding: 12px; border: 1px solid color-mix(in srgb, var(--color-primary) 22%, var(--color-line)); border-radius: 14px; background: var(--color-surface); color: var(--color-primary); text-align: left; }
.file-source-dialog-actions > button:hover,
.file-source-dialog-actions > button:focus-visible { border-color: var(--color-primary); background: var(--color-accent-soft); }
.file-source-dialog-actions > button > i { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: var(--color-accent-soft); font-size: 1rem; }
.file-source-dialog-actions > button > span { display: grid; min-width: 0; }
.file-source-dialog-actions strong { color: var(--color-ink); font-size: .82rem; }
.file-source-dialog-actions small { color: var(--color-muted); font-size: .64rem; line-height: 1.3; }
.submission-progress-dialog[hidden] { display: none; }
.submission-progress-dialog { position: fixed; z-index: 1100; inset: 0; width: 100vw; height: 100dvh; display: grid; place-items: center; overflow-y: auto; padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); background: rgb(15 23 42 / 62%); backdrop-filter: blur(4px); }
.submission-progress-panel { box-sizing: border-box; width: min(360px, 100%); padding: 28px 22px; border: 1px solid var(--color-line); border-radius: 22px; background: var(--color-surface); box-shadow: 0 24px 70px rgb(15 23 42 / 30%); text-align: center; }
.submission-progress-icon { display: grid; width: 62px; height: 62px; margin: 0 auto 15px; place-items: center; border-radius: 50%; background: var(--color-accent-soft); color: var(--color-primary); font-size: 1.65rem; }
.submission-progress-icon .spinner-border { width: 30px; height: 30px; border-width: 3px; }
.submission-progress-panel > small { color: var(--color-primary); font-size: .64rem; font-weight: 850; letter-spacing: .075em; }
.submission-progress-panel > h2 { margin: 6px 0 8px; color: var(--color-ink); font-size: 1.2rem; font-weight: 850; }
.submission-progress-panel > p { margin: 0; color: var(--color-muted); font-size: .78rem; line-height: 1.55; }
.submission-progress-panel > button { margin-top: 18px; }
.submission-progress-panel[data-state="submitted"] .submission-progress-icon { background: var(--color-success-bg); color: var(--color-success); }
.submission-progress-panel[data-state="error"] .submission-progress-icon { background: var(--color-danger-bg); color: var(--color-danger); }
@media (max-width: 540px) {
  .financial-bank-core-fields { gap: 12px 10px; }
  .financial-bank-core-field .form-label { font-size: .74rem; }
  .financial-bank-core-field .form-control,
  .financial-bank-core-field .form-select { padding-inline: 10px; font-size: .85rem; }
  .file-source-dialog { align-items: center; padding: 12px; }
  .file-source-dialog-panel { border-radius: 20px; }
}
.participant-financial-documents { margin-top: 14px; }
.financial-document-type { display: inline-flex; min-width: 180px; align-items: center; gap: 8px; }
.financial-document-type i { color: var(--color-primary); font-size: 1rem; }
.financial-document-filename { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.participant-financial-documents .participant-document-actions { margin-left: 0; }
.borrowers-layout-paired .borrower-expanded > .customer-panel-grid { grid-template-columns: 1fr; }
.borrower-section .detail-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 18px; }
.borrower-section .detail-item { display: grid; grid-column: 1 / -1; grid-template-columns: minmax(125px, .42fr) minmax(0, .58fr); gap: 14px; align-items: start; }
.borrower-section .detail-item-paired { grid-column: auto; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.borrower-section .detail-item-paired .detail-label { white-space: nowrap; }
.borrower-section .detail-label { margin: 0; }
.api-status { display: inline-flex; padding: 4px 7px; border-radius: 999px; font-size: .6rem; font-weight: 850; white-space: nowrap; }
.api-status.success { background: var(--color-success-bg); color: var(--color-success); }
.api-status.danger { background: var(--color-danger-bg); color: var(--color-danger); }
.api-status.warning { background: #fff4d6; color: #8a5a00; }
.submission-verification-summary { padding: 12px; border: 1px solid var(--color-line); border-radius: 10px; }
.submission-verification-summary > div { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--color-line); font-size: .7rem; }

@media (max-width: 900px) {
  .borrowers-layout-paired { grid-template-columns: 1fr; }
  .participant-financial-grid { grid-template-columns: 1fr; }
  .application-credit-report-grid { grid-template-columns: 1fr; }
  .present-obligations-panel > h2 { flex-wrap: wrap; }
  .present-obligations-totals { order: 3; width: 100%; margin-left: 0; }
}

@media (max-width: 575.98px) {
  .borrower-summary-card { grid-template-columns: 60px minmax(0, 1fr); }
  .borrower-summary-photo { width: 60px; height: 74px; aspect-ratio: auto; }
  .borrower-summary-details { gap: 12px 10px; }
  .borrower-summary-facts { grid-template-columns: 1fr; }
  .borrower-section .detail-list { grid-template-columns: 1fr; }
  .borrower-section .detail-item { grid-template-columns: 1fr; gap: 3px; }
  .borrower-section .detail-item-paired { grid-column: 1 / -1; }
  .borrower-section .customer-data-panel h2 { flex-wrap: wrap; }
  .verification-modal-layout.has-photo { grid-template-columns: 1fr; }
  .verification-modal-photo { width: min(190px, 70%); margin: 0 auto; }
  .verification-modal-facts .kyc-fact { grid-template-columns: 22px minmax(105px, .8fr) minmax(0, 1.2fr); }
  .verification-modal-header { flex-wrap: wrap; }
  .verification-modal-header .kyc-status { order: 3; margin-left: 58px; }
  .bank-verification-modal .verification-modal-facts { grid-template-columns: 1fr; }
}

@media (max-width: 767.98px) {
  .api-settings-heading { align-items: flex-start; flex-direction: column; }
  .api-settings-grid { grid-template-columns: 1fr; }
  .api-config-card > header { grid-template-columns: 38px minmax(0, 1fr); }
  .api-config-card > header .api-switch { grid-column: 1 / -1; }
  .api-result-card { grid-template-columns: 36px minmax(0, 1fr); }
  .api-result-actions { grid-column: 2; justify-self: start; }
}

/* Provider-first API settings navigation. */
.api-provider-tabs { display: flex; padding: 12px 14px 0; border-bottom: 1px solid var(--color-line); background: var(--color-surface-alt); }
.api-provider-tab { min-width: 245px; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 12px 11px; border: 1px solid var(--color-line); border-bottom-color: var(--color-surface); border-radius: 10px 10px 0 0; background: var(--color-surface); color: var(--color-ink); text-align: left; transform: translateY(1px); }
.api-provider-mark, .api-provider-logo { display: grid; place-items: center; background: var(--color-accent-soft); color: var(--color-primary); }
.api-provider-mark { width: 34px; height: 34px; border-radius: 9px; }
.api-provider-tab > span:nth-child(2) { display: grid; gap: 1px; }
.api-provider-tab strong { font-size: .75rem; }
.api-provider-tab small { color: var(--color-muted); font-size: .58rem; }
.api-provider-state { padding: 4px 7px; border-radius: 999px; background: var(--color-surface-alt); color: var(--color-muted); font-size: .56rem; font-weight: 850; }
.api-provider-state.is-on { background: var(--color-success-bg); color: var(--color-success); }
.api-provider-panel { background: var(--color-surface); }
.api-provider-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 17px 18px; border-bottom: 1px solid var(--color-line); }
.api-provider-heading > div:first-child { display: flex; align-items: center; gap: 11px; }
.api-provider-logo { width: 40px; height: 40px; border-radius: 10px; font-size: 1rem; }
.api-provider-heading h2, .api-section-intro h3, .api-list-heading h3 { margin: 0 0 2px; color: var(--color-ink); font-size: .9rem; font-weight: 850; }
.api-provider-heading p, .api-section-intro p, .api-list-heading p { margin: 0; color: var(--color-muted); font-size: .65rem; }
.api-master-control > span { display: grid; gap: 1px; text-align: right; }
.api-master-control > span strong { color: var(--color-ink); font-size: .68rem; }
.api-master-control > span small { color: var(--color-muted); font-size: .58rem; font-weight: 500; }
.api-master-control b { min-width: 22px; color: var(--color-ink); font-size: .65rem; }
.api-section-tabs { display: flex; gap: 22px; padding: 0 18px; border-bottom: 1px solid var(--color-line); }
.api-section-tab { display: inline-flex; align-items: center; gap: 7px; min-height: 46px; padding: 0 2px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--color-muted); font-size: .72rem; font-weight: 800; }
.api-section-tab:hover { color: var(--color-primary); }
.api-section-tab.active { border-bottom-color: var(--color-primary); color: var(--color-primary); }
.api-count { display: grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--color-accent-soft); font-size: .58rem; }
.api-tab-content { min-height: 330px; }
.api-credentials-panel, .api-list-panel { padding: 18px; }
.api-section-intro { display: flex; align-items: center; gap: 11px; margin-bottom: 18px; }
.api-credential-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 870px; }
.api-credentials-panel .form-label { margin-bottom: 5px; color: var(--color-ink); font-size: .67rem; font-weight: 750; }
.api-credentials-panel .form-control, .api-credentials-panel .input-group-text, .api-endpoint-field .form-control { min-height: 39px; border-color: var(--color-line); background-color: var(--color-surface-alt); font-size: .72rem; }
.api-field-help { display: block; margin-top: 6px; color: var(--color-muted); font-size: .62rem; }
.api-field-help i { margin-right: 4px; color: var(--color-success); }
.api-list-heading, .api-list-row { display: grid; grid-template-columns: minmax(190px, .8fr) minmax(300px, 1.45fr) 105px; align-items: center; gap: 18px; }
.api-list-heading { padding: 0 12px 10px; }
.api-list-heading > span { color: var(--color-muted); font-size: .6rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.api-list-row { padding: 13px 12px; border-top: 1px solid var(--color-line); }
.api-list-name { display: flex; align-items: center; gap: 11px; }
.api-list-name > div { display: grid; gap: 2px; }
.api-list-name strong { color: var(--color-ink); font-size: .75rem; }
.api-list-name small { color: var(--color-muted); font-size: .61rem; }
.api-endpoint-field label { display: none; }
.api-row-switch { justify-self: end; }
.api-list-panel .api-compliance-note { margin: 14px 0 0; }
.api-settings-actions { align-items: center; justify-content: space-between; gap: 15px; background: var(--color-surface-alt); }
.api-settings-actions > span { color: var(--color-muted); font-size: .62rem; }

@media (max-width: 767.98px) {
  .api-provider-tab { min-width: 100%; }
  .api-provider-heading { align-items: flex-start; flex-direction: column; }
  .api-master-control > span { text-align: left; }
  .api-credential-fields { grid-template-columns: 1fr; }
  .api-list-heading { display: none; }
  .api-list-row { grid-template-columns: 1fr auto; gap: 11px; }
  .api-endpoint-field { grid-column: 1 / -1; grid-row: 2; }
  .api-endpoint-field label { display: block; margin-bottom: 5px; color: var(--color-muted); font-size: .6rem; font-weight: 750; }
  .api-row-switch { grid-column: 2; grid-row: 1; }
  .api-settings-actions { align-items: stretch; flex-direction: column; }
  .api-settings-actions .btn { width: 100%; }
}

/* Compact integration console, modelled on provider administration tools. */
.api-console-page { max-width: 1180px; }
.api-console { overflow: hidden; border: 1px solid var(--color-line); border-radius: 13px; }
.api-console-header { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 16px; background: linear-gradient(135deg, var(--color-primary), color-mix(in srgb, var(--color-primary) 78%, #0f172a)); color: #fff; }
.api-console-provider { display: flex; align-items: center; gap: 10px; }
.api-console-logo { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.24); border-radius: 8px; background: rgba(255,255,255,.16); color: #fff; font-size: .7rem; font-weight: 900; letter-spacing: .03em; }
.api-console-provider > div { display: grid; gap: 1px; }
.api-console-provider strong { font-size: .84rem; }
.api-console-provider small { color: #9aa8bc; font-size: .58rem; }
.api-console-status { padding: 4px 7px; border: 1px solid #465166; border-radius: 999px; color: #b8c1d0; font-size: .54rem; font-weight: 900; letter-spacing: .04em; }
.api-console-status.is-active { border-color: rgba(255,255,255,.48); background: rgba(255,255,255,.14); color: #fff; }
.api-console-master { display: flex; align-items: center; gap: 9px; margin: 0; }
.api-console-master > span { display: grid; gap: 1px; text-align: right; }
.api-console-master strong { color: #fff; font-size: .65rem; }
.api-console-master small { color: #9aa8bc; font-size: .55rem; }
.api-console-master .form-check-input { width: 2.2rem; height: 1.15rem; margin: 0; cursor: pointer; }
.api-console-master b { min-width: 18px; color: #fff; font-size: .62rem; }
.api-console-toolbar { display: flex; align-items: center; gap: 26px; min-height: 43px; padding: 0 16px; border-bottom: 1px solid var(--color-line); background: var(--color-surface); }
.api-console-toolbar > span { min-height: 43px; display: inline-flex; align-items: center; gap: 6px; border-bottom: 2px solid transparent; color: var(--color-muted); font-size: .64rem; font-weight: 750; }
.api-console-toolbar > span.active { border-bottom-color: var(--color-primary); color: var(--color-primary); }
.api-console-body { display: grid; grid-template-columns: 185px minmax(0, 1fr); min-height: 485px; }
.api-provider-rail { display: flex; flex-direction: column; gap: 5px; padding: 12px 10px; border-right: 1px solid var(--color-line); background: var(--color-surface); }
.api-provider-rail button { min-height: 43px; display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 9px 11px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--color-muted); text-align: left; font-size: .7rem; font-weight: 750; line-height: 1.25; }
.api-provider-rail button.active { background: var(--color-accent-soft); color: var(--color-primary); }
.api-provider-rail button.active { border-color: color-mix(in srgb, var(--color-primary) 12%, transparent); box-shadow: inset 3px 0 0 var(--color-primary); }
.api-provider-rail button i { font-size: .76rem; }
.api-provider-rail button:disabled { opacity: .68; }
.api-provider-rail button small { color: inherit; font-size: .52rem; font-weight: 850; letter-spacing: .03em; text-transform: uppercase; }
.api-console-content { min-width: 0; padding: 15px 16px 0; }
.api-console-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 13px; }
.api-console-title h2 { margin: 0 0 2px; color: var(--color-ink); font-size: .98rem; font-weight: 850; }
.api-console-title p { margin: 0; color: var(--color-muted); font-size: .61rem; }
.api-console-title-actions { display: flex; align-items: center; gap: 10px; }
.api-content-master { padding-right: 10px; border-right: 1px solid var(--color-line); }
.api-content-master > span { display: grid; gap: 1px; text-align: right; }
.api-content-master strong { color: var(--color-ink); font-size: .6rem; }
.api-content-master small { color: var(--color-muted); font-size: .52rem; }
.api-content-master .form-check-input { width: 2rem; height: 1.05rem; margin: 0; cursor: pointer; }
.api-content-master b { min-width: 16px; color: var(--color-ink); font-size: .56rem; }
.api-token-state { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 999px; background: var(--color-surface-alt); color: var(--color-muted); font-size: .56rem; font-weight: 750; }
.api-token-button { border: 1px solid var(--color-line); cursor: pointer; }
.api-token-button:hover { border-color: var(--color-primary); background: var(--color-accent-soft); color: var(--color-primary); }
.api-console-credentials { margin-bottom: 14px; }
.api-console-section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.api-console-section-title h3 { margin: 0; color: var(--color-ink); font-size: .7rem; font-weight: 850; }
.api-console-section-title > span { color: var(--color-muted); font-size: .55rem; }
.api-console-credential-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.api-console-credential-grid .form-label { margin-bottom: 4px; color: var(--color-ink); font-size: .58rem; font-weight: 750; }
.api-console-credential-grid .form-control, .api-console-credential-grid .input-group-text { min-height: 34px; border-color: var(--color-line); background: var(--color-surface-alt); font-size: .65rem; }
.api-service-table { overflow: hidden; border: 1px solid var(--color-line); border-radius: 9px; background: var(--color-surface); }
.api-service-head, .api-service-row { display: grid; grid-template-columns: minmax(175px, 1.05fr) minmax(250px, 1.45fr) 90px 72px; align-items: center; gap: 12px; }
.api-service-head { min-height: 32px; padding: 0 11px; background: var(--color-surface-alt); color: var(--color-muted); font-size: .52rem; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.api-service-row { min-height: 72px; padding: 9px 11px; border-top: 1px solid var(--color-line); }
.api-service-name { display: flex; align-items: center; gap: 9px; min-width: 0; }
.api-service-name .api-card-icon { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 7px; }
.api-service-name > div, .api-service-product { min-width: 0; display: grid; gap: 3px; }
.api-service-name strong, .api-service-product strong { overflow: hidden; color: var(--color-ink); font-size: .64rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.api-service-name small { color: var(--color-muted); font-size: .54rem; }
.api-service-product strong { color: var(--color-muted); font-size: .55rem; font-weight: 700; }
.api-service-product .form-control { min-height: 30px; padding: 4px 8px; border-color: var(--color-line); background: var(--color-surface-alt); font-size: .59rem; }
.api-service-trigger { display: inline-flex; width: max-content; padding: 4px 7px; border-radius: 999px; background: var(--color-accent-soft); color: var(--color-primary); font-size: .53rem; font-weight: 750; }
.api-service-switch { justify-self: end; }
.api-service-switch .form-check-input { width: 2rem; height: 1.08rem; }
.api-service-switch > span { min-width: 16px; font-size: .55rem; }
.api-console-note { display: flex; gap: 7px; margin: 11px 0; padding: 8px 9px; border-radius: 7px; background: #edf6ff; color: #24577d; font-size: .57rem; line-height: 1.45; }
.api-console-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin: 10px -16px 0; padding: 10px 16px; border-top: 1px solid var(--color-line); background: var(--color-surface-alt); }
.api-console-actions > span { color: var(--color-muted); font-size: .57rem; }
.api-console-actions .btn { min-height: 34px; padding-inline: 14px; background: var(--color-primary); border-color: var(--color-primary); font-size: .64rem; font-weight: 800; }
.api-console-actions .btn:hover { background: color-mix(in srgb, var(--color-primary) 86%, #000); border-color: color-mix(in srgb, var(--color-primary) 86%, #000); }
.api-console .api-card-icon.aadhaar,
.api-console .api-card-icon.pan,
.api-console .api-card-icon.bank { background: var(--color-accent-soft); color: var(--color-primary); }
.api-key-modal { border: 0; border-radius: 13px; box-shadow: 0 20px 60px rgba(15,23,42,.18); }
.api-key-modal .modal-header { align-items: center; gap: 10px; padding: 16px 18px; }
.api-key-modal .modal-title { margin: 0 0 2px; color: var(--color-ink); font-size: .92rem; font-weight: 850; }
.api-key-modal .modal-header p { margin: 0; color: var(--color-muted); font-size: .63rem; }
.api-key-modal .modal-body { padding: 17px 18px; }
.api-key-modal .form-label { color: var(--color-ink); font-size: .67rem; font-weight: 750; }
.api-key-modal .form-control, .api-key-modal .input-group-text, .api-key-modal .btn { min-height: 39px; font-size: .7rem; }
.api-key-modal .api-key-value { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.api-key-modal [data-key-step] small { display: block; margin-top: 7px; color: var(--color-muted); font-size: .6rem; }
.api-key-modal .modal-footer { padding: 11px 18px; background: var(--color-surface-alt); }

/* Aadhaar provider response on the customer KYC record. */
.aadhaar-api-details { grid-column: 1 / -1; margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--color-line); }
.aadhaar-api-details > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.aadhaar-api-details > header > div { display: flex; align-items: center; gap: 6px; color: var(--color-primary); font-size: .68rem; }
.aadhaar-api-details > header > span { color: var(--color-muted); font-size: .56rem; }
.aadhaar-api-details dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin: 0; }
.aadhaar-api-details dl > div { min-width: 0; padding: 8px 9px; border: 1px solid var(--color-line); border-radius: 7px; background: var(--color-surface-alt); }
.aadhaar-api-details dt { margin-bottom: 3px; color: var(--color-muted); font-size: .55rem; font-weight: 650; }
.aadhaar-api-details dd { margin: 0; overflow-wrap: anywhere; color: var(--color-ink); font-size: .64rem; font-weight: 780; }
.aadhaar-reference-list .kyc-fact { grid-template-columns: 22px minmax(120px, .72fr) minmax(0, 1.28fr); padding: 8px 0; }
.aadhaar-reference-list .kyc-fact > i { color: color-mix(in srgb, var(--color-ink) 48%, transparent); }
.aadhaar-reference-list .kyc-fact > strong { font-weight: 650; }
.aadhaar-api-photo-wrap { flex-direction: column; align-items: center; gap: 7px; }
.aadhaar-photo-source-note { color: var(--color-muted); font-size: .57rem; font-weight: 750; letter-spacing: .025em; text-transform: uppercase; }
.aadhaar-photo-upload-link { color: var(--color-primary); font-size: .62rem; font-weight: 750; text-decoration: none; }
.aadhaar-photo-upload-link:hover { text-decoration: underline; }
.aadhaar-api-photo-placeholder { border-color: color-mix(in srgb, var(--color-primary) 24%, var(--color-line)); background: var(--color-surface); box-shadow: 0 8px 24px color-mix(in srgb, var(--color-primary) 10%, transparent); }
.face-match-result { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 12px; margin-top: 14px; padding: 18px; border: 1px solid var(--color-line); border-radius: 10px; background: var(--color-surface-alt); }
.kyc-verification-grid { grid-template-areas: "pan aadhaar" "face aadhaar"; align-items: start; }
.kyc-verification-grid .pan-details-card { grid-area: pan; }
.kyc-verification-grid .face-match-card { grid-area: face; }
.kyc-verification-grid .aadhaar-details-card { grid-area: aadhaar; align-self: stretch; }
.face-match-card-title { display: grid; gap: 1px; }
.face-match-card-title h2 { margin: 0; }
.face-match-card-title small { color: var(--color-muted); font-size: .59rem; font-weight: 500; }
.face-match-card .kyc-sync-form { margin-left: auto; }
.face-match-card .kyc-status.not-matched { background: var(--color-danger-bg); color: var(--color-danger); }
.face-match-heading { display: flex; align-items: center; gap: 9px; }
.face-match-heading > div { display: grid; flex: 1; gap: 1px; }
.face-match-heading strong { color: var(--color-ink); font-size: .74rem; }
.face-match-heading small, .face-match-message { color: var(--color-muted); font-size: .59rem; }
.face-match-icon { width: 34px; height: 34px; display: grid; place-items: center; flex: none; border-radius: 9px; background: var(--color-surface); color: var(--color-primary); }
.face-match-result-icon { display: grid; place-items: center; font-size: 1.35rem; }
.face-match-result-copy { display: grid; gap: 3px; }
.face-match-result-copy > span { color: var(--color-muted); font-size: .76rem; font-weight: 650; }
.face-match-result-copy > strong { color: var(--color-primary); font-size: 1.35rem; font-weight: 850; line-height: 1.05; }
.face-match-result-badge { min-width: 88px; padding: 8px 14px; border-radius: 999px; background: var(--color-primary); color: var(--color-inverse); font-size: .7rem; font-weight: 850; text-align: center; }
.face-match-result.is-match { border-color: color-mix(in srgb, var(--color-success) 36%, var(--color-line)); background: color-mix(in srgb, var(--color-success-bg) 82%, var(--color-surface)); }
.face-match-result.is-match .face-match-result-icon, .face-match-result.is-match .face-match-result-copy > strong { color: var(--color-success); }
.face-match-result.is-match .face-match-result-badge { background: var(--color-success); }
.face-match-result.is-no-match { border-color: color-mix(in srgb, var(--color-danger) 36%, var(--color-line)); background: color-mix(in srgb, var(--color-danger-bg) 82%, var(--color-surface)); }
.face-match-result.is-no-match .face-match-result-icon, .face-match-result.is-no-match .face-match-result-copy > strong { color: var(--color-danger); }
.face-match-result.is-no-match .face-match-result-badge { background: var(--color-danger); }

@media (max-width: 900px) {
  .kyc-verification-grid { grid-template-areas: "pan" "face" "aadhaar"; }
}

/* Immutable API-call report. */
.api-report-page { display: grid; gap: 14px; max-width: 1280px; margin: 0 auto; }
.api-report-heading { margin: 0; }
.api-report-heading h1 { margin: 2px 0 4px; font-size: 1.45rem; font-weight: 850; }
.api-report-heading p { margin: 0; color: var(--color-muted); font-size: .72rem; }
.api-report-provider { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 999px; background: var(--color-accent-soft); color: var(--color-primary); font-size: .64rem; font-weight: 800; }
.api-report-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.api-report-stat { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--color-line); border-radius: 10px; background: var(--color-surface); }
.api-report-stat > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; background: var(--color-accent-soft); color: var(--color-primary); }
.api-report-stat > div { display: grid; gap: 1px; }
.api-report-stat small { color: var(--color-muted); font-size: .6rem; }
.api-report-stat strong { color: var(--color-ink); font-size: 1rem; }
.api-report-stat.success > span { background: var(--color-success-bg); color: var(--color-success); }
.api-report-stat.danger > span { background: var(--color-danger-bg); color: var(--color-danger); }
.api-report-stat.warning > span { background: #fff4d6; color: #8a5a00; }
.api-report-surface { overflow: hidden; }
.api-report-filters { display: flex; gap: 8px; align-items: center; padding: 12px; border-bottom: 1px solid var(--color-line); }
.api-report-search { position: relative; width: 500px; min-width: 280px; max-width: 500px; flex: 0 1 500px; }
.api-report-search i { position: absolute; left: 12px; top: 50%; z-index: 1; width: 14px; transform: translateY(-50%); color: var(--color-muted); font-size: .7rem; line-height: 1; pointer-events: none; }
.admin-portal .api-report-search .form-control { padding-left: 36px; padding-right: .75rem; }
.api-report-filters .form-control, .api-report-filters .form-select, .api-report-filters .btn { min-height: 36px; font-size: .65rem; }
.api-report-filters > .bounded-select { width: 210px; min-width: 160px; flex: 0 1 210px; }
.api-report-filters .form-select { width: 210px; }
.api-report-filter-submit { width: 36px; min-width: 36px; flex: 0 0 36px; display: inline-grid; place-items: center; padding: 0; }
.api-report-filter-submit i { font-size: .78rem; }
.api-report-table { margin: 0; min-width: 1080px; }
.api-report-table thead th { padding: 9px 10px; border-bottom-color: var(--color-line); background: var(--color-surface-alt); color: var(--color-muted); font-size: .52rem; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
.api-report-table tbody td { padding: 10px; border-color: var(--color-line); color: var(--color-ink); font-size: .63rem; vertical-align: top; }
.api-report-table td > strong, .api-report-table td > a { display: block; color: var(--color-ink); font-size: .64rem; font-weight: 800; }
.api-report-table td > a { color: var(--color-primary); text-decoration: none; }
.api-report-table td > small { display: block; max-width: 270px; margin-top: 3px; color: var(--color-muted); font-size: .54rem; line-height: 1.35; overflow-wrap: anywhere; }
.api-report-type { display: inline-flex; padding: 4px 6px; border-radius: 6px; background: var(--color-accent-soft); color: var(--color-primary); font-size: .55rem; font-weight: 850; }
.api-report-error { color: var(--color-danger) !important; }
.api-report-reference { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.api-report-table details { margin-top: 5px; }
.api-report-table summary { color: var(--color-primary); cursor: pointer; font-size: .55rem; font-weight: 750; }
.api-response-payload { position: relative; width: 310px; max-width: 100%; margin-top: 6px; }
.api-report-table pre { width: 100%; max-height: 260px; margin: 0; padding: 34px 8px 8px; overflow: auto; border-radius: 6px; background: #17202a; color: #eef4fa; font-size: .55rem; white-space: pre-wrap; }
.api-response-copy { position: absolute; z-index: 2; top: 6px; right: 6px; display: inline-flex; align-items: center; gap: 5px; min-height: 23px; padding: 4px 7px; border: 1px solid rgb(255 255 255 / 24%); border-radius: 5px; background: rgb(255 255 255 / 10%); color: #eef4fa; font-size: .51rem; font-weight: 800; line-height: 1; transition: background-color .15s ease, border-color .15s ease, color .15s ease; }
.api-response-copy:hover { border-color: rgb(255 255 255 / 42%); background: rgb(255 255 255 / 18%); }
.api-response-copy.is-copied { border-color: #75d6ac; background: #174d3b; color: #d8ffec; }
.api-report-pagination { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--color-line); color: var(--color-muted); font-size: .6rem; }
.api-report-pagination > div { display: flex; align-items: center; gap: 8px; }

@media (max-width: 991.98px) {
  .api-console-body { grid-template-columns: 1fr; }
  .api-provider-rail { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--color-line); }
  .api-provider-rail button { min-width: max-content; }
  .api-service-head, .api-service-row { grid-template-columns: minmax(160px, 1fr) minmax(220px, 1.35fr) 78px 65px; gap: 9px; }
}

@media (max-width: 767.98px) {
  .api-console-header { align-items: flex-start; flex-direction: column; }
  .api-console-master > span { text-align: left; }
  .api-console-toolbar { gap: 16px; overflow-x: auto; }
  .api-console-toolbar > span { min-width: max-content; }
  .api-console-credential-grid { grid-template-columns: 1fr; }
  .api-console-title { align-items: stretch; flex-direction: column; }
  .api-console-title-actions { justify-content: space-between; }
  .api-content-master > span { text-align: left; }
  .api-service-head { display: none; }
  .api-service-row { grid-template-columns: minmax(0, 1fr) auto; gap: 9px; }
  .api-service-product { grid-column: 1 / -1; grid-row: 2; }
  .api-service-trigger { grid-column: 1; grid-row: 3; }
  .api-service-switch { grid-column: 2; grid-row: 1; }
  .api-console-actions { align-items: stretch; flex-direction: column; }
  .api-console-actions .btn { width: 100%; }
  .aadhaar-api-details dl { grid-template-columns: 1fr 1fr; }
  .api-report-summary { grid-template-columns: 1fr 1fr; }
  .api-report-filters { align-items: stretch; flex-direction: column; }
  .api-report-search { flex-basis: auto; width: 100%; max-width: none; }
  .api-report-filters > .bounded-select, .api-report-filters .form-select, .api-report-filters .btn { width: 100%; max-width: none; flex-basis: auto; }
}

/* Admin workspace shell — compact light navigation inspired by the operations console. */
body.admin-portal { background: var(--color-canvas); }
.admin-portal .admin-sidebar {
  background: var(--color-surface);
  color: var(--color-ink);
  border-right: 1px solid var(--color-line);
  box-shadow: none;
}
.admin-sidebar-scroll {
  width: 100%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 16px 10px 24px;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--color-muted) 28%, transparent) transparent;
}
.admin-portal .admin-sidebar .sidebar-eyebrow {
  margin: 0 0 7px;
  padding: 0 4px;
  color: var(--color-muted);
  font-size: .58rem;
  font-weight: 850;
  letter-spacing: .16em;
}
.admin-portal .admin-sidebar .sidebar-eyebrow:not(:first-child) { margin-top: 16px; }
.admin-portal .admin-sidebar .sidebar-nav {
  display: grid;
  gap: 6px;
  min-height: auto;
  overflow: visible;
  padding: 0;
}
.admin-portal .admin-sidebar .sidebar-nav > * {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}
.admin-portal .admin-sidebar .sidebar-nav-group,
.admin-portal .admin-sidebar .sidebar-nav-toggle { overflow: hidden; }
.agent-portal .agent-sidebar .sidebar-nav > *,
.agent-portal .agent-sidebar .sidebar-nav form,
.agent-portal .agent-sidebar .sidebar-nav a,
.agent-portal .agent-sidebar .sidebar-action {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}
.admin-portal .admin-sidebar .sidebar-nav > a,
.admin-portal .admin-sidebar .sidebar-nav > .nav-placeholder,
.admin-portal .admin-sidebar .sidebar-nav > form .sidebar-action,
.admin-portal .admin-sidebar .sidebar-nav-toggle {
  width: 100%;
  min-height: 40px;
  padding: 5px 8px;
  border: 1px solid var(--color-line);
  border-radius: 9px;
  background: var(--color-surface);
  color: var(--color-ink);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--color-ink) 3%, transparent);
  font-size: .78rem;
  font-weight: 650;
  line-height: 1.15;
}
.admin-portal .admin-sidebar .sidebar-nav > a,
.admin-portal .admin-sidebar .sidebar-nav > .nav-placeholder,
.admin-portal .admin-sidebar .sidebar-nav > form .sidebar-action { display: flex; align-items: center; gap: 8px; }
.admin-portal .admin-sidebar .sidebar-nav > form { margin: 0; }
.admin-portal .admin-sidebar .sidebar-nav-toggle { display: flex; align-items: center; justify-content: space-between; text-align: left; }
.admin-portal .admin-sidebar .sidebar-nav-toggle > span { gap: 8px; min-width: 0; font-size: inherit; }
.admin-portal .admin-sidebar .sidebar-nav > a > i,
.admin-portal .admin-sidebar .sidebar-nav > .nav-placeholder > i,
.admin-portal .admin-sidebar .sidebar-nav > form .sidebar-action > i,
.admin-portal .admin-sidebar .sidebar-nav-toggle > span > i {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 7px;
  background: var(--color-surface-alt);
  color: var(--color-muted);
  font-size: .8rem;
}
.admin-portal .admin-sidebar .sidebar-nav-toggle .nav-chevron {
  width: auto;
  height: auto;
  flex: 0 0 auto;
  margin-left: 4px;
  background: transparent;
  color: var(--color-muted);
  font-size: .58rem;
}
.admin-portal .admin-sidebar .sidebar-nav > a:hover,
.admin-portal .admin-sidebar .sidebar-nav > form .sidebar-action:hover,
.admin-portal .admin-sidebar .sidebar-nav-toggle:hover {
  border-color: color-mix(in srgb, var(--color-primary) 38%, var(--color-line));
  background: var(--color-accent-soft);
  color: var(--color-primary);
  transform: none;
}
.admin-portal .admin-sidebar .sidebar-nav > a.active,
.admin-portal .admin-sidebar .sidebar-nav > form .sidebar-action.active {
  border-color: var(--color-primary);
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
  color: var(--color-primary-text);
  box-shadow: 0 6px 14px color-mix(in srgb, var(--color-primary) 22%, transparent);
}
.admin-portal .admin-sidebar .sidebar-nav > a.active > i,
.admin-portal .admin-sidebar .sidebar-nav > form .sidebar-action.active > i {
  background: color-mix(in srgb, var(--color-inverse) 16%, transparent);
  color: var(--color-inverse);
}
.admin-portal .admin-sidebar .sidebar-nav-toggle.active {
  border-color: var(--color-primary);
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
  color: var(--color-primary-text);
  box-shadow: 0 6px 14px color-mix(in srgb, var(--color-primary) 22%, transparent);
}
.admin-portal .admin-sidebar .sidebar-nav-toggle.active > span > i {
  background: color-mix(in srgb, var(--color-inverse) 16%, transparent);
  color: var(--color-inverse);
}
.admin-portal .admin-sidebar .sidebar-nav-toggle.active .nav-chevron { color: var(--color-inverse); }
.admin-portal .admin-sidebar .nav-placeholder { cursor: default; }
.admin-portal .admin-sidebar .sidebar-subnav {
  gap: 4px;
  margin: 4px 0 2px;
  padding: 5px;
  border: 0;
  border-radius: 9px;
  background: color-mix(in srgb, var(--color-primary) 3%, var(--color-surface));
}
.admin-portal .admin-sidebar .sidebar-subnav a,
.admin-portal .admin-sidebar .sidebar-subnav .nav-placeholder {
  min-height: 32px;
  padding: 7px 8px 7px 28px;
  border-radius: 7px;
  color: var(--color-muted);
  font-size: .72rem;
}
.admin-portal .admin-sidebar .sidebar-subnav a::before,
.admin-portal .admin-sidebar .sidebar-subnav .nav-placeholder::before { left: 13px; }
.admin-portal .admin-sidebar .sidebar-subnav a:hover {
  background: color-mix(in srgb, var(--color-primary) 8%, var(--color-surface));
  color: var(--color-primary);
}
.admin-portal .admin-sidebar .sidebar-subnav a.active,
.admin-portal .admin-sidebar .sidebar-subnav .nav-placeholder.active {
  background: color-mix(in srgb, var(--color-primary) 13%, var(--color-surface));
  color: var(--color-primary);
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--color-primary) 62%, transparent);
  font-weight: 750;
}
.admin-portal .admin-sidebar .sidebar-subnav-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-portal .admin-sidebar .sidebar-queue-count {
  display: inline-flex;
  min-width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  flex: none;
  margin-left: auto;
  padding: 0 6px;
  border: 1px solid color-mix(in srgb, var(--color-primary) 15%, var(--color-line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-primary) 7%, var(--color-surface));
  color: var(--color-primary);
  font-size: .58rem;
  font-weight: 850;
  line-height: 1;
}
.admin-portal .admin-sidebar .sidebar-subnav a.active .sidebar-queue-count {
  border-color: color-mix(in srgb, var(--color-primary) 70%, var(--color-line));
  background: var(--color-primary);
  color: var(--color-primary-text);
}
.agent-portal .agent-sidebar .sidebar-subnav a {
  justify-content: space-between;
}
.agent-portal .readonly-label,
.agent-mobile-sidebar .mobile-sidebar-subnav small {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  font-size: .56rem;
  font-weight: 750;
  white-space: nowrap;
}
.agent-menu-toggle {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  margin-left: 8px;
  border: 0;
  border-radius: 10px;
  background: var(--color-surface-alt);
  color: var(--color-primary);
  font-size: 1.45rem;
}
.agent-menu-toggle:hover,
.agent-menu-toggle:focus-visible { background: var(--color-accent-soft); }
.agent-mobile-sidebar {
  --bs-offcanvas-width: min(82vw, 300px);
  background: var(--color-surface);
  color: var(--color-ink);
  border-right: 1px solid var(--color-line);
}
.agent-mobile-sidebar .offcanvas-header {
  min-height: 68px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-line);
}
.agent-mobile-sidebar .offcanvas-header small {
  color: var(--color-muted);
  font-size: .58rem;
  font-weight: 850;
  letter-spacing: .16em;
}
.agent-mobile-sidebar .offcanvas-title { margin-top: 2px; font-size: 1rem; font-weight: 800; }
.agent-mobile-sidebar .offcanvas-body { padding: 14px 10px 20px; }
.mobile-sidebar-nav { display: grid; gap: 6px; }
.mobile-sidebar-nav form { margin: 0; }
.mobile-sidebar-action,
.mobile-sidebar-toggle {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 40px;
  padding: 5px 8px;
  border: 1px solid var(--color-line);
  border-radius: 9px;
  background: var(--color-surface);
  color: var(--color-ink);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--color-ink) 3%, transparent);
  font-size: .78rem;
  font-weight: 650;
  line-height: 1.15;
  text-align: left;
}
.mobile-sidebar-action { gap: 8px; text-decoration: none; }
.mobile-sidebar-toggle { justify-content: space-between; }
.mobile-sidebar-toggle > span { display: flex; align-items: center; gap: 8px; }
.mobile-sidebar-action > i,
.mobile-sidebar-toggle > span > i {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 7px;
  background: var(--color-surface-alt);
  color: var(--color-muted);
  font-size: .8rem;
}
.mobile-sidebar-action:hover,
.mobile-sidebar-toggle:hover {
  border-color: color-mix(in srgb, var(--color-primary) 38%, var(--color-line));
  background: var(--color-accent-soft);
  color: var(--color-primary);
}
.mobile-sidebar-action.active,
.mobile-sidebar-toggle.active {
  border-color: var(--color-primary);
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
  color: var(--color-primary-text);
  box-shadow: 0 6px 14px color-mix(in srgb, var(--color-primary) 22%, transparent);
}
.mobile-sidebar-action.active > i,
.mobile-sidebar-toggle.active > span > i {
  background: color-mix(in srgb, var(--color-inverse) 16%, transparent);
  color: var(--color-inverse);
}
.mobile-sidebar-toggle.active .nav-chevron {
  color: var(--color-inverse);
}
.mobile-sidebar-toggle .nav-chevron { transition: transform .2s ease; }
.mobile-sidebar-toggle[aria-expanded="true"] .nav-chevron { transform: rotate(180deg); }
.mobile-sidebar-subnav {
  display: grid;
  gap: 4px;
  margin: 4px 0 2px;
  padding: 5px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--color-primary) 3%, var(--color-surface));
}
.mobile-sidebar-subnav a {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 32px;
  padding: 7px 8px 7px 28px;
  border-radius: 7px;
  color: var(--color-muted);
  font-size: .72rem;
  font-weight: 650;
  text-decoration: none;
}
.mobile-sidebar-subnav a::before {
  content: "";
  position: absolute;
  left: 13px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: .55;
}
.mobile-sidebar-subnav a:hover {
  background: color-mix(in srgb, var(--color-primary) 8%, var(--color-surface));
  color: var(--color-primary);
}
.mobile-sidebar-subnav a.active {
  background: color-mix(in srgb, var(--color-primary) 13%, var(--color-surface));
  color: var(--color-primary);
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--color-primary) 62%, transparent);
  font-weight: 750;
}
.admin-portal .topbar {
  padding: 0;
  background: color-mix(in srgb, var(--color-surface) 97%, transparent);
  border-bottom: 0;
  box-shadow: none;
  backdrop-filter: blur(14px);
}
.admin-topbar-inner { display: flex; align-items: center; width: 100%; height: 100%; }
.admin-topbar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  padding: 7px 16px;
  border-right: 1px solid var(--color-line);
  background: var(--color-surface);
}
.admin-topbar-brand .brand-logo { max-width: 145px; max-height: 45px; }
.admin-workspace-copy {
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 0 20px;
  line-height: 1.15;
}
.admin-workspace-copy small { color: var(--color-muted); font-size: .57rem; font-weight: 850; letter-spacing: .18em; }
.admin-workspace-copy strong { margin-top: 3px; font-size: .82rem; }
.admin-topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; padding-right: 18px; }
.admin-time-chip {
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  background: var(--color-surface-alt);
  color: var(--color-muted);
  font-size: .69rem;
  font-weight: 700;
  white-space: nowrap;
}
.admin-portal .admin-profile-toggle {
  min-height: 46px;
  padding: 3px 4px 3px 10px;
  gap: 9px;
  border: 0;
  border-radius: 10px;
  box-shadow: none;
}
.admin-portal .admin-profile-toggle:hover,
.admin-portal .admin-profile-toggle[aria-expanded="true"] { background: var(--color-surface-alt); border-color: transparent; box-shadow: none; }
.admin-portal .admin-profile-toggle .profile-copy { min-width: 0; align-items: flex-end; text-align: right; }
.admin-portal .admin-profile-toggle .profile-avatar { width: 36px; height: 36px; border-radius: 50%; font-size: .84rem; font-weight: 850; }

@media (min-width: 992px) {
  .admin-portal,
  .agent-portal {
    --portal-sidebar-width: 260px;
    --portal-topbar-height: 68px;
  }
  .admin-portal .portal-shell { padding-top: var(--portal-topbar-height); padding-left: var(--portal-sidebar-width); }
  .admin-portal .topbar { position: fixed; inset: 0 0 auto 0; z-index: 1050; height: var(--portal-topbar-height); }
  .admin-portal .admin-topbar-brand { width: var(--portal-sidebar-width); flex: 0 0 var(--portal-sidebar-width); }
  .admin-portal .admin-sidebar { top: var(--portal-topbar-height); bottom: 0; width: var(--portal-sidebar-width); padding: 0; z-index: 1040; }
  .admin-portal .main-content { padding: 26px 24px 52px; }
  .agent-portal .portal-shell { padding-left: var(--portal-sidebar-width); }
  .agent-portal .agent-sidebar { width: var(--portal-sidebar-width); }
  .agent-portal .topbar { height: var(--portal-topbar-height); }
  .agent-portal .sticky-actions { left: var(--portal-sidebar-width); }
}

@media (max-width: 991.98px) {
  .admin-portal .admin-topbar-brand { width: auto; padding-inline: 14px; border-right: 0; }
  .admin-portal .admin-topbar-brand .brand-logo { max-width: 128px; max-height: 42px; }
  .admin-portal .admin-topbar-actions { padding-right: 10px; }
}

@media (max-width: 575.98px) {
  .admin-portal .admin-profile-toggle { padding-left: 4px; }
  .admin-portal .admin-profile-toggle .profile-chevron { display: none; }
}

/* Admin dashboard */
.admin-dashboard { display: grid; gap: 18px; }
.dashboard-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 2px 2px 4px;
}
.dashboard-kicker,
.dashboard-panel-kicker {
  margin: 0 0 5px;
  color: var(--color-primary);
  font-size: .67rem;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.dashboard-hero h1 { margin: 0; font-size: clamp(1.65rem, 2.4vw, 2.25rem); font-weight: 850; }
.dashboard-subtitle { margin: 6px 0 0; color: var(--color-muted); font-size: .88rem; }
.dashboard-primary-action { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding-inline: 17px; white-space: nowrap; }
.dashboard-welcome-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dashboard-welcome-row > div { min-width: 0; }
.dashboard-welcome-row form { flex: 0 0 auto; }
.dashboard-apply-action { min-width: 142px; white-space: nowrap; }
.dashboard-recent-body { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: 15px; }
.dashboard-applicant-copy { min-width: 0; }
.dashboard-applicant-copy h3,
.dashboard-applicant-copy p { overflow-wrap: anywhere; }
.dashboard-continue-action { flex: 0 0 132px; min-width: 132px; margin-top: 0 !important; }

.dashboard-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.dashboard-kpi {
  --kpi-accent: var(--color-primary);
  --kpi-soft: var(--color-accent-soft);
  position: relative;
  overflow: hidden;
  min-height: 150px;
  padding: 17px;
  border: 1px solid var(--color-line);
  border-radius: 16px;
  background: var(--color-surface);
  box-shadow: var(--ui-shadow-sm);
}
.dashboard-kpi::after {
  content: "";
  position: absolute;
  right: -28px;
  top: -38px;
  width: 105px;
  height: 105px;
  border-radius: 50%;
  background: var(--kpi-soft);
  opacity: .72;
}
.dashboard-kpi-warning { --kpi-accent: #a96800; --kpi-soft: #fff2ce; }
.dashboard-kpi-success { --kpi-accent: var(--color-success); --kpi-soft: var(--color-success-bg); }
.dashboard-kpi-info { --kpi-accent: #2879a8; --kpi-soft: #e5f4fb; }
.dashboard-kpi-top { display: flex; align-items: center; gap: 10px; position: relative; z-index: 1; }
.dashboard-kpi-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--kpi-soft); color: var(--kpi-accent); }
.dashboard-kpi-label { color: var(--color-muted); font-size: .78rem; font-weight: 700; }
.dashboard-kpi > strong { display: block; margin-top: 14px; font-size: 1.75rem; line-height: 1; letter-spacing: -.04em; }
.dashboard-kpi > small { display: block; margin-top: 8px; color: var(--kpi-accent); font-size: .71rem; font-weight: 700; }

.dashboard-main-grid,
.dashboard-detail-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .85fr); gap: 14px; align-items: stretch; }
.dashboard-detail-grid { grid-template-columns: minmax(0, 1.7fr) minmax(300px, .8fr); }
.dashboard-panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--color-line);
  border-radius: 16px;
  background: var(--color-surface);
  box-shadow: var(--ui-shadow-sm);
}
.dashboard-panel-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.dashboard-panel-header h2 { margin: 0; font-size: 1rem; font-weight: 820; }
.dashboard-panel-header a,
.dashboard-panel-link { color: var(--color-primary); font-size: .75rem; font-weight: 750; }
.dashboard-chart-legend { display: flex; align-items: center; gap: 12px; color: var(--color-muted); font-size: .66rem; font-weight: 700; }
.dashboard-chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.dashboard-chart-legend i { width: 8px; height: 8px; border-radius: 2px; background: var(--color-primary); }
.dashboard-chart-legend i.submitted { background: var(--color-success); }
.dashboard-activity-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(38px, 1fr));
  gap: 10px;
  min-height: 205px;
  padding: 10px 8px 2px;
  border-radius: 12px;
  background: repeating-linear-gradient(to bottom, transparent 0, transparent 49px, color-mix(in srgb, var(--color-line) 62%, transparent) 50px);
}
.dashboard-activity-day { display: grid; grid-template-rows: 18px 135px 18px 16px; align-items: end; min-width: 0; text-align: center; }
.dashboard-bar-values { color: var(--color-muted); font-size: .65rem; font-weight: 750; }
.dashboard-bar-group { display: flex; align-items: flex-end; justify-content: center; gap: 4px; height: 132px; }
.dashboard-bar { width: min(16px, 34%); height: calc(var(--bar-height) * 1%); min-height: 3px; border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, color-mix(in srgb, var(--color-primary) 76%, white), var(--color-primary)); }
.dashboard-bar.submitted { background: linear-gradient(180deg, color-mix(in srgb, var(--color-success) 68%, white), var(--color-success)); }
.dashboard-activity-day > strong { font-size: .69rem; }
.dashboard-activity-day > small { overflow: hidden; color: var(--color-muted); font-size: .58rem; white-space: nowrap; }

.dashboard-pipeline-panel { display: flex; flex-direction: column; }
.dashboard-pipeline-summary { display: flex; align-items: center; gap: 16px; padding: 5px 0 18px; }
.dashboard-completion-ring {
  width: 94px;
  height: 94px;
  flex: 0 0 94px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--color-success) var(--completion), var(--color-surface-alt) 0);
}
.dashboard-completion-ring::before { content: ""; grid-area: 1/1; width: 70px; height: 70px; border-radius: 50%; background: var(--color-surface); }
.dashboard-completion-ring > div { grid-area: 1/1; z-index: 1; display: grid; text-align: center; }
.dashboard-completion-ring strong { font-size: 1.22rem; line-height: 1; }
.dashboard-completion-ring span { margin-top: 4px; color: var(--color-muted); font-size: .58rem; }
.dashboard-pipeline-copy { display: grid; gap: 5px; }
.dashboard-pipeline-copy strong { font-size: .88rem; }
.dashboard-pipeline-copy span { color: var(--color-muted); font-size: .72rem; }
.dashboard-pipeline-list { display: grid; gap: 14px; }
.dashboard-pipeline-row > div:first-child { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 8px; margin-bottom: 7px; font-size: .73rem; }
.dashboard-pipeline-row b { color: var(--color-muted); }
.dashboard-status-dot { width: 9px; height: 9px; border-radius: 50%; background: #e2a130; }
.dashboard-status-dot.submitted { background: var(--color-success); }
.dashboard-status-dot.applied { background: var(--color-primary); }
.dashboard-status-dot.pending { background: var(--color-warning); }
.dashboard-status-dot.sanctioned { background: var(--color-success); }
.dashboard-status-dot.rejected { background: var(--color-danger); }
.dashboard-progress { height: 7px; overflow: hidden; border-radius: 999px; background: var(--color-surface-alt); }
.dashboard-progress span { display: block; height: 100%; border-radius: inherit; background: #e2a130; }
.dashboard-progress span.submitted { background: var(--color-success); }
.dashboard-progress span.applied { background: var(--color-primary); }
.dashboard-progress span.pending { background: var(--color-warning); }
.dashboard-progress span.sanctioned { background: var(--color-success); }
.dashboard-progress span.rejected { background: var(--color-danger); }
.dashboard-panel-link { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 18px; }

.dashboard-recent-panel { padding: 0; overflow: hidden; }
.dashboard-recent-panel .dashboard-panel-header { padding: 18px 18px 0; }
.dashboard-table thead th { padding: 10px 14px; font-size: .61rem; }
.dashboard-table tbody td { padding: 13px 14px; font-size: .76rem; }
.dashboard-table td > strong { display: block; }
.dashboard-table td small { display: block; margin-top: 2px; color: var(--color-muted); font-size: .67rem; }
.dashboard-row-action { display: grid; place-items: center; width: 30px; height: 30px; margin-left: auto; border: 1px solid var(--color-line); border-radius: 8px; color: var(--color-primary); }
.dashboard-row-action:hover { border-color: var(--color-primary); background: var(--color-accent-soft); }
.dashboard-agent-count { padding: 5px 8px; border-radius: 999px; background: var(--color-success-bg); color: var(--color-success); font-size: .62rem; font-weight: 800; }
.dashboard-agent-list { display: grid; gap: 2px; }
.dashboard-agent-row { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid color-mix(in srgb, var(--color-line) 70%, transparent); }
.dashboard-agent-row:last-child { border-bottom: 0; }
.dashboard-agent-avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--color-accent-soft); color: var(--color-primary); font-weight: 850; }
.dashboard-agent-name { display: grid; min-width: 0; }
.dashboard-agent-name strong { overflow: hidden; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-agent-name small { margin-top: 3px; color: var(--color-muted); font-size: .65rem; }
.dashboard-agent-rate { color: var(--color-success); font-size: .78rem; }
.dashboard-empty { display: grid; place-items: center; min-height: 150px; color: var(--color-muted); text-align: center; }
.dashboard-empty i { font-size: 1.6rem; color: var(--color-primary); }
.dashboard-empty p { margin: 8px 0 0; font-size: .78rem; }

@media (max-width: 1199.98px) {
  .dashboard-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-main-grid,
  .dashboard-detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 767.98px) {
  .dashboard-hero { align-items: stretch; flex-direction: column; }
  .dashboard-primary-action { justify-content: center; }
  .dashboard-kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .dashboard-kpi { min-height: 138px; padding: 14px; }
  .dashboard-kpi-label { font-size: .7rem; }
  .dashboard-activity-chart { gap: 4px; padding-inline: 0; }
  .dashboard-chart-legend { display: none; }
  .dashboard-table th:nth-child(3),
  .dashboard-table td:nth-child(3) { display: none; }
}

@media (max-width: 479.98px) {
  .dashboard-kpi-grid { grid-template-columns: 1fr; }
  .dashboard-activity-day > small { display: none; }
  .dashboard-activity-day { grid-template-rows: 18px 135px 18px; }
  .dashboard-table th:nth-child(4),
  .dashboard-table td:nth-child(4) { display: none; }
}

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

/* Compact portal density --------------------------------------------------
   Both workspaces use the same sizing rhythm so more of every workflow is
   visible without relying on browser zoom. */
body.agent-portal,
body.admin-portal {
  font-size: .875rem;
  line-height: 1.35;
}
.agent-portal .main-content,
.admin-portal .main-content { min-width: 0; }
.agent-portal .main-content h1,
.admin-portal .main-content h1,
.agent-portal .main-content .h1,
.admin-portal .main-content .h1 { font-size: 1.65rem; }
.agent-portal .main-content h2,
.admin-portal .main-content h2,
.agent-portal .main-content .h2,
.admin-portal .main-content .h2 { font-size: 1.2rem; }
.agent-portal .main-content h3,
.admin-portal .main-content h3,
.agent-portal .main-content .h3,
.admin-portal .main-content .h3 { font-size: 1rem; }
.agent-portal .row.g-3,
.admin-portal .row.g-3 {
  --bs-gutter-x: .85rem;
  --bs-gutter-y: .72rem;
}
.agent-portal .section-card,
.admin-portal .section-card {
  padding: 13px;
  margin-bottom: 11px;
  border-radius: 13px;
}
.agent-portal .application-card,
.admin-portal .application-card { padding: 12px; border-radius: 12px; }

.agent-portal .gold-total-panel .row { --bs-gutter-y: .2rem; }
.agent-portal .gold-total-panel small { font-size: .65rem; line-height: 1.1; }
.agent-portal .gold-total-panel strong { display: block; font-size: .86rem; line-height: 1.15; white-space: nowrap; }
.agent-portal .gold-item-summary { padding: 9px !important; }
.agent-portal .gold-item-summary small { font-size: .65rem; }
.agent-portal .gold-item-summary [data-summary-type] { font-size: .9rem; line-height: 1.1; }
.agent-portal .gold-item-summary [data-summary-weight],
.agent-portal .gold-item-summary [data-summary-value] { font-size: .8rem; line-height: 1.1; }
.agent-portal .gold-item-summary .btn { min-height: 30px; padding: .2rem .45rem; font-size: .72rem; }
.agent-portal .form-label,
.admin-portal .form-label { margin-bottom: 4px; font-size: .74rem; }
.agent-portal .form-control,
.admin-portal .form-control,
.agent-portal .form-select,
.admin-portal .form-select,
.agent-portal .bounded-select-trigger,
.admin-portal .bounded-select-trigger {
  min-height: 40px;
  padding: .42rem 2.25rem .42rem .65rem;
  border-radius: 8px;
  font-size: .82rem;
}
.agent-portal textarea.form-control,
.admin-portal textarea.form-control { min-height: 64px; }
.agent-portal .form-text,
.admin-portal .form-text,
.agent-portal small,
.admin-portal small { line-height: 1.25; }
.agent-portal .btn,
.admin-portal .btn {
  --bs-btn-padding-y: .38rem;
  --bs-btn-padding-x: .72rem;
  --bs-btn-font-size: .8rem;
  --bs-btn-border-radius: 8px;
}
.agent-portal .touch,
.admin-portal .touch { min-height: 40px; }
.agent-portal .table thead th,
.admin-portal .table thead th { padding: 8px 10px; font-size: .62rem; }
.agent-portal .table tbody td,
.admin-portal .table tbody td { padding: 9px 10px; font-size: .8rem; }

/* Customer register: compact, scan-friendly layout modelled on the operational list. */
.customer-list-page-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.customer-list-page-heading .btn { flex: none; }
.customer-list-heading-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.customer-heading-count { display: inline-grid; min-width: 20px; height: 20px; place-items: center; margin-left: 7px; padding-inline: 5px; border-radius: 999px; background: var(--color-accent-soft); color: var(--color-primary); font-size: .62rem; font-weight: 850; }
.customer-list-heading-actions .btn.active .customer-heading-count { background: color-mix(in srgb, var(--color-primary) 13%, #fff); }
.customer-list-surface { overflow: hidden; }
.customer-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
}
.customer-page-size,
.customer-list-search { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: .76rem; color: var(--color-muted); }
.customer-page-size .form-select { width: 66px; }
.customer-page-size .bounded-select { width: 66px; min-width: 66px; }
.customer-page-size .bounded-select-trigger { width: 100%; padding-right: 28px; }
.customer-page-size .bounded-select-trigger::after { right: 10px; }
.customer-page-size .bounded-select-menu { top: auto; bottom: calc(100% + 5px); }
.customer-list-search { position: relative; }
.customer-list-search-icon { position: absolute; z-index: 2; top: 50%; left: 11px; display: grid; place-items: center; color: var(--color-muted); pointer-events: none; transform: translateY(-50%); }
.customer-list-search .form-control { width: min(330px, 36vw); padding-left: 34px; }
.customer-date-range { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.customer-date-field { display: flex; align-items: center; gap: 7px; margin: 0; color: var(--color-muted); font-size: .72rem; white-space: nowrap; }
.customer-date-field .date-input-shell { width: 150px; }
.customer-date-field .form-control { min-height: 36px; }
.customer-list-scroll { padding: 0 16px 16px; }
.admin-portal .customer-list-table { min-width: 1180px; border-collapse: separate; border-spacing: 0; }
.admin-portal .customer-list-table thead th {
  padding: 10px 9px;
  border: 0;
  background: var(--color-primary);
  color: #fff;
  font-size: .61rem;
  font-weight: 800;
  letter-spacing: .025em;
  text-transform: none;
  white-space: nowrap;
}
.admin-portal .customer-list-table tbody td { padding: 10px 9px; border-color: var(--color-line); font-size: .73rem; vertical-align: middle; }
.admin-portal .customer-list-table .clickable-row > td { cursor: pointer; }
.admin-portal .customer-list-table tbody tr:nth-child(odd) > * { background: color-mix(in srgb, var(--color-canvas) 62%, var(--color-surface)); }
.admin-portal .customer-list-table tbody tr:hover > *,
.admin-portal .customer-list-table tbody tr:focus-visible > * { background: var(--color-accent-soft); }
.customer-list-photo {
  width: 48px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid var(--color-line);
  border-radius: 7px;
  object-fit: cover;
  background: var(--color-surface-alt);
}
.customer-list-photo-placeholder { color: var(--color-primary); font-size: .78rem; font-weight: 850; }
.customer-cid { color: var(--color-primary); font-weight: 850; text-decoration: none; }
.customer-cid:hover { text-decoration: underline; }
.customer-name-cell { min-width: 150px; font-weight: 700; }
.customer-address-cell { min-width: 180px; max-width: 250px; white-space: normal; line-height: 1.35; }
.customer-sn { color: var(--color-muted); font-variant-numeric: tabular-nums; }
.customer-list-action { display: inline-grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; color: var(--color-primary); font-size: .92rem; }
.customer-list-action:hover { background: var(--color-accent-soft); color: var(--color-primary); }
.customer-list-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 16px 16px; }
.customer-list-footer form { margin: 0; }
.customer-list-pagination .pagination { margin-bottom: 0; }
.customer-draft-scroll { padding-top: 16px; }
.admin-portal .customer-draft-table { min-width: 860px; }
.customer-draft-list-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 16px; border-bottom: 1px solid var(--color-line); }
.customer-draft-list-summary > div { display: flex; align-items: center; gap: 11px; }
.customer-draft-list-summary h2 { margin: 0; font-size: .92rem; }
.customer-draft-list-summary p { margin: 2px 0 0; color: var(--color-muted); font-size: .7rem; }
.customer-draft-total { padding: 6px 10px; border-radius: 999px; background: var(--color-accent-soft); color: var(--color-primary); font-size: .68rem; font-weight: 850; }
.customer-draft-code { display: inline-flex; align-items: center; width: fit-content; padding: 5px 8px; border-radius: 7px; background: var(--color-surface-alt); color: var(--color-primary); font-size: .7rem; font-weight: 850; letter-spacing: .025em; }
.customer-draft-actions { display: flex; align-items: center; justify-content: center; gap: 7px; }
.customer-draft-actions form { margin: 0; }

/* End-to-end standalone customer creation. */
.customer-create-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.customer-draft-meta { display: flex; align-items: center; gap: 9px; }
.customer-draft-save-state { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 5px 9px; border: 1px solid var(--color-line); border-radius: 8px; background: var(--color-surface); color: var(--color-muted); font-size: .68rem; font-weight: 750; }
.customer-draft-save-state.is-saving { color: var(--color-primary); }
.customer-draft-save-state.is-saved { color: #16825d; }
.customer-draft-save-state.is-error { border-color: color-mix(in srgb, #b42318 28%, var(--color-line)); color: #b42318; }
.customer-draft-file-note { display: flex; align-items: flex-start; gap: 7px; margin: 12px 0 0; color: var(--color-muted); font-size: .7rem; }
.customer-create-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); align-items: start; gap: 18px; }
.customer-create-rail { position: sticky; top: 82px; display: grid; gap: 6px; padding: 14px; border: 1px solid var(--color-line); border-radius: 14px; background: var(--color-surface); box-shadow: var(--shadow-sm); }
.customer-create-rail > strong { padding: 5px 8px 9px; font-size: .74rem; letter-spacing: .055em; text-transform: uppercase; color: var(--color-muted); }
.customer-create-rail a { display: flex; align-items: center; gap: 9px; padding: 9px; border-radius: 9px; color: var(--color-text); font-size: .78rem; font-weight: 750; text-decoration: none; }
.customer-create-rail a span { width: 24px; height: 24px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: var(--color-surface-alt); color: var(--color-primary); font-size: .7rem; }
.customer-create-rail a:hover,
.customer-create-rail a.active { background: var(--color-accent-soft); color: var(--color-primary); }
.customer-create-rail a.active span { background: var(--color-primary); color: #fff; }
.customer-create-sections { display: grid; gap: 16px; min-width: 0; }
.customer-create-section { scroll-margin-top: 86px; padding: 20px; }
.customer-create-section > header { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--color-line); }
.customer-create-section > header small { display: block; margin-bottom: 2px; color: var(--color-primary); font-size: .62rem; font-weight: 850; letter-spacing: .09em; }
.customer-create-section > header h2 { margin: 0; font-size: 1.02rem; }
.customer-section-icon { width: 40px; height: 40px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 11px; background: var(--color-accent-soft); color: var(--color-primary); font-size: 1rem; }
.customer-create-section > h3,
.customer-subsection-heading h3,
.customer-repeat-heading h3 { margin: 21px 0 12px; font-size: .82rem; font-weight: 850; color: var(--color-text); }
.customer-subsection-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; }
.customer-subsection-heading .form-check { margin-top: 12px; }
.customer-document-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.customer-document-grid .identity-upload-card { padding: 14px; }
.customer-document-grid small { display: block; margin-top: 6px; color: var(--color-muted); font-size: .68rem; }
.customer-repeat-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.customer-repeat-heading h3 { margin-bottom: 2px; }
.customer-repeat-heading p { margin: 0; color: var(--color-muted); font-size: .72rem; }
.customer-repeat-list { display: grid; gap: 10px; margin-top: 11px; }
.customer-repeat-card { padding: 14px; border: 1px solid var(--color-line); border-radius: 12px; background: var(--color-surface-alt); }
.customer-repeat-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.customer-repeat-card-head strong { font-size: .78rem; }
.customer-create-actions { position: sticky; bottom: 12px; z-index: 5; padding: 13px 15px; border: 1px solid var(--color-line); border-radius: 13px; box-shadow: 0 8px 28px rgb(15 40 80 / .12); }
@media (max-width: 767.98px) {
  .customer-list-page-heading { align-items: stretch; flex-direction: column; }
  .customer-list-heading-actions { align-items: stretch; flex-direction: column; }
  .customer-list-page-heading .btn { width: 100%; }
  .customer-list-toolbar { align-items: stretch; flex-direction: column; }
  .customer-list-search { width: 100%; }
  .customer-list-search .form-control { width: 100%; }
  .customer-date-range { justify-content: stretch; }
  .customer-date-field { flex: 1; align-items: stretch; flex-direction: column; gap: 4px; }
  .customer-date-field .date-input-shell { width: 100%; }
  .customer-list-scroll { padding-inline: 10px; }
  .customer-list-footer { align-items: flex-start; flex-direction: column; padding-inline: 10px; }
  .customer-draft-list-summary { align-items: flex-start; flex-direction: column; }
  .customer-create-heading { align-items: stretch; flex-direction: column; }
  .customer-draft-meta { align-items: flex-start; flex-direction: column; }
  .customer-create-layout { grid-template-columns: 1fr; }
  .customer-create-rail { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .customer-create-rail > strong { grid-column: 1 / -1; }
  .customer-document-grid { grid-template-columns: 1fr; }
  .customer-create-section { padding: 15px; }
  .customer-create-actions { bottom: 6px; }
}
.agent-portal .badge,
.admin-portal .badge { padding: .34rem .5rem; font-size: .59rem; }

/* Mandatory post-login device permission gate for agents. */
.agent-permission-page { min-height: 100vh; background: var(--color-canvas); }
.agent-permission-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.agent-permission-card { width: min(100%, 520px); padding: 34px; text-align: center; }
.agent-permission-lock { width: 58px; height: 58px; display: grid; place-items: center; margin: 22px auto 16px; border-radius: 18px; background: var(--color-accent-soft); color: var(--color-primary); font-size: 1.55rem; }
.agent-permission-list { display: grid; gap: 10px; text-align: left; }
.agent-permission-item { display: grid; grid-template-columns: 42px minmax(0, 1fr) 24px; align-items: center; gap: 12px; padding: 13px 14px; border: 1px solid var(--color-line); border-radius: 12px; background: var(--color-surface-alt); }
.agent-permission-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 10px; background: var(--color-surface); color: var(--color-primary); font-size: 1.05rem; }
.agent-permission-item strong, .agent-permission-item small { display: block; }
.agent-permission-item small { margin-top: 2px; color: var(--color-muted); }
.agent-permission-state { color: var(--color-muted); font-size: 1.1rem; }
.agent-permission-item[data-state="granted"] { border-color: color-mix(in srgb, #16825d 35%, var(--color-line)); background: color-mix(in srgb, #dff5eb 54%, var(--color-surface)); }
.agent-permission-item[data-state="granted"] .agent-permission-state { color: #16825d; }
.agent-permission-item[data-state="denied"] .agent-permission-state { color: #b42318; }
.agent-permission-item[data-state="unavailable"] .agent-permission-state { color: var(--color-muted); }
@media (max-width: 575.98px) {
  .agent-permission-page { min-height: 100svh; }
  .agent-permission-wrap { min-height: 100svh; place-items: start center; padding: 8px; }
  .agent-permission-card { width: min(100%, 430px); padding: 14px 14px 12px; border-radius: 14px; }
  .agent-permission-card .brand-logo-login { height: 50px; max-width: 150px; margin-inline: auto; }
  .agent-permission-lock { width: 40px; height: 40px; margin: 7px auto 7px; border-radius: 12px; font-size: 1.05rem; }
  .agent-permission-card .text-gold { margin-bottom: 3px !important; font-size: .72rem; }
  .agent-permission-card h1 { margin-bottom: 5px; font-size: 1.35rem; line-height: 1.15; }
  .agent-permission-card h1 + p { margin-bottom: 11px !important; font-size: .82rem; line-height: 1.35; }
  .agent-permission-list { gap: 7px; }
  .agent-permission-item { grid-template-columns: 34px minmax(0, 1fr) 20px; gap: 9px; padding: 8px 10px; border-radius: 10px; }
  .agent-permission-icon { width: 34px; height: 34px; border-radius: 8px; font-size: .9rem; }
  .agent-permission-item strong { font-size: .88rem; line-height: 1.2; }
  .agent-permission-item small { font-size: .75rem; line-height: 1.25; }
  .agent-permission-state { font-size: .95rem; }
  .agent-permission-card [data-permission-error] { margin-top: 9px !important; padding: 9px 10px; font-size: .78rem; line-height: 1.3; }
  .agent-permission-card [data-permission-form] .btn { min-height: 42px; margin-top: 10px !important; padding-block: 7px; font-size: .88rem; }
  .agent-permission-card [data-permission-form] + p { margin-top: 8px !important; font-size: .72rem; line-height: 1.3; }
  .agent-permission-card > form:last-child { margin-top: 7px !important; font-size: .78rem; }
}
.agent-portal .alert,
.admin-portal .alert { padding: .7rem .85rem; margin-bottom: .75rem; }
.agent-portal .loan-head,
.admin-portal .loan-head { padding: 11px 14px; margin-bottom: 11px; border-radius: 13px; }
.agent-portal .participant-heading,
.admin-portal .participant-heading { gap: 10px; margin-bottom: 12px; }
.agent-portal .participant-heading h2,
.admin-portal .participant-heading h2 { font-size: 1.18rem; margin-block: 1px 3px; }
.borrower-selection-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}
.borrower-selection-column { min-width: 0; }
.borrower-selection-grid .applicant-choice-heading { margin-top: 0; }
.borrower-selection-grid .borrower-picker-card { width: 100%; height: 100%; min-height: 136px; margin-bottom: 0; }
.borrower-selection-grid #co-applicants { height: 100%; }
.borrower-selection-grid .selected-customer-card { width: 100%; height: 100%; margin-bottom: 0; }
.selected-co-applicant-list { display: grid; gap: 14px; height: 100%; }
.selected-co-applicant-list .selected-co-applicant-card:only-child { height: 100%; }
.selected-co-applicant-card { position: relative; padding-top: 28px; }
.selected-co-applicant-copy { min-width: 0; flex: 1; }
.selected-co-applicant-card .linked-customer-label { margin-top: 3px; }
.selected-co-applicant-card .selected-actions form { margin: 0; }
.selected-co-applicant-relationship {
  position: absolute;
  top: 10px;
  right: 14px;
  display: inline-flex;
  max-width: 180px;
  padding: 4px 9px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--color-accent-soft);
  color: var(--color-primary);
  font-size: .66rem;
  font-weight: 800;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.selected-participant-photo {
  width: 72px;
  height: 88px;
  flex: none;
  overflow: hidden;
  border: 3px solid var(--color-accent-soft);
  border-radius: 14px;
  background: var(--color-accent-soft);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--color-primary) 14%, transparent);
}
.selected-participant-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.selected-participant-photo > span { display: grid; width: 100%; height: 100%; place-items: center; color: var(--color-primary); font-size: 1.4rem; font-weight: 850; }
.borrower-selection-continue { margin-top: 14px; }
.borrower-picker-disabled { opacity: .72; }
.borrower-selection-grid .co-customer-result {
  grid-template-columns: 42px minmax(110px, 1fr);
}
.borrower-selection-grid .co-customer-result .co-relationship,
.borrower-selection-grid .co-customer-result > .btn { grid-column: 1 / -1; }
@media (max-width: 900px) {
  .borrower-selection-grid { grid-template-columns: 1fr; }
  .selected-participant-photo { width: 60px; height: 74px; }
}
.agent-portal .section-heading,
.admin-portal .section-heading { margin: 17px 0 9px; gap: 10px; }
.agent-portal .identity-upload-card,
.admin-portal .identity-upload-card { padding: 11px; border-radius: 10px; }
.agent-portal input[type="file"].form-control {
  min-height: 40px;
  font-size: .76rem;
}
.agent-portal input[type="file"].form-control::file-selector-button,
.agent-portal input[type="file"].form-control::-webkit-file-upload-button {
  min-height: 38px;
  margin-right: .55rem;
  padding-inline: .7rem;
  font-size: .75rem;
}
.agent-portal .stat-card,
.admin-portal .stat-card { padding: 12px; }
.agent-portal .stat-card > i,
.admin-portal .stat-card > i { width: 34px; height: 34px; margin-bottom: 9px; border-radius: 9px; }
.agent-portal .stat-card .number,
.admin-portal .stat-card .number { font-size: 1.42rem; margin-bottom: 4px; }
.agent-portal .sticky-actions,
.admin-portal .sticky-actions { padding-block: 8px; }

@media (min-width: 992px) {
  .admin-portal,
  .agent-portal {
    --portal-sidebar-width: 220px;
    --portal-topbar-height: 56px;
  }
  .admin-portal .main-content,
  .agent-portal .main-content { padding: 16px 18px 28px; }
  .admin-portal .admin-topbar-brand { padding: 5px 13px; }
  .admin-portal .admin-topbar-brand .brand-logo { max-width: 120px; max-height: 36px; }
  .admin-portal .admin-workspace-copy { padding-inline: 15px; }
  .admin-portal .admin-workspace-copy small { font-size: .52rem; }
  .admin-portal .admin-workspace-copy strong { margin-top: 2px; font-size: .74rem; }
  .admin-portal .admin-topbar-actions { gap: 7px; padding-right: 12px; }
  .admin-portal .admin-time-chip { min-height: 30px; padding-inline: 9px; font-size: .62rem; }
  .admin-portal .admin-profile-toggle { min-height: 38px; gap: 7px; }
  .admin-portal .admin-profile-toggle .profile-avatar { width: 30px; height: 30px; font-size: .74rem; }
  .admin-portal .admin-profile-toggle .profile-copy strong { font-size: .74rem; }
  .admin-portal .admin-profile-toggle .profile-copy small { font-size: .62rem; }
  .admin-sidebar-scroll { padding: 10px 8px 16px; }
  .admin-portal .admin-sidebar .sidebar-eyebrow { margin-bottom: 5px; font-size: .52rem; }
  .admin-portal .admin-sidebar .sidebar-eyebrow:not(:first-child) { margin-top: 10px; }
  .admin-portal .admin-sidebar .sidebar-nav { gap: 4px; }
  .admin-portal .admin-sidebar .sidebar-nav > a,
  .admin-portal .admin-sidebar .sidebar-nav > .nav-placeholder,
  .admin-portal .admin-sidebar .sidebar-nav > form .sidebar-action,
  .admin-portal .admin-sidebar .sidebar-nav-toggle {
    min-height: 34px;
    padding: 3px 6px;
    border-radius: 8px;
    font-size: .7rem;
  }
  .admin-portal .admin-sidebar .sidebar-nav > a > i,
  .admin-portal .admin-sidebar .sidebar-nav > .nav-placeholder > i,
  .admin-portal .admin-sidebar .sidebar-nav > form .sidebar-action > i,
  .admin-portal .admin-sidebar .sidebar-nav-toggle > span > i {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
    font-size: .7rem;
  }
  .admin-portal .admin-sidebar .sidebar-subnav { gap: 2px; margin-block: 3px 1px; padding: 4px; }
  .admin-portal .admin-sidebar .sidebar-subnav a,
  .admin-portal .admin-sidebar .sidebar-subnav .nav-placeholder {
    min-height: 26px;
    padding: 5px 6px 5px 24px;
    font-size: .64rem;
  }
  .admin-portal .admin-sidebar .sidebar-subnav a::before,
  .admin-portal .admin-sidebar .sidebar-subnav .nav-placeholder::before { left: 11px; }
  .agent-portal .sticky-actions { left: var(--portal-sidebar-width); padding-inline: 18px; }

  .admin-dashboard { gap: 10px; }
  .dashboard-hero { gap: 15px; padding-bottom: 1px; }
  .dashboard-hero h1 { font-size: 1.55rem; }
  .dashboard-subtitle { margin-top: 3px; font-size: .76rem; }
  .dashboard-primary-action { min-height: 36px; gap: 7px; padding-inline: 12px; }
  .dashboard-kpi-grid { gap: 9px; }
  .dashboard-kpi { min-height: 104px; padding: 11px; border-radius: 12px; }
  .dashboard-kpi-icon { width: 30px; height: 30px; border-radius: 8px; }
  .dashboard-kpi-label { font-size: .69rem; }
  .dashboard-kpi > strong { margin-top: 8px; font-size: 1.38rem; }
  .dashboard-kpi > small { margin-top: 5px; font-size: .63rem; }
  .dashboard-main-grid,
  .dashboard-detail-grid { gap: 9px; }
  .dashboard-panel { padding: 12px; border-radius: 12px; }
  .dashboard-panel-header { gap: 10px; margin-bottom: 10px; }
  .dashboard-activity-chart { min-height: 154px; gap: 7px; padding-top: 5px; }
  .dashboard-activity-day { grid-template-rows: 14px 96px 16px 13px; }
  .dashboard-bar-group { height: 94px; }
  .dashboard-pipeline-summary { gap: 11px; padding-bottom: 11px; }
  .dashboard-completion-ring { width: 72px; height: 72px; flex-basis: 72px; }
  .dashboard-completion-ring::before { width: 54px; height: 54px; }
  .dashboard-pipeline-list { gap: 9px; }
  .dashboard-panel-link { padding-top: 11px; }
  .dashboard-recent-panel .dashboard-panel-header { padding: 12px 12px 0; }
  .dashboard-agent-row { grid-template-columns: 30px minmax(0, 1fr) auto; gap: 8px; padding: 7px 0; }
  .dashboard-agent-avatar { width: 30px; height: 30px; border-radius: 8px; }

  .customer-record-header { padding: 11px 13px; gap: 12px; }
  .customer-tabbar { top: var(--portal-topbar-height); padding: 6px 9px; }
  .customer-tab-button { padding: 6px 9px; font-size: .72rem; }
  .customer-tab-content { padding: 11px; }
  .customer-panel-grid,
  .customer-details-grid { gap: 10px; }
  .customer-data-panel { padding: 10px; border-radius: 11px; }
  .detail-item { padding: 7px 0; }
  .kyc-card { padding: 12px; border-radius: 12px; }
  .kyc-card-header { padding-bottom: 8px; }
  .kyc-fact { padding: 7px 0; }
  .loan-overview-stat { padding: 10px; }
  .master-content { gap: 18px; padding: 16px; }
  .master-title { padding: 14px 18px; }
  .color-card { padding: 12px; }
}

@media (max-width: 991.98px) {
  body.agent-portal,
  body.admin-portal { font-size: .84rem; }
  .admin-portal .topbar { height: 56px; }
  .agent-portal .main-content,
  .admin-portal .main-content { padding: 12px 10px 78px; }
  .agent-portal .main-content { padding-bottom: 24px; }
  .agent-portal .main-content.with-sticky-actions { padding-bottom: 145px; }
  .agent-portal .section-card,
  .admin-portal .section-card { padding: 11px; border-radius: 12px; }
  .agent-portal .form-control,
  .admin-portal .form-control,
  .agent-portal .form-select,
  .admin-portal .form-select,
  .agent-portal .bounded-select-trigger,
  .admin-portal .bounded-select-trigger { min-height: 40px; }
  .bottom-nav-item { min-height: 58px; padding-block: 5px 4px; }
  .agent-portal .sticky-actions { bottom: 0; }
}

@media (max-width: 430px) {
  .dashboard-welcome-row h1 { font-size: 1.42rem; }
  .dashboard-apply-action { min-width: 0; min-height: 40px; padding-inline: 12px; font-size: .78rem; }
}

/* Keep the short applicant fields in paired mobile rows. */
.mobile-pair { min-width: 0; }
@media (max-width: 767.98px) {
  .mobile-pair > .form-label,
  .mobile-pair .conditional-split-field .form-label {
    display: flex;
    align-items: flex-end;
    min-height: 2.2em;
    margin-bottom: 4px;
    white-space: normal;
    line-height: 1.1;
    font-size: .69rem;
  }
  .mobile-pair .conditional-split-field { --bs-gutter-x: .4rem; }
  .mobile-pair .form-control,
  .mobile-pair .form-select { padding-inline: .5rem; }
  .mobile-pair .date-input-control { padding-right: 2.35rem; }
  .mobile-pair .date-calendar-button { width: 2.35rem; }
}

/* Loan workflow header and application-stage progress tracker. */
.loan-workflow-shell { margin-bottom: 20px; filter: drop-shadow(0 12px 24px color-mix(in srgb, var(--color-sidebar) 12%, transparent)); }
.agent-portal .loan-workflow-shell .loan-head {
  position: relative;
  min-height: 92px;
  margin: 0;
  padding: 18px 24px;
  overflow: hidden;
  border-radius: 20px 20px 0 0;
  box-shadow: none;
}
.loan-workflow-shell .loan-head::before,
.loan-workflow-shell .loan-head::after { content: ""; position: absolute; border-radius: 50%; background: color-mix(in srgb, var(--color-primary) 20%, transparent); pointer-events: none; }
.loan-workflow-shell .loan-head::before { width: 190px; height: 190px; right: -45px; top: -115px; }
.loan-workflow-shell .loan-head::after { display: none; }
.loan-head-top { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.loan-workflow-shell .loan-head-title-row { flex: 1 1 auto; min-width: 0; gap: 14px; }
.loan-workflow-shell .loan-head-back { width: 44px; height: 44px; flex-basis: 44px; font-size: 1.2rem; border-width: 2px; }
.loan-status-badge { padding: .4rem .68rem; font-size: .62rem; letter-spacing: .035em; }
.loan-head-info { position: relative; z-index: 1; display: flex; align-items: stretch; min-width: 0; margin: 0; }
.loan-head-field { display: grid; align-content: center; min-width: 165px; padding-right: 22px; }
.loan-head-field + .loan-head-field { min-width: 165px; padding-left: 22px; border-left: 1px solid color-mix(in srgb, var(--color-inverse) 26%, transparent); }
.loan-head-field small { color: color-mix(in srgb, var(--color-inverse) 68%, transparent); font-size: .76rem; }
.loan-head-field strong { margin-top: 2px; color: var(--color-inverse); font-size: 1.28rem; line-height: 1.05; letter-spacing: .015em; }
.loan-head-date-field strong { font-size: .98rem; }
.loan-progress-panel { padding: 12px 20px 10px; border: 1px solid var(--color-line); border-top: 0; border-radius: 0 0 20px 20px; background: var(--color-surface); }
.loan-progress-scroll { overflow: visible; }
.loan-progress-steps { display: grid; grid-template-columns: repeat(var(--loan-step-count), minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
.loan-progress-step { position: relative; z-index: 0; display: grid; justify-items: center; min-width: 0; text-align: center; }
.loan-progress-step::before { content: ""; position: absolute; z-index: 0; top: 15px; right: calc(50% + 17px); width: calc(100% - 34px); height: 3px; background: #c7ccd4; }
.loan-progress-step:first-child::before { display: none; }
.loan-progress-step.is-complete::before { background: var(--color-success); }
.loan-progress-step.is-active::before { background: var(--color-primary); }
.loan-progress-marker { position: relative; z-index: 1; width: 34px; height: 34px; display: grid; place-items: center; border: 3px solid #bbc1ca; border-radius: 50%; background: var(--color-surface); color: var(--color-inverse); font-size: .94rem; }
.loan-progress-marker > span { width: 10px; height: 10px; border-radius: 50%; background: transparent; }
.loan-progress-step.is-complete .loan-progress-marker { border-color: var(--color-success); background: var(--color-success); }
.loan-progress-step.is-active .loan-progress-marker { border-color: var(--color-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 18%, transparent); }
.loan-progress-step.is-active .loan-progress-marker > span { background: var(--color-primary); }
.loan-progress-step > strong { margin-top: 5px; color: var(--color-ink); font-size: .74rem; line-height: 1.1; }
.loan-progress-step > small { margin-top: 1px; color: var(--color-muted); font-size: .64rem; }
.loan-progress-step.is-complete > small { color: var(--color-success); }
.loan-progress-step.is-active > strong,
.loan-progress-step.is-active > small { color: var(--color-primary); }
.loan-step-label-mobile { display: none; }

/* Admin-created loans keep their compact four-step tracker inside the blue header. */
.admin-portal .loan-workflow-shell .loan-head-with-progress {
  margin-bottom: 0;
  padding-block: 9px;
  overflow: hidden;
}
.loan-head-with-progress .loan-head-title-row { flex: 0 1 auto; }
.loan-head-progress { flex: 1 1 560px; min-width: 360px; max-width: 720px; padding-inline: 10px; }
.loan-head-progress .loan-progress-step::before {
  top: 10px;
  right: calc(50% + 12px);
  width: calc(100% - 24px);
  height: 2px;
  background: color-mix(in srgb, var(--color-inverse) 42%, transparent);
}
.loan-head-progress .loan-progress-step.is-complete::before { background: var(--color-success); }
.loan-head-progress .loan-progress-step.is-active::before { background: var(--color-inverse); }
.loan-head-progress .loan-progress-marker {
  width: 22px;
  height: 22px;
  border-width: 2px;
  border-color: color-mix(in srgb, var(--color-inverse) 54%, transparent);
  background: transparent;
  font-size: .66rem;
}
.loan-head-progress .loan-progress-marker > span { width: 6px; height: 6px; }
.loan-head-progress .loan-progress-step.is-complete .loan-progress-marker { border-color: var(--color-success); background: var(--color-success); }
.loan-head-progress .loan-progress-step.is-active .loan-progress-marker {
  border-color: var(--color-inverse);
  background: color-mix(in srgb, var(--color-inverse) 12%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-inverse) 18%, transparent);
}
.loan-head-progress .loan-progress-step.is-active .loan-progress-marker > span { background: var(--color-inverse); }
.loan-head-progress .loan-progress-step > strong,
.loan-head-progress .loan-progress-step.is-active > strong {
  max-width: none;
  margin-top: 3px;
  color: color-mix(in srgb, var(--color-inverse) 72%, transparent);
  font-size: .58rem;
  line-height: 1;
  white-space: nowrap;
}
.loan-head-progress .loan-progress-step.is-complete > strong,
.loan-head-progress .loan-progress-step.is-active > strong { color: var(--color-inverse); }

@media (max-width: 1100px) {
  .loan-head-with-progress .loan-head-top { flex-wrap: wrap; }
  .loan-head-with-progress .loan-head-progress { order: 3; flex-basis: 100%; min-width: 0; max-width: none; width: 100%; padding-top: 6px; }
}

@media (max-width: 600px) {
  .loan-workflow-shell { margin-bottom: 16px; }
  .agent-portal .loan-workflow-shell .loan-head { min-height: 72px; padding: 11px 12px; border-radius: 16px 16px 0 0; }
  .loan-head-top { gap: 7px; }
  .loan-workflow-shell .loan-head-title-row { gap: 8px; }
  .loan-workflow-shell .loan-head-back { width: 34px; height: 34px; flex-basis: 34px; font-size: .95rem; }
  .loan-status-badge { padding: .3rem .46rem; font-size: .48rem; }
  .loan-head-info { flex: 1 1 auto; }
  .loan-head-field { min-width: 0; flex: 1 1 50%; padding-right: 9px; }
  .loan-head-field + .loan-head-field { min-width: 0; padding-left: 9px; }
  .loan-head-field small { font-size: .55rem; white-space: nowrap; }
  .loan-head-field strong { font-size: 1.02rem; }
  .loan-head-date-field strong { font-size: .72rem; white-space: nowrap; }
  .loan-progress-panel { padding: 10px 5px 8px; border-radius: 0 0 16px 16px; }
  .loan-progress-scroll {
    overflow: visible;
    margin: 0;
    padding: 0;
  }
  .loan-progress-steps { min-width: 0; width: 100%; }
  .loan-progress-step::before { top: 11px; right: calc(50% + 12.5px); width: calc(100% - 25px); height: 2px; }
  .loan-progress-marker { width: 25px; height: 25px; border-width: 3px; font-size: .7rem; }
  .loan-progress-marker > span { width: 7px; height: 7px; }
  .loan-progress-step.is-active .loan-progress-marker { box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 18%, transparent); }
  .loan-progress-step > strong { width: 100%; max-width: 52px; margin-top: 6px; font-size: .48rem; line-height: 1.05; white-space: normal; overflow-wrap: anywhere; }
  .loan-step-label-full { display: none; }
  .loan-step-label-mobile { display: inline; }
  .loan-progress-step > small { display: none; }
  .loan-head-with-progress .loan-head-progress { padding-inline: 0; }
  .loan-head-progress .loan-progress-step > strong,
  .loan-head-progress .loan-progress-step.is-active > strong { max-width: 58px; font-size: .46rem; }
}
/* Server-backed loan form autosave feedback. */
.loan-autosave-status {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1090;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .65rem .9rem;
    border: 1px solid var(--border, #dce3ee);
    border-radius: 999px;
    background: var(--surface, #fff);
    color: var(--text, #1f2937);
    box-shadow: 0 8px 24px rgba(15, 23, 42, .14);
    font-size: .82rem;
    font-weight: 600;
}
.loan-autosave-status.is-saved { color: var(--success, #11623f); }
.loan-autosave-status.is-error { color: var(--danger, #b42318); }

/* Loan product catalogue and creation flow. */
.loan-product-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.loan-product-heading h1 { margin: 3px 0 4px; color: var(--color-ink); font-size: 1.75rem; font-weight: 800; letter-spacing: -.025em; }
.loan-product-heading p { max-width: 680px; margin: 0; color: var(--color-muted); }
.page-kicker { color: var(--color-primary); font-size: .67rem; font-weight: 850; letter-spacing: .13em; }
.loan-product-form { display: grid; gap: 14px; }
.loan-product-section { padding: 20px; }
.loan-product-section-heading { display: flex; align-items: center; gap: 11px; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--color-line); }
.loan-product-section-heading h2 { margin: 0 0 2px; color: var(--color-ink); font-size: 1rem; font-weight: 800; }
.loan-product-section-heading p { margin: 0; color: var(--color-muted); font-size: .76rem; }
.loan-product-section-icon { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; background: var(--color-accent-soft); color: var(--color-primary); font-size: 1rem; }
.loan-product-section .form-label { margin-bottom: 6px; color: var(--color-ink); font-size: .76rem; font-weight: 750; }
.loan-product-section .input-group-text { border-color: var(--color-line); background: var(--color-surface-alt); color: var(--color-muted); font-size: .78rem; font-weight: 700; }
.required-mark { color: var(--color-danger); }
.loan-product-pricing-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.loan-product-pricing-card { padding: 15px; border: 1px solid var(--color-line); border-radius: 12px; background: var(--color-surface-alt); }
.loan-product-pricing-card h3 { margin: 0 0 13px; color: var(--color-ink); font-size: .82rem; font-weight: 800; }
.loan-product-choice-group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.loan-product-choice-group label { position: relative; margin: 0; cursor: pointer; }
.loan-product-choice-group input { position: absolute; opacity: 0; pointer-events: none; }
.loan-product-choice-group span { min-height: 42px; display: grid; place-items: center; border: 1px solid var(--color-line); border-radius: 9px; background: var(--color-surface); color: var(--color-muted); font-size: .78rem; font-weight: 750; transition: border-color .15s ease, background .15s ease, color .15s ease; }
.loan-product-choice-group input:checked + span { border-color: var(--color-primary); background: var(--color-accent-soft); color: var(--color-primary); box-shadow: inset 0 0 0 1px var(--color-primary); }
.loan-product-choice-group input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--color-primary) 23%, transparent); outline-offset: 2px; }
.loan-product-form-actions { position: sticky; bottom: 0; z-index: 10; display: flex; align-items: center; justify-content: flex-end; gap: 9px; margin-top: 2px; padding: 12px 0; background: color-mix(in srgb, var(--color-canvas) 92%, transparent); backdrop-filter: blur(8px); }
.loan-product-list-surface { overflow: hidden; }
.loan-product-list-toolbar { display: flex; align-items: center; gap: 8px; padding: 14px; border-bottom: 1px solid var(--color-line); }
.loan-product-search { position: relative; width: min(430px, 100%); margin: 0; }
.loan-product-search i { position: absolute; z-index: 2; left: 13px; top: 50%; translate: 0 -50%; color: var(--color-muted); }
.loan-product-search .form-control { padding-left: 38px; }
.loan-product-table { min-width: 1120px; }
.loan-product-table thead th { padding: 11px 14px; border-bottom-color: var(--color-line); background: var(--color-surface-alt); color: var(--color-muted); font-size: .64rem; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
.loan-product-table tbody td { padding: 13px 14px; border-bottom-color: var(--color-line); color: var(--color-ink); font-size: .75rem; }
.loan-product-table tbody tr:last-child td { border-bottom: 0; }
.loan-product-table tbody tr:hover > * { background: color-mix(in srgb, var(--color-accent-soft) 35%, var(--color-surface)); }
.loan-product-name { display: grid; gap: 2px; min-width: 140px; }
.loan-product-name strong { color: var(--color-ink); font-size: .78rem; }
.loan-product-name span { color: var(--color-muted); font-size: .64rem; }
.loan-product-type-badge { display: inline-flex; padding: 5px 8px; border-radius: 7px; background: var(--color-accent-soft); color: var(--color-primary); font-size: .67rem; font-weight: 800; }
.loan-product-range-divider { margin-inline: 4px; color: var(--color-muted); }
.loan-product-status { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 999px; font-size: .65rem; font-weight: 800; }
.loan-product-status i { font-size: .42rem; }
.loan-product-status.active { background: color-mix(in srgb, var(--color-success) 13%, var(--color-surface)); color: var(--color-success); }
.loan-product-status.inactive { background: var(--color-surface-alt); color: var(--color-muted); }
.loan-product-empty { display: grid; justify-items: center; gap: 5px; padding: 48px 20px; text-align: center; }
.loan-product-empty > span { width: 46px; height: 46px; display: grid; place-items: center; margin-bottom: 5px; border-radius: 13px; background: var(--color-accent-soft); color: var(--color-primary); font-size: 1.15rem; }
.loan-product-empty h2 { margin: 0; color: var(--color-ink); font-size: 1rem; }
.loan-product-empty p { margin: 0 0 9px; color: var(--color-muted); font-size: .76rem; }

@media (max-width: 991.98px) {
  .loan-product-pricing-grid { grid-template-columns: 1fr; }
}

@media (max-width: 767.98px) {
  .loan-product-heading { align-items: stretch; flex-direction: column; }
  .loan-product-heading .btn { width: 100%; }
  .loan-product-heading h1 { font-size: 1.45rem; }
  .loan-product-section { padding: 15px; }
  .loan-product-form-actions { display: grid; grid-template-columns: 1fr 1.5fr; padding-bottom: 4px; }
}

/* Balanced desktop colour editor: normal portal density without page scrolling. */
@media (min-width: 1200px) {
  .master-page .main-content { padding: 13px 16px 16px; }
  .master-page .master-panel { border-radius: 16px; }
  .master-page .master-title { padding: 10px 16px; }
  .master-page .master-title h1 { font-size: 1.35rem; line-height: 1.15; }
  .master-page .master-tabs { gap: 6px; padding: 7px 14px; }
  .master-page .master-tab { padding: 7px 15px; border-radius: 8px; font-size: .76rem; }
  .master-page .master-portal-tabs { gap: 6px; padding: 8px 16px 0; }
  .master-page .master-portal-tab { padding: 8px 13px; border-radius: 9px 9px 0 0; font-size: .75rem; }
  .master-page .master-content {
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 17px;
    padding: 12px 16px 14px;
  }
  .master-page .master-heading { align-items: center; gap: 11px; margin-bottom: 9px; }
  .master-page .master-heading-copy { align-items: center; gap: 10px; }
  .master-page .master-icon { width: 36px; height: 36px; border-radius: 10px; font-size: 1rem; }
  .master-page .master-heading h2 { margin: 0; font-size: 1rem; line-height: 1.15; }
  .master-page .master-heading p { margin-top: 3px; font-size: .7rem; line-height: 1.15; }
  .master-page .master-actions { gap: 6px; }
  .master-page .master-actions .btn { min-height: 34px; padding: 5px 10px; font-size: .72rem; }
  .master-page .master-toolbar { gap: 10px; margin-bottom: 8px; }
  .master-page .palette-switch { padding: 3px; border-radius: 10px; }
  .master-page .palette-switch-button { padding: 6px 13px; border-radius: 7px; font-size: .72rem; }
  .master-page .live-appearance { gap: 7px; font-size: .71rem; }
  .master-page .live-appearance .form-select { width: 86px; min-height: 34px; padding: 4px 26px 4px 8px; font-size: .72rem; }
  .master-page .color-filters { gap: 5px; margin-bottom: 9px; }
  .master-page .color-filter { padding: 5px 10px; border-radius: 8px; font-size: .68rem; line-height: 1.15; }
  .master-page .color-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
  .master-page .color-card {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 78px;
    align-items: center;
    gap: 8px;
    min-height: 51px;
    padding: 7px 8px;
    border-radius: 10px;
  }
  .master-page .color-card-top { display: contents; }
  .master-page .color-swatch { width: 36px; min-width: 36px; height: 36px; border-radius: 9px; }
  .master-page .color-swatch::-webkit-color-swatch { border-radius: 8px; }
  .master-page .color-card-label { display: block; }
  .master-page .color-card-label strong { display: block; overflow: hidden; font-size: .72rem; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
  .master-page .color-category,
  .master-page .color-card p { display: none; }
  .master-page .color-values { min-width: 0; padding: 0; }
  .master-page .color-hex { min-height: 34px; height: 34px; padding: 4px 6px; border-radius: 7px; font-size: .66rem; }
  .master-page .master-preview { padding-left: 16px; }
  .master-page .preview-kicker { margin-bottom: 3px; font-size: .62rem; letter-spacing: .15em; }
  .master-page .master-preview h2 { margin-bottom: 9px; font-size: 1rem; }
  .master-page .sample-app { border-radius: 13px; }
  .master-page .sample-topbar { height: 42px; gap: 7px; padding: 7px 9px; font-size: .72rem; }
  .master-page .sample-logo { width: 27px; height: 27px; border-radius: 7px; }
  .master-page .sample-avatar { width: 25px; height: 25px; }
  .master-page .sample-body { grid-template-columns: 46px 1fr; min-height: 158px; }
  .master-page .sample-sidebar { gap: 6px; padding: 8px 6px; }
  .master-page .sample-sidebar span { height: 23px; border-radius: 6px; }
  .master-page .sample-page { padding: 9px; }
  .master-page .sample-card { padding: 9px; border-radius: 9px; }
  .master-page .sample-line { height: 7px; margin-bottom: 5px; }
  .master-page .sample-selection { margin-top: 7px; padding: 5px; border-radius: 6px; font-size: .64rem; }
  .master-page .sample-badges { gap: 5px; margin-top: 7px; }
  .master-page .sample-badges span { padding: 5px 2px; border-radius: 6px; font-size: .53rem; }
  .master-page .sample-action { margin-top: 7px; padding: 7px; border-radius: 6px; font-size: .68rem; }
  .master-page .preview-note { margin-top: 9px; font-size: .66rem; line-height: 1.25; }
}

/* Loan product detail view. */
.loan-product-table .clickable-row > td { cursor: pointer; }
.loan-product-created-cell { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.loan-product-created-cell i { color: var(--color-primary); font-size: .65rem; }
.loan-product-detail-page { display: grid; gap: 14px; }
.loan-product-detail-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 18px; overflow: hidden; }
.loan-product-detail-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.loan-product-detail-back { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid var(--color-line); border-radius: 9px; background: var(--color-surface); color: var(--color-primary); }
.loan-product-detail-back:hover { border-color: var(--color-primary); background: var(--color-accent-soft); }
.loan-product-detail-icon { width: 46px; height: 46px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 12px; background: var(--color-accent-soft); color: var(--color-primary); font-size: 1.12rem; }
.loan-product-detail-identity h1 { margin: 2px 0 1px; color: var(--color-ink); font-size: 1.42rem; font-weight: 850; letter-spacing: -.025em; }
.loan-product-detail-identity p { margin: 0; color: var(--color-muted); font-size: .7rem; }
.loan-product-detail-chips { display: flex; align-items: stretch; gap: 7px; flex: 0 0 auto; }
.loan-product-detail-chips > span { min-width: 112px; display: grid; align-content: center; gap: 3px; padding: 8px 11px; border: 1px solid var(--color-line); border-radius: 10px; background: var(--color-surface-alt); }
.loan-product-detail-chips small { color: var(--color-muted); font-size: .58rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.loan-product-detail-chips strong { color: var(--color-ink); font-size: .74rem; }
.loan-product-detail-status { display: inline-flex; align-items: center; gap: 6px; color: var(--color-success) !important; }
.loan-product-detail-status i { font-size: .42rem; }
.loan-product-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.loan-product-detail-card { padding: 15px; }
.loan-product-detail-card > header { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; padding-bottom: 10px; border-bottom: 1px solid var(--color-line); }
.loan-product-detail-card > header > span { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; background: var(--color-accent-soft); color: var(--color-primary); }
.loan-product-detail-card h2 { margin: 0 0 2px; color: var(--color-ink); font-size: .9rem !important; font-weight: 800; }
.loan-product-detail-card header p { margin: 0; color: var(--color-muted); font-size: .66rem; }
.loan-product-detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
.loan-product-detail-list-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.loan-product-detail-list > div { min-width: 0; padding: 9px 10px; border-bottom: 1px solid color-mix(in srgb, var(--color-line) 70%, transparent); }
.loan-product-detail-list > div:nth-last-child(-n+2) { border-bottom: 0; }
.loan-product-detail-list-three > div:nth-last-child(-n+3) { border-bottom: 0; }
.loan-product-detail-list .detail-wide { grid-column: 1 / -1; border-bottom: 0; }
.loan-product-detail-list dt { margin: 0 0 4px; color: var(--color-muted); font-size: .61rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.loan-product-detail-list dd { margin: 0; color: var(--color-ink); font-size: .78rem; font-weight: 700; overflow-wrap: anywhere; }
.loan-product-pricing-detail,
.loan-product-record-detail { grid-column: 1 / -1; }
.loan-product-bre-rules { padding: 10px; border-radius: 8px; background: var(--color-surface-alt); font-weight: 550 !important; line-height: 1.5; }

@media (max-width: 991.98px) {
  .loan-product-detail-header { align-items: stretch; flex-direction: column; }
  .loan-product-detail-chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .loan-product-detail-grid { grid-template-columns: 1fr; }
  .loan-product-pricing-detail,
  .loan-product-record-detail { grid-column: auto; }
}

@media (max-width: 575.98px) {
  .loan-product-detail-header { padding: 13px; }
  .loan-product-detail-icon { display: none; }
  .loan-product-detail-identity h1 { font-size: 1.18rem; }
  .loan-product-detail-chips { grid-template-columns: 1fr; }
  .loan-product-detail-list,
  .loan-product-detail-list-three { grid-template-columns: 1fr; }
  .loan-product-detail-list > div { border-bottom: 1px solid color-mix(in srgb, var(--color-line) 70%, transparent) !important; }
  .loan-product-detail-list > div:last-child { border-bottom: 0 !important; }
}

/* Unified form-style loan product record, aligned with the admin workspace. */
.loan-product-record-panel { overflow: hidden; }
.loan-product-record-header { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 14px; border-bottom: 1px solid var(--color-line); }
.loan-product-record-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.loan-product-record-title h1 { margin: 0 0 2px; color: var(--color-ink); font-size: 1.08rem !important; font-weight: 800; }
.loan-product-record-title p { margin: 0; color: var(--color-muted); font-size: .68rem; }
.loan-product-record-title-edit > div { display: grid; gap: 2px; }
.loan-product-title-input { width: min(360px, 42vw); margin: -3px -7px 0; padding: 2px 6px; border: 1px solid var(--color-line); border-radius: 6px; background: var(--color-surface); color: var(--color-ink); font-size: 1.08rem; font-weight: 800; line-height: 1.3; }
.loan-product-code-edit { display: flex; align-items: center; gap: 5px; margin: 0; color: var(--color-muted); font-size: .68rem; }
.loan-product-code-edit input { width: 180px; padding: 1px 5px; border: 1px solid var(--color-line); border-radius: 5px; background: var(--color-surface); color: var(--color-muted); font: inherit; font-weight: 650; }
.loan-product-record-actions { display: flex; align-items: center; gap: 8px; }
.loan-product-record-actions .btn { min-height: 32px; padding: 5px 11px; font-size: .7rem; }
.loan-product-record-status { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: var(--color-success-bg); color: var(--color-success); font-size: .68rem; font-weight: 800; }
.loan-product-record-status i { font-size: .4rem; }
.loan-product-record-status.inactive { background: var(--color-surface-alt); color: var(--color-muted); }
.loan-product-record-tabs { display: flex; gap: 5px; padding: 8px 14px; border-bottom: 1px solid var(--color-line); background: var(--color-surface); }
.loan-product-record-tabs button,
.loan-product-record-tabs > a { display: inline-flex; align-items: center; padding: 6px 12px; border: 1px solid var(--color-line); border-radius: 7px; background: var(--color-surface); color: var(--color-muted); font-size: .7rem; font-weight: 750; }
.loan-product-record-tabs button:hover,
.loan-product-record-tabs > a:hover { border-color: var(--color-primary); color: var(--color-primary); }
.loan-product-record-tabs button.active,
.loan-product-record-tabs > a.active { border-color: var(--color-primary); background: var(--color-primary); color: var(--color-primary-text); }
.loan-product-record-content { display: grid; gap: 13px; padding: 12px 14px 15px; }
.loan-product-field-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px 11px; }
.loan-product-field-grid.two-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.loan-product-readonly-field { display: grid; gap: 5px; min-width: 0; }
.loan-product-readonly-field > span { color: var(--color-ink); font-size: .66rem; font-weight: 750; }
.loan-product-readonly-field > strong { min-height: 36px; display: flex; align-items: center; padding: 7px 10px; border: 1px solid var(--color-line); border-radius: 7px; background: var(--color-surface-alt); color: var(--color-ink); font-size: .72rem; font-weight: 600; overflow-wrap: anywhere; }
.loan-product-readonly-field.money > strong { color: var(--color-success); }
.loan-product-readonly-field.field-wide { grid-column: 1 / -1; }
.loan-product-record-edit-form { margin: 0; }
.loan-product-edit-field { display: grid; gap: 5px; min-width: 0; }
.loan-product-edit-field > label { color: var(--color-ink); font-size: .66rem; font-weight: 750; }
.loan-product-edit-field .form-control,
.loan-product-edit-field .form-select,
.loan-product-edit-field .input-group-text { min-height: 36px; padding: 7px 10px; border-color: var(--color-line); border-radius: 7px; background-color: var(--color-surface) !important; color: var(--color-ink); font-size: .72rem; font-weight: 600; }
.loan-product-edit-field [data-daily-interest-output],
.loan-product-edit-field [data-daily-interest-output] + .input-group-text { background-color: var(--color-surface-alt) !important; }
.loan-product-form .form-control,
.loan-product-form .form-select,
.loan-product-form .input-group-text { background-color: var(--color-surface) !important; }
.loan-product-form [data-daily-interest-output],
.loan-product-form [data-daily-interest-output] + .input-group-text { background-color: var(--color-surface-alt) !important; }
.loan-product-edit-field textarea.form-control { min-height: 63px; resize: vertical; }
.loan-product-edit-field.field-wide { grid-column: 1 / -1; }
.loan-product-record-section { padding: 10px; border: 1px solid var(--color-line); border-radius: 10px; background: var(--color-surface); }
.loan-product-record-section > header { margin-bottom: 9px; }
.loan-product-record-section > header h2 { margin: 0 0 2px; color: var(--color-ink); font-size: .82rem !important; font-weight: 800; }
.loan-product-record-section > header p { margin: 0; color: var(--color-muted); font-size: .64rem; }
.asset-quality-content { gap: 12px; }
.asset-quality-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 13px; border: 1px solid var(--color-line); border-radius: 10px; background: var(--color-surface-alt); }
.asset-quality-heading h2 { margin: 0; color: var(--color-ink); font-size: .8rem; font-weight: 850; }
.asset-quality-heading p { margin: 3px 0 0; color: var(--color-muted); font-size: .64rem; }
.asset-quality-heading > span { padding: 5px 10px; border-radius: 999px; background: var(--color-surface); color: var(--color-ink); font-size: .63rem; font-weight: 800; white-space: nowrap; }
.asset-quality-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; }
.asset-quality-card { min-width: 0; padding: 13px; border: 1px solid var(--color-line); border-radius: 11px; background: var(--color-surface); box-shadow: 0 2px 5px color-mix(in srgb, var(--color-ink) 5%, transparent); }
.asset-quality-badge { display: inline-flex; padding: 4px 9px; border-radius: 999px; background: #fff0df; color: #d86514; font-size: .62rem; font-weight: 850; }
.asset-quality-card.npa .asset-quality-badge { background: var(--color-danger-bg); color: var(--color-danger); }
.asset-quality-card h3 { margin: 11px 0 2px; font-size: .76rem; font-weight: 850; }
.asset-quality-card > p { min-height: 27px; margin: 0 0 10px; color: var(--color-muted); font-size: .64rem; }
.asset-quality-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
.asset-quality-card dl > div { display: grid; gap: 4px; }
.asset-quality-card dt, .asset-quality-inputs label > span { color: var(--color-success); font-size: .56rem; font-weight: 850; letter-spacing: .045em; text-transform: uppercase; }
.asset-quality-card dd { min-height: 34px; margin: 0; padding: 8px 10px; border: 1px solid var(--color-line); border-radius: 7px; background: var(--color-surface-alt); color: var(--color-ink); font-size: .67rem; font-weight: 750; }
.asset-quality-mapping { padding: 12px; border: 1px solid var(--color-line); border-radius: 10px; }
.asset-quality-mapping h2 { margin: 0 0 9px; font-size: .74rem; font-weight: 850; }
.asset-quality-mapping > div { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.asset-quality-mapping span { padding: 9px 10px; border-radius: 8px; background: #fff0df; color: #c45b12; font-size: .65rem; font-weight: 750; }
.asset-quality-mapping span.npa { background: var(--color-danger-bg); color: var(--color-danger); }
.asset-quality-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.asset-quality-inputs label { display: grid; gap: 4px; }
.asset-quality-inputs .form-control { min-height: 35px; padding: 7px 9px; font-size: .68rem; font-weight: 750; }
.loan-product-gl-table-shell { border: 1px solid var(--color-line); border-radius: 8px; overflow: hidden; }
.loan-product-gl-table { min-width: 880px; font-size: .68rem; }
.loan-product-gl-table th { padding: 7px 9px; border-bottom-color: var(--color-line); background: var(--color-surface-alt); color: var(--color-muted); font-size: .61rem; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; }
.loan-product-gl-table td { padding: 8px 9px; border-color: var(--color-line); color: var(--color-ink); vertical-align: middle; }
.loan-product-gl-table tbody tr:last-child td { border-bottom: 0; }
.loan-product-gl-table .form-check-input { width: 15px; height: 15px; margin: 0; cursor: pointer; }
.loan-product-gl-applicability { display: inline-flex; padding: 3px 8px; border-radius: 999px; background: var(--color-surface-alt); font-size: .62rem; font-weight: 750; }
.loan-product-selected-gl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.loan-product-selected-gl > div { padding: 10px; border: 1px solid var(--color-line); border-radius: 10px; background: var(--color-surface); }
.loan-product-selected-gl h2 { margin: 0 0 9px; color: var(--color-ink); font-size: .76rem !important; font-weight: 800; }
.loan-product-gl-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.loan-product-gl-chips > span { padding: 6px 10px; border: 1px solid var(--color-line); border-radius: 7px; background: var(--color-surface-alt); color: var(--color-ink); font-size: .67rem; font-weight: 650; }
.loan-product-gl-chips > .loan-product-gl-empty { color: var(--color-muted); font-weight: 600; }
.loan-product-record-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.loan-product-activity-panel { padding: 14px; }
.loan-product-activity-panel > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 11px; padding-bottom: 10px; border-bottom: 1px solid var(--color-line); }
.loan-product-activity-panel > header h2 { margin: 0 0 2px; color: var(--color-ink); font-size: .9rem !important; font-weight: 800; }
.loan-product-activity-panel > header p { margin: 0; color: var(--color-muted); font-size: .66rem; }
.loan-product-activity-panel > header > span { padding: 5px 8px; border-radius: 999px; background: var(--color-surface-alt); color: var(--color-muted); font-size: .62rem; font-weight: 750; }
.loan-product-log-record-info { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--color-line); }
.loan-product-log-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.loan-product-log-list li { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; padding: 0 0 14px; }
.loan-product-log-list li:not(:last-child)::before { content: ""; position: absolute; top: 34px; bottom: 0; left: 16px; width: 2px; background: var(--color-line); }
.loan-product-log-icon { position: relative; z-index: 1; width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--color-line); border-radius: 9px; background: var(--color-surface-alt); color: var(--color-muted); }
.loan-product-log-icon.created { background: var(--color-success-bg); color: var(--color-success); }
.loan-product-log-icon.updated { background: var(--color-accent-soft); color: var(--color-primary); }
.loan-product-log-copy { padding: 8px 10px; border: 1px solid var(--color-line); border-radius: 9px; background: var(--color-surface-alt); }
.loan-product-log-copy > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.loan-product-log-copy strong { color: var(--color-ink); font-size: .76rem; }
.loan-product-log-copy time { color: var(--color-muted); font-size: .62rem; white-space: nowrap; }
.loan-product-log-copy p { margin: 5px 0 6px; color: var(--color-ink); font-size: .7rem; }
.loan-product-log-copy small { color: var(--color-muted); font-size: .62rem; }
.loan-product-change-list { display: grid !important; gap: 6px !important; margin: 7px 0; }
.loan-product-change-list > div { display: grid; grid-template-columns: minmax(120px, .45fr) minmax(0, 1fr); align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--color-line); border-radius: 7px; background: var(--color-surface); }
.loan-product-change-list > div > span { color: var(--color-muted); font-size: .64rem; font-weight: 800; }
.loan-product-change-list p { display: flex; align-items: center; gap: 8px; margin: 0; min-width: 0; }
.loan-product-change-list del,
.loan-product-change-list ins { min-width: 0; padding: 3px 6px; border-radius: 5px; font-size: .68rem; font-weight: 700; overflow-wrap: anywhere; text-decoration: none; }
.loan-product-change-list del { background: var(--color-danger-bg); color: var(--color-danger); }
.loan-product-change-list ins { background: var(--color-success-bg); color: var(--color-success); }
.loan-product-change-list i { flex: 0 0 auto; color: var(--color-muted); font-size: .7rem; }
.loan-product-log-empty { display: grid; justify-items: center; padding: 42px 20px; text-align: center; }
.loan-product-log-empty i { color: var(--color-primary); font-size: 1.4rem; }
.loan-product-log-empty strong { margin-top: 7px; color: var(--color-ink); }
.loan-product-log-empty p { margin: 3px 0 0; color: var(--color-muted); font-size: .7rem; }

@media (max-width: 991.98px) {
  .loan-product-field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .asset-quality-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .loan-product-record-split { grid-template-columns: 1fr; }
}

@media (max-width: 575.98px) {
  .loan-product-record-header { align-items: flex-start; }
  .loan-product-record-actions { align-items: flex-end; flex-direction: column; }
  .loan-product-title-input { width: min(230px, 55vw); }
  .loan-product-code-edit { align-items: flex-start; flex-direction: column; gap: 1px; }
  .loan-product-code-edit input { width: min(180px, 50vw); }
  .loan-product-record-tabs { overflow-x: auto; }
  .loan-product-record-tabs button,
  .loan-product-record-tabs > a { flex: 0 0 auto; }
  .loan-product-field-grid,
  .loan-product-field-grid.two-column { grid-template-columns: 1fr; }
  .asset-quality-grid, .asset-quality-mapping > div { grid-template-columns: 1fr; }
  .asset-quality-heading { align-items: flex-start; flex-direction: column; }
  .loan-product-log-record-info { grid-template-columns: 1fr; }
  .loan-product-selected-gl { grid-template-columns: 1fr; }
  .loan-product-readonly-field.field-wide { grid-column: auto; }
  .loan-product-edit-field.field-wide { grid-column: auto; }
  .loan-product-log-copy > div { align-items: flex-start; flex-direction: column; gap: 2px; }
  .loan-product-change-list > div { grid-template-columns: 1fr; }
  .loan-product-change-list p { flex-direction: row; align-items: center; }
}

.customer-panel-source { padding: 3px 7px; border-radius: 999px; background: var(--color-accent-soft); color: var(--color-primary); font-size: .62rem; font-weight: 800; letter-spacing: .02em; }
.cibil-active-loans-panel { margin-top: 14px; }

/* Application securities: gold asset breakdown */
.gold-asset-panel {
  overflow: hidden;
  border: 1px solid var(--color-line);
  border-radius: 15px;
  background: var(--color-surface);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--color-ink) 4%, transparent);
}
.gold-asset-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--color-line);
  background: linear-gradient(120deg, color-mix(in srgb, var(--color-primary) 8%, var(--color-surface)), var(--color-surface) 52%);
}
.gold-asset-header-icon {
  flex: 0 0 auto;
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--color-primary) 22%, var(--color-line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--color-primary) 15%, var(--color-surface));
  color: var(--color-primary);
  font-size: 1.15rem;
}
.gold-asset-header > div { min-width: 0; }
.gold-asset-title { flex: 1 1 auto; }
.gold-asset-eyebrow {
  display: block;
  margin-bottom: 2px;
  color: var(--color-primary);
  font-size: .6rem;
  font-weight: 850;
  letter-spacing: .075em;
  text-transform: uppercase;
}
.gold-asset-header h2 { margin: 0; color: var(--color-ink); font-size: 1rem; font-weight: 850; }
.gold-asset-header p { margin: 3px 0 0; color: var(--color-muted); font-size: .68rem; }
.gold-security-summary-table-wrap { overflow-x: auto; border-bottom: 1px solid var(--color-line); background: var(--color-surface-alt); }
.gold-security-summary-table { width: 100%; min-width: 850px; border-collapse: collapse; color: var(--color-ink); table-layout: fixed; }
.gold-security-summary-table th { padding: 10px 14px 5px; border-right: 1px solid var(--color-line); color: var(--color-muted); font-size: .59rem; font-weight: 800; letter-spacing: .045em; text-align: left; text-transform: uppercase; }
.gold-security-summary-table td { padding: 5px 14px 11px; border-right: 1px solid var(--color-line); color: var(--color-ink); font-size: .75rem; font-weight: 800; vertical-align: middle; }
.gold-security-summary-table th:last-child,
.gold-security-summary-table td:last-child { border-right: 0; }
.gold-security-summary-table th:nth-child(5),
.gold-security-summary-table td:nth-child(5) { width: 26%; }
.gold-security-summary-value { color: var(--color-primary) !important; }
.gold-security-letter-cell { display: flex; align-items: center; gap: 8px; min-width: 0; }
.gold-security-letter-cell > span:first-child { min-width: 0; max-width: calc(100% - 69px); flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gold-security-letter-cell > .gold-security-letter-actions { display: flex; flex: 0 0 auto; gap: 5px; overflow: visible; }
.gold-security-letter-cell .btn { flex: 0 0 auto; display: inline-grid; width: 28px; height: 28px; padding: 0; place-items: center; font-size: .7rem; }
.gold-security-summary-table [data-loan-edit-field] { min-width: 0; }
.gold-security-summary-table [data-loan-edit-field] .form-control,
.gold-security-summary-table [data-loan-edit-field] .form-select { min-width: 0; width: 100%; font-weight: 650; }
.gold-security-summary-table [data-loan-edit-field].input-group > .form-control { width: 1%; }
.gold-security-letter-edit { display: grid; gap: 5px; min-width: 0; font-weight: 500; }
.gold-security-letter-edit > small { overflow: hidden; color: var(--color-muted); font-size: .58rem; text-overflow: ellipsis; white-space: nowrap; }
.gold-asset-context small { color: var(--color-muted); font-size: .59rem; font-weight: 750; letter-spacing: .035em; text-transform: uppercase; }
.gold-existing-loan { border-bottom: 1px solid var(--color-line); }
.gold-existing-loan-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 0 16px 14px; }
.gold-existing-loan-field { display: grid; gap: 5px; min-width: 0; padding: 10px 12px; border: 1px solid var(--color-line); border-radius: 11px; background: var(--color-surface-alt); }
.gold-existing-loan-field > label { margin: 0; color: var(--color-muted); font-size: .59rem; font-weight: 800; letter-spacing: .045em; text-transform: uppercase; }
.gold-existing-loan-field > strong { overflow: hidden; color: var(--color-ink); font-size: .78rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.gold-existing-loan-field .form-control { font-weight: 650; }
@media (max-width: 575.98px) { .gold-existing-loan-grid { grid-template-columns: 1fr; padding-inline: 11px; } }
.gold-asset-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 10px;
}
.gold-asset-section-heading > div { display: flex; align-items: center; gap: 7px; color: var(--color-ink); font-size: .75rem; font-weight: 850; }
.gold-asset-section-heading i { color: var(--color-primary); }
.gold-asset-section-heading > small { color: var(--color-muted); font-size: .6rem; }
.gold-asset-section-heading .gold-breakdown-edit-action { display: inline-flex; min-height: 30px; align-items: center; gap: 6px; padding: 4px 9px; font-size: .68rem; font-weight: 750; }
.gold-asset-section-heading .gold-breakdown-edit-action i { color: currentColor; }
.gold-asset-table-wrap { margin: 0 14px 14px; overflow-x: auto; border: 1px solid var(--color-line); border-radius: 11px; }
.gold-asset-table { width: 100%; min-width: 720px; border-collapse: separate; border-spacing: 0; color: var(--color-ink); font-size: .7rem; }
.gold-asset-table th { padding: 8px 10px; border-bottom: 1px solid var(--color-line); background: var(--color-surface-alt); color: var(--color-muted); font-size: .58rem; font-weight: 850; letter-spacing: .055em; text-transform: uppercase; white-space: nowrap; }
.gold-asset-table th:first-child { width: 44px; }
.gold-asset-table td { padding: 9px 10px; border-bottom: 1px solid var(--color-line); vertical-align: middle; }
.gold-asset-unit { color: var(--color-muted); font-size: .63rem; font-weight: 700; }
.gold-asset-row-note { max-width: 240px; overflow-wrap: anywhere; }
.gold-asset-table tfoot td { padding: 9px 10px; border: 0; background: color-mix(in srgb, var(--color-primary) 8%, var(--color-surface)); color: var(--color-ink); }
.gold-asset-table tfoot tr:last-child td:first-child { border-bottom-left-radius: 10px; }
.gold-asset-table tfoot tr:last-child td:last-child { border-bottom-right-radius: 10px; }
.gold-asset-table tfoot span:first-child { color: var(--color-primary); font-weight: 850; }
.gold-asset-total-row.has-error td { background: var(--color-danger-bg); }
.gold-asset-total-mismatch { color: var(--color-danger) !important; }
.gold-asset-total-mismatch strong,
.gold-asset-total-mismatch small { display: block; color: inherit; }
.gold-asset-total-mismatch small { margin-top: 2px; font-size: .56rem; font-weight: 750; }
.gold-asset-reconciliation-error td { padding: 8px 10px !important; border-top: 1px solid color-mix(in srgb, var(--color-danger) 25%, var(--color-line)) !important; background: var(--color-danger-bg) !important; color: var(--color-danger) !important; font-size: .62rem; }
.gold-asset-reconciliation-error i { margin-right: 6px; }
.gold-asset-reconciliation-error strong { margin-right: 3px; }
.gold-asset-context { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 13px 14px; border-top: 1px solid var(--color-line); background: var(--color-surface-alt); }
.gold-asset-context > div { display: flex; align-items: flex-start; gap: 9px; min-width: 0; }
.gold-context-icon { flex: 0 0 auto; width: 29px; height: 29px; display: grid; place-items: center; border: 1px solid var(--color-line); border-radius: 8px; background: var(--color-surface); color: var(--color-primary); font-size: .72rem; }
.gold-asset-context > div > span:last-child { min-width: 0; display: grid; gap: 3px; }
.gold-asset-context strong { color: var(--color-ink); font-size: .7rem; font-weight: 700; overflow-wrap: anywhere; }
.gold-asset-empty { margin: 14px; }
.gold-asset-empty > i { margin-right: 6px; color: var(--color-primary); }
.gold-breakdown-empty { display: flex; align-items: center; gap: 10px; margin: 0 14px 14px; padding: 12px; border: 1px dashed color-mix(in srgb, var(--color-primary) 34%, var(--color-line)); border-radius: 11px; background: color-mix(in srgb, var(--color-primary) 5%, var(--color-surface)); }
.gold-breakdown-empty > i { flex: 0 0 auto; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: color-mix(in srgb, var(--color-primary) 14%, var(--color-surface)); color: var(--color-primary); }
.gold-breakdown-empty > span { min-width: 0; display: grid; flex: 1 1 auto; gap: 2px; }
.gold-breakdown-empty strong { color: var(--color-ink); font-size: .72rem; }
.gold-breakdown-empty small { color: var(--color-muted); font-size: .63rem; }
.gold-breakdown-modal .modal-content { overflow: hidden; border: 0; border-radius: 16px; }
.gold-breakdown-modal .modal-header { background: linear-gradient(120deg, color-mix(in srgb, var(--color-primary) 8%, var(--color-surface)), var(--color-surface) 52%); }
.gold-breakdown-modal .modal-body { background: var(--color-surface-alt); }
.gold-breakdown-modal-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.gold-breakdown-modal-toolbar > div { display: grid; gap: 1px; }
.gold-breakdown-modal-toolbar strong { color: var(--color-ink); font-size: .78rem; }
.gold-breakdown-modal-toolbar small { color: var(--color-muted); font-size: .62rem; }
.gold-breakdown-rows { display: grid; gap: 10px; }
.gold-breakdown-row { position: relative; min-width: 0; margin: 0; padding: 38px 12px 12px; border: 1px solid var(--color-line); border-radius: 12px; background: var(--color-surface); }
.gold-breakdown-row legend { position: absolute; top: 12px; left: 12px; width: auto; margin: 0; color: var(--color-ink); font-size: .72rem; font-weight: 850; }
.gold-breakdown-remove { position: absolute; top: 6px; right: 8px; font-size: .66rem; text-decoration: none; }
.gold-breakdown-fields { display: grid; grid-template-columns: 1.1fr .8fr .8fr 1fr; gap: 10px; }
.gold-breakdown-fields .form-label { margin-bottom: 4px; font-size: .66rem; }
.gold-breakdown-description { grid-column: 1 / -1; }
.gold-breakdown-live-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.gold-breakdown-live-summary > span { display: grid; gap: 2px; padding: 9px 11px; border: 1px solid var(--color-line); border-radius: 10px; background: var(--color-surface); }
.gold-breakdown-live-summary small { color: var(--color-muted); font-size: .57rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.gold-breakdown-live-summary strong { color: var(--color-ink); font-size: .78rem; }

/* Application securities: post-dated security cheques */
.security-cheque-panel {
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid var(--color-line);
  border-radius: 15px;
  background: var(--color-surface);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--color-ink) 4%, transparent);
}
.security-cheque-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-line);
  background: linear-gradient(120deg, color-mix(in srgb, var(--color-primary) 8%, var(--color-surface)), var(--color-surface) 52%);
}
.security-cheque-header-icon {
  display: inline-grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--color-primary) 22%, var(--color-line));
  border-radius: 11px;
  background: color-mix(in srgb, var(--color-primary) 14%, var(--color-surface));
  color: var(--color-primary);
}
.security-cheque-header-copy { min-width: 0; flex: 1 1 auto; }
.security-cheque-header h2 { margin: 0; color: var(--color-ink); font-size: .96rem; font-weight: 850; }
.security-cheque-header-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.security-cheque-count { flex: 0 0 auto; padding: 5px 9px; border: 1px solid color-mix(in srgb, var(--color-primary) 22%, var(--color-line)); border-radius: 999px; background: var(--color-accent-soft); color: var(--color-primary); font-size: .61rem; font-weight: 850; white-space: nowrap; }
.security-cheque-add { display: inline-grid; width: 30px; height: 30px; padding: 0; place-items: center; }
.security-cheque-table-wrap { overflow-x: visible; }
.security-cheque-table { width: 100%; min-width: 0; border-collapse: collapse; table-layout: fixed; color: var(--color-ink); }
.security-cheque-table th { padding: 10px 14px; border-bottom: 1px solid var(--color-line); background: var(--color-surface-alt); color: var(--color-primary); font-size: .57rem; font-weight: 850; letter-spacing: .045em; text-align: left; text-transform: uppercase; }
.security-cheque-table th:first-child { width: 4%; }
.security-cheque-table th:nth-child(2) { width: 20%; }
.security-cheque-table th:nth-child(3) { width: 13%; }
.security-cheque-table th:nth-child(4) { width: 20%; }
.security-cheque-table th:nth-child(5) { width: 18%; }
.security-cheque-table th:nth-child(6) { width: 17%; }
.security-cheque-table th:nth-child(7) { width: 8%; text-align: center; }
.security-cheque-table td { padding: 12px 14px; border-bottom: 1px solid var(--color-line); color: var(--color-ink); font-size: .68rem; vertical-align: middle; }
.security-cheque-saved-row td { background: var(--color-surface); }
.security-cheque-saved-row { transition: opacity .16s ease; }
.security-cheque-saved-row.is-saving { opacity: .62; }
.security-cheque-saved-row.is-saved td:first-child { box-shadow: inset 3px 0 0 var(--color-success); }
.security-cheque-saved-row.is-save-error td:first-child { box-shadow: inset 3px 0 0 var(--color-danger); }
.security-cheque-entry-row td { background: color-mix(in srgb, var(--color-primary) 3%, var(--color-surface)); }
.security-cheque-table .form-control,
.security-cheque-table .form-select { min-height: 40px; border-color: var(--color-line); font-size: .69rem; }
.security-cheque-money-input { display: grid; grid-template-columns: 34px minmax(0, 1fr); min-height: 40px; overflow: hidden; border: 1px solid var(--color-line); border-radius: var(--bs-border-radius-sm); background: var(--color-surface); }
.security-cheque-money-input > span { display: grid; place-items: center; border-right: 1px solid var(--color-line); background: var(--color-surface-alt); color: var(--color-muted); font-size: .72rem; font-weight: 800; }
.security-cheque-money-input input { min-width: 0; padding: .25rem .5rem; border: 0; outline: 0; background: transparent; color: var(--color-ink); font-size: .67rem; }
.security-cheque-optional-field { display: flex; align-items: center; gap: 6px; min-width: 0; }
.security-cheque-optional-field > .bounded-select { width: 112px; min-width: 112px; flex: 0 0 112px; }
.security-cheque-optional-field.is-without-value > .bounded-select { width: 100%; min-width: 0; flex: 1 1 auto; }
.security-cheque-optional-mode { width: 100%; min-width: 0; max-width: none; }
.security-cheque-optional-value { flex: 1 1 auto; min-width: 0; }
.security-cheque-date-value { display: block; }
.security-cheque-entry-actions,
.security-cheque-evidence-actions { display: inline-flex; align-items: center; gap: 5px; }
.security-cheque-entry-actions .btn { display: inline-grid; width: 30px; height: 30px; padding: 0; place-items: center; }
.security-cheque-upload,
.security-cheque-delete { display: inline-grid; width: 30px; height: 30px; padding: 0; place-items: center; }
.security-cheque-upload-field { display: flex; align-items: center; gap: 7px; min-width: 0; }
.security-cheque-upload.is-selected { border-color: var(--color-success); background: var(--color-success-bg); color: var(--color-success); }
.security-cheque-upload[hidden] { display: none; }
.security-cheque-upload-details { display: grid; min-width: 0; line-height: 1.2; text-align: left; }
.security-cheque-upload-details[hidden] { display: none; }
.security-cheque-upload-details strong { min-width: 0; overflow: hidden; color: var(--color-ink); font-size: .64rem; text-overflow: ellipsis; white-space: nowrap; }
.security-cheque-upload-details small { margin-top: 2px; color: var(--color-muted); font-size: .56rem; font-weight: 700; }
.security-cheque-upload-actions { display: flex; align-items: center; gap: 4px; margin-top: 5px; }
.security-cheque-upload-actions[hidden] { display: none; }
.security-cheque-upload-actions a,
.security-cheque-upload-actions button { display: inline-grid; width: 25px; height: 25px; padding: 0; place-items: center; border: 1px solid var(--color-line); border-radius: 7px; background: var(--color-surface); color: var(--color-primary); font-size: .65rem; line-height: 1; text-decoration: none; }
.security-cheque-upload-actions button:last-child { color: var(--color-danger); }
.security-cheque-evidence { display: grid; gap: 6px; min-width: 0; }
.security-cheque-evidence-name { display: flex; align-items: center; gap: 5px; min-width: 0; color: var(--color-ink); font-weight: 700; }
.security-cheque-evidence-name > i { flex: 0 0 auto; color: var(--color-primary); }
.security-cheque-evidence-name > span { overflow-wrap: anywhere; }
.security-cheque-evidence-actions .btn { display: inline-grid; width: 28px; height: 28px; padding: 0; place-items: center; font-size: .68rem; }
.security-cheque-actions-cell { text-align: center; }
.security-cheque-no-evidence { color: var(--color-muted); }
.security-cheque-form-footer { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 14px; background: color-mix(in srgb, var(--color-primary) 7%, var(--color-surface)); }
.security-cheque-form-footer p { margin: 0; color: var(--color-muted); font-size: .61rem; }
.security-cheque-form-footer p i { margin-right: 5px; color: var(--color-primary); }

@media (max-width: 767.98px) {
  .gold-asset-context { grid-template-columns: 1fr; }
  .gold-breakdown-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 575.98px) {
  .gold-asset-header { align-items: flex-start; flex-wrap: wrap; padding: 13px; }
  .gold-asset-header p { display: none; }
  .gold-asset-section-heading { align-items: flex-start; flex-direction: column; gap: 3px; padding-inline: 11px; }
  .gold-asset-table-wrap { margin-inline: 10px; }
  .gold-asset-context { padding: 10px; }
  .gold-breakdown-empty { align-items: flex-start; flex-wrap: wrap; margin-inline: 10px; }
  .gold-breakdown-empty .btn { width: 100%; }
  .gold-breakdown-fields { grid-template-columns: 1fr; }
  .gold-breakdown-description { grid-column: auto; }
  .gold-breakdown-live-summary { grid-template-columns: 1fr; }
  .security-cheque-header { align-items: flex-start; flex-wrap: wrap; }
  .security-cheque-header-actions { width: calc(100% - 52px); margin-left: 52px; justify-content: space-between; }
}

/* CAM-controlled loan workflow */
.badge-loan-applied { background: var(--color-accent-soft); color: var(--color-primary); }
.badge-loan-pending { background: var(--color-warning-bg); color: var(--color-warning); }
.badge-loan-sanctioned { background: var(--color-success-bg); color: var(--color-success); }
.badge-loan-active { background: var(--color-accent-soft); color: var(--color-primary); }
.badge-loan-rejected { background: var(--color-danger-bg); color: var(--color-danger); }
.cam-workflow-panel { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--color-line); }
.cam-workflow-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cam-workflow-header > div { display: grid; gap: 2px; }
.cam-workflow-header small { color: var(--color-muted); font-size: .61rem; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.cam-workflow-header strong { color: var(--color-ink); font-size: .84rem; }
.cam-workflow-header .badge { padding: 6px 9px; border-radius: 999px; font-size: .65rem; }
.cam-workflow-steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 13px 0 12px; padding: 0; list-style: none; }
.cam-workflow-steps li { display: grid; grid-template-columns: 24px minmax(0, 1fr); align-items: center; gap: 6px; min-width: 0; padding: 7px; border: 1px solid var(--color-line); border-radius: 9px; color: var(--color-muted); background: var(--color-surface-alt); }
.cam-workflow-steps li > span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--color-surface); color: inherit; font-size: .64rem; font-weight: 850; }
.cam-workflow-steps li > small { overflow: hidden; font-size: .6rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.cam-workflow-steps li.current { border-color: color-mix(in srgb, var(--color-primary) 38%, var(--color-line)); background: var(--color-accent-soft); color: var(--color-primary); }
.cam-workflow-steps li.complete { color: var(--color-success); }
.cam-workflow-steps li.current.complete { border-color: color-mix(in srgb, var(--color-success) 30%, var(--color-line)); background: var(--color-success-bg); }
.cam-workflow-steps li.rejected { border-color: color-mix(in srgb, var(--color-danger) 30%, var(--color-line)); background: var(--color-danger-bg); color: var(--color-danger); }
.cam-workflow-panel > p { margin: 0 0 11px; color: var(--color-muted); font-size: .7rem; }
.cam-decision-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.cam-workflow-result { display: flex; align-items: flex-start; gap: 9px; padding: 10px; border: 1px solid color-mix(in srgb, var(--color-success) 24%, var(--color-line)); border-radius: 10px; background: var(--color-success-bg); color: var(--color-success); }
.cam-workflow-result.rejected { border-color: color-mix(in srgb, var(--color-danger) 24%, var(--color-line)); background: var(--color-danger-bg); color: var(--color-danger); }
.cam-workflow-result > i { margin-top: 2px; }
.cam-workflow-result > .cam-workflow-result-content { display: grid; gap: 6px; min-width: 0; flex: 1; }
.cam-workflow-result strong { font-size: .75rem; }
.cam-workflow-result small { color: var(--color-ink); font-size: .65rem; line-height: 1.4; overflow-wrap: anywhere; }
.cam-workflow-result .cam-remark-card { display: grid; gap: 2px; padding: 7px 8px; border: 1px solid color-mix(in srgb, var(--color-success) 30%, var(--color-line)); border-radius: 8px; background: color-mix(in srgb, var(--color-surface) 82%, transparent); }
.cam-workflow-result.rejected .cam-remark-card { border-color: color-mix(in srgb, var(--color-danger) 30%, var(--color-line)); }
.cam-remark-card small { color: var(--color-muted); font-size: .58rem; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.cam-remark-card p { margin: 0; color: var(--color-ink); font-size: .72rem; font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; }
.cam-workflow-result .cam-decision-audit { color: var(--color-muted); font-size: .66rem; }
.cam-decision-audit strong { font-size: inherit; }
.cam-decision-audit code { color: var(--color-primary); font-size: inherit; }
.cam-grid { align-items: stretch; }
.cam-grid .customer-data-panel { min-height: 100%; }
.cam-application-heading { justify-content: space-between; }
.cam-application-heading > span:first-child { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.cam-application-product { display: grid; width: fit-content; max-width: 58%; min-width: 0; margin-left: auto; overflow: hidden; border: 1px solid color-mix(in srgb, var(--color-primary) 30%, var(--color-line)); border-radius: 9px; background: var(--color-accent-soft); text-align: left; }
.cam-application-product-title { padding: 5px 8px 3px; color: var(--color-primary); font-size: .57rem; font-weight: 850; letter-spacing: .05em; text-align: center; text-transform: uppercase; }
.cam-application-product-grid { display: grid; grid-template-columns: minmax(0, max-content) max-content; }
.cam-application-product-grid > span { display: grid; gap: 2px; min-width: 0; padding: 4px 8px 6px; }
.cam-application-product-grid > span + span { border-left: 1px solid color-mix(in srgb, var(--color-primary) 20%, var(--color-line)); }
.cam-application-product-grid small { color: var(--color-muted); font-size: .52rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.cam-application-product-grid strong { color: var(--color-primary); font-size: .68rem; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
.cam-application-terms { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; }
.cam-security-details { margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--color-line); }
.cam-security-details > header { display: flex; align-items: center; justify-content: space-between; gap: 9px; margin-bottom: 8px; }
.cam-security-details > header > span { display: inline-flex; align-items: center; gap: 6px; color: var(--color-ink); font-size: .74rem; font-weight: 850; }
.cam-security-details > header i { color: var(--color-primary); }
.cam-security-details > header > small { padding: 3px 6px; border-radius: 999px; background: color-mix(in srgb, var(--color-primary) 14%, var(--color-surface)); color: var(--color-primary); font-size: .56rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.cam-security-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--color-line); border-radius: 10px; background: var(--color-surface-alt); }
.cam-security-grid > div { display: grid; gap: 3px; min-width: 0; padding: 8px 9px; }
.cam-security-grid > div:nth-child(odd) { border-right: 1px solid var(--color-line); }
.cam-security-grid > div:nth-child(-n + 2) { border-bottom: 1px solid var(--color-line); }
.cam-security-grid small { color: var(--color-muted); font-size: .58rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.cam-security-grid strong { color: var(--color-ink); font-size: .72rem; font-weight: 750; overflow-wrap: anywhere; }
.cam-security-grid .cam-security-value { background: color-mix(in srgb, var(--color-primary) 9%, var(--color-surface)); }
.cam-security-grid .cam-security-value strong { color: var(--color-primary); }
.cam-security-document { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; padding: 8px 9px; border: 1px solid var(--color-line); border-radius: 10px; background: var(--color-surface-alt); }
.cam-security-document > span { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cam-security-document > span > i { color: var(--color-primary); }
.cam-security-document > span > span { display: grid; min-width: 0; }
.cam-security-document small { color: var(--color-muted); font-size: .58rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.cam-security-document strong { color: var(--color-ink); font-size: .7rem; font-weight: 750; overflow-wrap: anywhere; }
.cam-security-document .btn { flex: none; }
.cam-security-document-actions { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.cam-security-document-action { display: inline-grid; width: 34px; height: 34px; padding: 0; place-items: center; }
.cam-security-empty { margin: 0; padding: 9px; border: 1px dashed var(--color-line); border-radius: 9px; color: var(--color-muted); font-size: .7rem; }
.cam-product-field { grid-column: 1 / -1; }
.cam-product-field .form-select { font-size: .78rem; font-weight: 700; }
.cam-fee-payment-field { grid-column: 1 / -1; min-width: 0; margin: 0; }
.cam-fee-payment-field > legend { float: none; width: auto; margin: 0 0 6px; }
.cam-fee-payment-row { display: grid; grid-template-columns: minmax(115px, .8fr) repeat(2, minmax(0, 1fr)); gap: 8px; align-items: stretch; }
.cam-fee-amount .input-group-text { color: var(--color-muted); background: var(--color-surface-alt); font-size: .72rem; font-weight: 750; }
.cam-fee-amount .form-control { min-width: 0; background: var(--color-surface); font-size: .72rem; font-weight: 750; }
.cam-fee-payment-row > label { display: flex; align-items: center; gap: 7px; min-width: 0; margin: 0; padding: 8px; border: 1px solid var(--color-line); border-radius: 9px; background: var(--color-surface-alt); cursor: pointer; }
.cam-fee-payment-row > label:has(input:checked) { border-color: var(--color-primary); background: var(--color-accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-primary) 30%, transparent); }
.cam-fee-payment-row input[type="radio"] { flex: 0 0 auto; margin: 0; accent-color: var(--color-primary); }
.cam-fee-payment-row strong { min-width: 0; color: var(--color-ink); font-size: .66rem; line-height: 1.25; }
.cam-fee-payment-field--readonly .cam-fee-payment-row > label { cursor: default; }
.cam-fee-payment-field--readonly .cam-fee-payment-row input[type="radio"] { opacity: 1; }
.cam-approved-terms .input-group-text { color: var(--color-muted); background: var(--color-surface-alt); font-size: .75rem; font-weight: 750; }
.cam-approved-terms .form-control { min-width: 0; font-size: .8rem; font-weight: 750; }
.cam-approved-terms .input-group { flex-wrap: nowrap; }
.cam-approved-terms .form-select { min-width: 0; font-size: .8rem; font-weight: 750; }
.cam-approved-terms .input-group-text { white-space: nowrap; }
.cam-approved-amount-control { display: grid; gap: 4px; }
.cam-approved-amount-limit { color: var(--color-muted); font-size: .62rem; line-height: 1.3; }
.cam-approved-amount-limit strong { color: var(--color-primary); font-weight: 850; }
.cam-approved-terms:has(> [data-cam-fee-payment-field]:not([hidden])) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cam-breakdown-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.cam-breakdown-grid:has([data-cam-charges-section][hidden]) > .cam-breakdown-section:not([hidden]) { grid-column: 1 / -1; }
.cam-breakdown-section { margin-top: 12px; overflow: hidden; border: 1px solid var(--color-line); border-radius: 10px; background: var(--color-surface-alt); }
.cam-breakdown-grid > .cam-breakdown-section { margin-top: 0; }
.cam-breakdown-grid .cam-breakdown-section { background: var(--color-surface); }
.cam-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px; border-bottom: 1px solid var(--color-line); background: var(--color-surface); }
.cam-section-heading > div { display: grid; gap: 2px; }
.cam-section-heading small { color: var(--color-muted); font-size: .59rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.cam-section-heading strong { color: var(--color-ink); font-size: .76rem; }
.cam-section-heading > span { color: var(--color-primary); font-size: .68rem; font-weight: 800; text-align: right; }
.cam-section-heading > .badge { padding: 5px 8px; border-radius: 999px; }
.cam-disbursement-section .cam-section-heading small { color: var(--color-ink); font-size: .76rem; letter-spacing: .04em; }
.cam-breakdown-rows { padding: 0; }
.cam-breakdown-rows > div { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; min-height: 34px; padding: 8px 10px; color: var(--color-muted); font-size: .68rem; }
.cam-breakdown-rows > div + div { border-top: 1px solid color-mix(in srgb, var(--color-line) 70%, transparent); }
.cam-breakdown-rows strong { max-width: 65%; color: var(--color-ink); font-size: .7rem; text-align: right; overflow-wrap: anywhere; }
.cam-breakdown-rows [data-cam-gl-charge-list] { display: block; background: var(--color-surface); }
.cam-breakdown-row { display: flex; align-items: flex-start; justify-content: flex-start; gap: 6px; width: 100%; }
.cam-breakdown-row strong { max-width: none; text-align: left; }
.cam-breakdown-rows [data-cam-gl-charge-list] .cam-breakdown-row { justify-content: space-between; }
.cam-breakdown-rows [data-cam-gl-charge-list] .cam-breakdown-row strong { margin-left: auto; text-align: right; }
.cam-interest-analysis-row { justify-content: space-between; }
.cam-interest-analysis-row strong { max-width: 76%; font-size: .66rem; text-align: right; white-space: nowrap; }
.cam-breakdown-rows .cam-breakdown-total { align-items: center; background: var(--color-surface-alt); }
.cam-breakdown-rows .cam-breakdown-total strong { color: var(--color-primary); font-size: .76rem; }
.cam-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cam-summary-grid > div { display: grid; gap: 3px; padding: 9px 10px; border-right: 1px solid var(--color-line); }
.cam-summary-grid > div:last-child { border-right: 0; }
.cam-summary-grid span { color: var(--color-muted); font-size: .61rem; font-weight: 700; text-transform: uppercase; }
.cam-summary-grid strong { color: var(--color-ink); font-size: .77rem; }
.cam-summary-grid .cam-summary-primary { background: var(--color-accent-soft); }
.cam-summary-grid .cam-summary-primary strong { color: var(--color-primary); }
.cam-action-panel { margin-top: 12px; }

/* Disbursement surfaces keep the sanctioned amount and settlement destination together. */
.disbursement-detail-layout { display: grid; gap: 14px; }
.disbursement-state-card { display: flex; align-items: center; gap: 13px; padding: 17px 18px; border: 1px solid var(--color-line); border-radius: 13px; background: var(--color-surface); }
.disbursement-state-card > div { flex: 1; min-width: 0; }
.disbursement-state-card small { display: block; margin-bottom: 2px; color: var(--color-muted); font-size: .64rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.disbursement-state-card h2 { margin: 0; color: var(--color-ink); font-size: 1rem; font-weight: 850; }
.disbursement-state-card p { margin: 3px 0 0; color: var(--color-muted); font-size: .75rem; }
.disbursement-state-icon { display: inline-grid; flex: 0 0 auto; width: 42px; height: 42px; border-radius: 12px; place-items: center; font-size: 1.1rem; }
.disbursement-state-card--ready { border-color: color-mix(in srgb, var(--color-success) 28%, var(--color-line)); background: color-mix(in srgb, var(--color-success-bg) 70%, var(--color-surface)); }
.disbursement-state-card--ready .disbursement-state-icon { background: var(--color-success-bg); color: var(--color-success); }
.disbursement-state-card--locked .disbursement-state-icon { background: var(--color-surface-alt); color: var(--color-muted); }
.disbursement-readiness-panel { overflow: hidden; border: 1px solid var(--color-line); border-radius: 13px; background: var(--color-surface); }
.disbursement-readiness-panel--checklist { border-color: color-mix(in srgb, var(--color-primary) 24%, var(--color-line)); }
.disbursement-readiness-panel--ready { border-color: color-mix(in srgb, var(--color-success) 30%, var(--color-line)); }
.disbursement-readiness-panel--pending { border-color: color-mix(in srgb, var(--color-warning) 32%, var(--color-line)); }
.disbursement-readiness-panel--blocked { border-color: color-mix(in srgb, var(--color-danger) 30%, var(--color-line)); }
.disbursement-readiness-header { display: flex; align-items: center; gap: 13px; padding: 15px 17px; border-bottom: 1px solid var(--color-line); }
.disbursement-readiness-panel--checklist .disbursement-readiness-header { background: var(--color-accent-soft); }
.disbursement-readiness-panel--ready .disbursement-readiness-header { background: color-mix(in srgb, var(--color-success-bg) 70%, var(--color-surface)); }
.disbursement-readiness-panel--pending .disbursement-readiness-header { background: color-mix(in srgb, var(--color-warning-bg) 66%, var(--color-surface)); }
.disbursement-readiness-panel--blocked .disbursement-readiness-header { background: color-mix(in srgb, var(--color-danger-bg) 66%, var(--color-surface)); }
.disbursement-readiness-header > div { flex: 1; min-width: 0; }
.disbursement-readiness-header small { display: block; margin-bottom: 2px; color: var(--color-muted); font-size: .62rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.disbursement-readiness-header h2 { margin: 0; color: var(--color-ink); font-size: .95rem; font-weight: 850; }
.disbursement-readiness-header p { margin: 2px 0 0; color: var(--color-muted); font-size: .71rem; }
.disbursement-readiness-panel--ready .disbursement-state-icon { background: var(--color-success-bg); color: var(--color-success); }
.disbursement-readiness-panel--checklist .disbursement-state-icon { background: var(--color-surface); color: var(--color-primary); }
.disbursement-readiness-panel--pending .disbursement-state-icon { background: var(--color-warning-bg); color: var(--color-warning); }
.disbursement-readiness-panel--blocked .disbursement-state-icon { background: var(--color-danger-bg); color: var(--color-danger); }
.disbursement-readiness-count { flex: 0 0 auto; padding: 5px 9px; border-radius: 999px; background: var(--color-surface); color: var(--color-ink); font-size: .64rem; font-weight: 800; white-space: nowrap; }
.disbursement-checklist { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
.disbursement-checklist-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; min-width: 0; padding: 12px 13px; border-top: 1px solid var(--color-line); }
.disbursement-checklist-item:nth-child(-n + 5) { border-top: 0; }
.disbursement-checklist-item:not(:nth-child(5n + 1)) { border-left: 1px solid var(--color-line); }
.disbursement-check-icon { display: inline-grid; width: 29px; height: 29px; border-radius: 9px; place-items: center; font-size: .8rem; }
.disbursement-checklist-item--complete .disbursement-check-icon { background: var(--color-success-bg); color: var(--color-success); }
.disbursement-checklist-item--pending .disbursement-check-icon { background: var(--color-warning-bg); color: var(--color-warning); }
.disbursement-checklist-item--blocked .disbursement-check-icon { background: var(--color-danger-bg); color: var(--color-danger); }
.disbursement-checklist-item > div { display: grid; gap: 2px; min-width: 0; }
.disbursement-checklist-item strong { color: var(--color-ink); font-size: .7rem; line-height: 1.25; }
.disbursement-checklist-item small { color: var(--color-muted); font-size: .61rem; line-height: 1.3; overflow-wrap: anywhere; }
.disbursement-check-status { align-self: start; padding: 3px 6px; border-radius: 999px; font-size: .55rem; font-weight: 850; }
.disbursement-checklist-item--complete .disbursement-check-status { background: var(--color-success-bg); color: var(--color-success); }
.disbursement-checklist-item--pending .disbursement-check-status { background: var(--color-warning-bg); color: var(--color-warning); }
.disbursement-checklist-item--blocked .disbursement-check-status { background: var(--color-danger-bg); color: var(--color-danger); }
.disbursement-bank-panel { max-width: none; }
.disbursement-settlement-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.disbursement-settlement-account { min-width: 0; }
.disbursement-bank-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--color-line); }
.disbursement-bank-heading > div { display: grid; gap: 2px; }
.disbursement-bank-heading > div span { color: var(--color-muted); font-size: .69rem; }
.disbursement-bank-heading > div strong { color: var(--color-ink); font-size: .84rem; }
.disbursement-bank-details { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; }
.disbursement-bank-details > div { min-width: 0; padding: 13px 12px 0 0; }
.disbursement-bank-details dt { color: var(--color-muted); font-size: .63rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.disbursement-bank-details dd { margin: 3px 0 0; color: var(--color-ink); font-size: .76rem; font-weight: 750; overflow-wrap: anywhere; }
.disbursement-action-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; min-width: 0; padding: 18px; border: 1px solid color-mix(in srgb, var(--color-primary) 18%, var(--color-line)); border-radius: 12px; background: var(--color-accent-soft); text-align: center; }
.disbursement-action-panel > small { color: var(--color-muted); font-size: .64rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.disbursement-action-panel > strong { color: var(--color-primary); font-size: 1.05rem; }
.disbursement-action-panel > p { margin: 0 0 4px; color: var(--color-muted); font-size: .66rem; line-height: 1.4; }
.disbursement-action-icon { display: inline-grid; width: 38px; height: 38px; border-radius: 11px; background: var(--color-surface); color: var(--color-primary); place-items: center; font-size: 1rem; }
.disbursement-action-icon--complete { background: var(--color-success-bg); color: var(--color-success); }
.disbursement-action-panel--detailed { align-items: stretch; justify-content: flex-start; gap: 11px; padding: 14px; text-align: left; }
.disbursement-action-heading { display: flex; align-items: center; gap: 9px; }
.disbursement-action-heading > div { display: grid; flex: 1; gap: 1px; min-width: 0; }
.disbursement-action-heading small,
.disbursement-action-amount small,
.disbursement-action-reference small { color: var(--color-muted); font-size: .59rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.disbursement-action-heading strong { color: var(--color-ink); font-size: .76rem; }
.disbursement-action-amount { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--color-primary) 15%, var(--color-line)); border-radius: 9px; background: var(--color-surface); }
.disbursement-action-amount strong { color: var(--color-primary); font-size: 1.12rem; }
.disbursement-action-details { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin: 0; }
.disbursement-action-details > div { min-width: 0; padding: 8px 9px; border: 1px solid var(--color-line); border-radius: 8px; background: color-mix(in srgb, var(--color-surface) 68%, transparent); }
.disbursement-action-details dt { color: var(--color-muted); font-size: .56rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.disbursement-action-details dd { margin: 3px 0 0; color: var(--color-ink); font-size: .67rem; font-weight: 750; overflow-wrap: anywhere; }
.disbursement-action-reference { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px; padding-top: 1px; }
.disbursement-action-reference strong { color: var(--color-muted); font-size: .61rem; font-weight: 700; overflow-wrap: anywhere; text-align: right; }
.disbursement-confirmation-section + .disbursement-confirmation-section { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--color-line); }
.disbursement-confirmation-section h3 { margin: 0; color: var(--color-ink); font-size: .78rem; font-weight: 850; }
.disbursement-confirmation-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 9px 0 0; }
.disbursement-confirmation-list--summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.disbursement-confirmation-list > div { display: grid; gap: 3px; padding: 10px; border: 1px solid var(--color-line); border-radius: 9px; background: var(--color-surface-alt); }
.disbursement-confirmation-list dt { color: var(--color-muted); font-size: .62rem; font-weight: 800; text-transform: uppercase; }
.disbursement-confirmation-list dd { margin: 0; color: var(--color-ink); font-size: .74rem; font-weight: 750; overflow-wrap: anywhere; }
.disbursement-confirmation-list .disbursement-confirmation-primary { border-color: color-mix(in srgb, var(--color-primary) 25%, var(--color-line)); background: var(--color-accent-soft); }
.disbursement-confirmation-list .disbursement-confirmation-primary dd { color: var(--color-primary); font-size: .88rem; }
.disbursement-otp-section { padding: 12px; border: 1px solid #bfd3f2; border-radius: 11px; background: #f4f8ff; }
.disbursement-otp-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.disbursement-otp-heading p { margin: 3px 0 0; color: var(--color-muted); font-size: .7rem; }
.disbursement-otp-entry { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 12px; align-items: end; margin-top: 10px; }
.disbursement-otp-entry .form-label { margin-bottom: 4px; color: var(--color-ink); font-size: .68rem; font-weight: 800; }
.disbursement-otp-entry .form-control { text-align: center; font-size: 1rem; font-weight: 800; letter-spacing: .28em; }
.disbursement-otp-status { min-height: 38px; display: flex; align-items: center; padding: 8px 10px; border: 1px solid var(--color-line); border-radius: 8px; background: #fff; color: var(--color-muted); font-size: .68rem; }
.disbursement-development-otp { margin-top: 8px; padding: 7px 10px; border-radius: 8px; background: #fff0bd; color: #744b00; font-size: .72rem; font-weight: 800; letter-spacing: .04em; }
.disbursement-queue-table th { white-space: nowrap; }

/* Application header metrics use distinct tones so each value scans independently. */
.loan-record-shell .summary-chip--terms {
  min-width: 135px;
  border-color: color-mix(in srgb, var(--color-primary) 28%, var(--color-line));
  background: var(--color-accent-soft);
}
.loan-record-shell .summary-chip--terms strong { color: var(--color-primary); }
.loan-record-shell .summary-chip-values { display: flex; align-items: baseline; gap: 5px; margin-top: 2px; white-space: nowrap; }
.loan-record-shell .summary-chip-values strong { margin-top: 0; }
.loan-record-shell .summary-chip-tenure {
  color: var(--color-primary);
  font-size: .68rem;
  font-weight: 750;
}
.loan-record-shell [data-loan-edit-field][hidden],
.loan-record-shell [data-loan-edit-static][hidden],
.loan-record-shell [data-loan-edit-actions][hidden] { display: none !important; }
.loan-record-shell [data-loan-edit-field] { margin-top: 3px; }
.loan-record-shell .application-edit-actions { margin-left: auto; padding: 0; flex: 0 0 auto; }
.customer-inline-edit-form { margin: 16px; }
.loan-record-shell .summary-chip--status-success {
  border-color: color-mix(in srgb, var(--color-success) 28%, var(--color-line));
  background: var(--color-success-bg);
}
.loan-record-shell .summary-chip--status-closed {
  border-color: #14532d;
  background: #166534;
}
.loan-record-shell .summary-chip--status-closed small { color: #d1fae5; }
.loan-record-shell .summary-chip--status-closed strong { color: #fff!important; }
.summary-chip--customer-active {
  border-color: #86efac;
  background: #dcfce7;
}
.summary-chip--customer-active small { color: #166534; }
.summary-chip--customer-active strong { color: #166534; }
.credit-overdue-metric {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}
.credit-overdue-view {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  color: #b91c1c;
  background: #fef2f2;
}
.credit-overdue-view:hover,
.credit-overdue-view:focus-visible {
  border-color: #ef4444;
  color: #991b1b;
  background: #fee2e2;
}
.credit-overdue-modal .modal-content {
  overflow: hidden;
  border: 0;
  border-radius: 16px;
}
.credit-overdue-table th {
  white-space: nowrap;
  background: #f1f5f9;
}
.credit-overdue-table td { white-space: nowrap; }
.credit-overdue-table .credit-overdue-amount {
  color: #b91c1c;
  font-weight: 700;
}
.credit-overdue-empty {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 24px 18px;
  color: #166534;
  text-align: center;
}
.credit-overdue-empty i { font-size: 1.65rem; }
.credit-overdue-empty strong { color: var(--color-ink); font-size: 1rem; }
.credit-overdue-empty-dialog { max-width: 440px; }
.credit-overdue-empty-dialog .modal-header { padding: 14px 16px; }
.credit-overdue-empty-dialog .modal-header > div { min-width: 0; }
.credit-overdue-empty-dialog .modal-header small { font-size: .65rem; }
.credit-overdue-empty-dialog .modal-title {
  overflow: hidden;
  font-size: .95rem!important;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.loan-record-shell .summary-chip--status-warning {
  border-color: color-mix(in srgb, var(--color-warning) 28%, var(--color-line));
  background: var(--color-warning-bg);
}
.loan-record-shell .summary-chip--status-danger {
  border-color: color-mix(in srgb, var(--color-danger) 28%, var(--color-line));
  background: var(--color-danger-bg);
}
.loan-record-shell .summary-chip--submitted {
  border-color: #efcbb5;
  background: #fff0e6;
}
.loan-record-shell .summary-chip--submitted strong { color: #a94f18; }

@media (max-width: 575.98px) {
  .cam-application-heading { align-items: flex-start; flex-wrap: wrap; }
  .cam-application-product { width: 100%; max-width: none; margin-left: 0; }
  .cam-application-terms { grid-template-columns: 1fr; }
  .cam-workflow-steps { grid-template-columns: 1fr; }
  .cam-decision-actions { grid-template-columns: 1fr; }
  .cam-summary-grid { grid-template-columns: 1fr; }
  .cam-breakdown-grid { grid-template-columns: 1fr; }
  .cam-fee-payment-row { grid-template-columns: 1fr; }
  .cam-approved-terms:has(> [data-cam-fee-payment-field]:not([hidden])) { grid-template-columns: 1fr; }
  .cam-summary-grid > div { border-right: 0 !important; border-bottom: 1px solid var(--color-line) !important; }
  .cam-summary-grid > div:last-child { border-bottom: 0 !important; }
  .disbursement-state-card { align-items: flex-start; flex-wrap: wrap; }
  .disbursement-readiness-header { align-items: flex-start; flex-wrap: wrap; }
  .disbursement-readiness-count { margin-left: 42px; }
  .disbursement-checklist { grid-template-columns: 1fr; }
  .disbursement-checklist-item { border-top: 1px solid var(--color-line) !important; border-left: 0 !important; }
  .disbursement-checklist-item:first-child { border-top: 0 !important; }
  .disbursement-settlement-layout { grid-template-columns: 1fr; }
  .disbursement-action-panel { align-items: stretch; text-align: left; }
  .disbursement-action-icon { align-self: flex-start; }
  .disbursement-action-details { grid-template-columns: 1fr 1fr; }
  .disbursement-bank-details { grid-template-columns: 1fr 1fr; }
  .disbursement-confirmation-list,.disbursement-confirmation-list--summary { grid-template-columns: 1fr; }
}

/* Customer portfolio: CashPoint loans are intentionally separate from CIBIL obligations. */
.cashpoint-loans-panel { padding: 0; overflow: hidden; }
.cashpoint-loans-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 16px 16px 10px; }
.cashpoint-loans-heading h2 { margin-bottom: 3px; }
.cashpoint-loans-heading p { margin: 0; color: var(--color-muted); font-size: .76rem; }
.cashpoint-loan-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; padding: 0 16px 16px; }
.cashpoint-loan-metrics article { display: grid; gap: 4px; min-width: 0; padding: 11px 12px; border: 1px solid var(--color-line); border-radius: 10px; background: var(--color-surface-alt); }
.cashpoint-loan-metrics small { color: var(--color-muted); font-size: .66rem; font-weight: 750; }
.cashpoint-loan-metrics strong { color: var(--color-ink); font-size: .92rem; overflow-wrap: anywhere; }
.cashpoint-loan-metrics .is-active small,
.cashpoint-loan-metrics .is-active strong { color: var(--color-success); }
.cashpoint-loan-metrics .is-closed small,
.cashpoint-loan-metrics .is-closed strong { color: var(--color-danger); }
.cashpoint-loans-table-wrap { border-top: 1px solid var(--color-line); }
.cashpoint-loans-table { min-width: 980px; }
.cashpoint-loans-table thead th { padding: 10px 12px; background: var(--color-surface-alt); color: var(--color-muted); font-size: .62rem; text-transform: uppercase; white-space: nowrap; }
.cashpoint-loans-table tbody td { padding: 11px 12px; font-size: .75rem; white-space: nowrap; }
.cashpoint-loan-id { color: var(--color-primary); font-weight: 800; }
.cashpoint-loans-empty { margin: 0 16px 16px; }

@media (max-width: 991.98px) {
  .cashpoint-loan-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cashpoint-loan-metrics article:last-child { grid-column: 1 / -1; }
}

@media (max-width: 575.98px) {
  .cashpoint-loans-heading { align-items: flex-start; flex-direction: column; }
  .cashpoint-loan-metrics { grid-template-columns: 1fr; padding-inline: 12px; }
  .cashpoint-loan-metrics article:last-child { grid-column: auto; }
}
/* Loan archival management */
.archive-stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.archive-stat-card { display: flex; align-items: center; gap: 12px; padding: 16px; }
.archive-stat-card > i { display: grid; width: 40px; height: 40px; flex: 0 0 40px; place-items: center; border-radius: 11px; background: var(--color-accent-soft); color: var(--color-primary); font-size: 1rem; }
.archive-stat-card div { display: grid; min-width: 0; }
.archive-stat-card strong { color: var(--color-ink); font-size: 1.3rem; line-height: 1; }
.archive-stat-card span { margin-top: 5px; color: var(--color-muted); font-size: .72rem; }
.archive-filter-submit { display: inline-grid; width: 40px; min-height: 38px; padding: 0; place-items: center; }
.archive-row-actions { display: flex; align-items: center; gap: 5px; }
.archive-row-action { display: inline-grid; width: 30px; height: 30px; padding: 0; place-items: center; }
.archive-table-shell { max-height: calc(100vh - 330px); overflow-x: hidden; }
.archive-table { width: 100%; min-width: 0; table-layout: fixed; font-size: .7rem; }
.archive-table th,
.archive-table td { padding-inline: .5rem; overflow-wrap: anywhere; }
.archive-table thead th { position: sticky; top: 0; z-index: 1; background: var(--color-surface-alt); white-space: normal; line-height: 1.2; }
.archive-table th:nth-child(1) { width: 9%; }
.archive-table th:nth-child(2) { width: 9%; }
.archive-table th:nth-child(3) { width: 15%; }
.archive-table th:nth-child(4) { width: 14%; }
.archive-table th:nth-child(5) { width: 14%; }
.archive-table th:nth-child(6) { width: 18%; }
.archive-table th:nth-child(7) { width: 12%; }
.archive-table th:nth-child(8) { width: 9%; }
.archive-table .dropdown-toggle { max-width: 100%; padding-inline: .45rem; }
.archive-table thead a { color: inherit; text-decoration: none; }
.archive-reason-cell { min-width: 230px; max-width: 300px; white-space: normal; }
.archive-confirm-details { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 0 18px; }
.archive-confirm-details div, .archive-detail-grid > div { display: grid; gap: 3px; padding: 12px; border: 1px solid var(--color-line); border-radius: 10px; background: var(--color-surface-alt); }
.archive-confirm-details dt, .archive-detail-grid small { color: var(--color-muted); font-size: .65rem; font-weight: 750; text-transform: uppercase; }
.archive-confirm-details dd { margin: 0; color: var(--color-ink); font-weight: 750; }
.archive-detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.archive-detail-grid strong { color: var(--color-ink); overflow-wrap: anywhere; }
.archive-detail-wide { grid-column: 1 / -1; }
.gl-master-content { padding: 18px; }
.gl-master-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.gl-master-heading h2 { margin: 0; color: var(--color-ink); font-size: 1rem; font-weight: 850; }
.gl-master-heading p { margin: 3px 0 0; color: var(--color-muted); font-size: .7rem; }
.gl-create-button { display: inline-grid; width: 34px; height: 34px; padding: 0; place-items: center; border-radius: 9px; }
.gl-filter-bar { display: grid; grid-template-columns: minmax(260px, 1fr) 180px 180px auto; gap: 8px; margin-bottom: 12px; }
.gl-filter-bar label { margin: 0; min-width: 0; }
.gl-filter-bar .form-control, .gl-filter-bar .form-select, .gl-filter-bar > .btn { min-height: 38px; border-radius: 9px; font-size: .72rem; }
.gl-search-field { position: relative; }
.gl-search-field > i { position: absolute; z-index: 2; top: 50%; left: 12px; translate: 0 -50%; color: var(--color-muted); }
.gl-search-field .form-control { padding-left: 34px; }
.gl-table-shell { overflow-x: auto; border: 1px solid var(--color-line); border-radius: 11px; }
.gl-table { min-width: 1040px; }
.gl-table thead th { padding: 9px 10px; border-bottom-color: var(--color-line); background: var(--color-surface-alt); color: var(--color-muted); font-size: .59rem; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
.gl-table tbody td { padding: 9px 10px; border-bottom-color: var(--color-line); color: var(--color-ink); font-size: .7rem; vertical-align: middle; }
.gl-table tbody tr:last-child td { border-bottom: 0; }
.gl-table tbody tr:hover > * { background: color-mix(in srgb, var(--color-accent-soft) 32%, var(--color-surface)); }
.gl-name { font-size: .72rem; }
.gl-type-badge, .gl-applicability, .gl-gst-yes { display: inline-flex; padding: 4px 7px; border-radius: 999px; background: var(--color-accent-soft); color: var(--color-primary); font-size: .61rem; font-weight: 800; text-transform: uppercase; }
.gl-applicability { background: var(--color-surface-alt); color: var(--color-ink); }
.gl-gst-yes { background: var(--color-success-bg); color: var(--color-success); text-transform: none; }
.gl-description { min-width: 180px; max-width: 280px; white-space: normal; overflow-wrap: anywhere; }
.gl-row-actions { display: flex; justify-content: flex-end; gap: 6px; }
.gl-row-actions .btn { display: inline-grid; width: 31px; height: 29px; padding: 0; place-items: center; border-radius: 8px; }
.gl-empty-state { display: grid; justify-items: center; gap: 5px; padding: 42px 20px; color: var(--color-muted); text-align: center; }
.gl-empty-state > i { color: var(--color-primary); font-size: 1.5rem; }
.gl-empty-state strong { color: var(--color-ink); font-size: .86rem; }
.gl-empty-state p { margin: 0 0 7px; font-size: .7rem; }
.gl-form-modal .modal-header p { color: var(--color-muted); font-size: .72rem; }
.gl-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; }
.gl-form-grid > label { display: grid; align-content: start; gap: 6px; min-width: 0; margin: 0; color: var(--color-ink); font-size: .74rem; font-weight: 750; }
.gl-form-grid .form-control, .gl-form-grid .form-select, .gl-form-grid .input-group-text { min-height: 42px; border-color: var(--color-line); border-radius: 9px; font-size: .75rem; }
.gl-form-grid .input-group .form-control { border-radius: 9px 0 0 9px; }
.gl-form-grid .input-group-text { min-width: 42px; justify-content: center; border-radius: 0 9px 9px 0; background: var(--color-surface-alt); color: var(--color-success); font-weight: 850; }
.gl-form-grid textarea.form-control { min-height: 120px; resize: vertical; }
.gl-form-grid label > small { color: var(--color-muted); font-size: .62rem; font-weight: 500; line-height: 1.35; }
.gl-form-wide { grid-column: 1 / -1; }
.gl-gst-toggle { align-self: end; }
.gl-gst-toggle > span:last-child { display: flex; min-height: 42px; align-items: center; gap: 9px; padding: 8px 11px; border: 1px solid var(--color-line); border-radius: 9px; background: var(--color-surface); }
.gl-gst-toggle strong { font-size: .75rem; }
.gl-view-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
.gl-view-grid > div { display: grid; gap: 3px; padding: 11px; border: 1px solid var(--color-line); border-radius: 9px; background: var(--color-surface-alt); }
.gl-view-grid dt { color: var(--color-muted); font-size: .62rem; text-transform: uppercase; }
.gl-view-grid dd { margin: 0; color: var(--color-ink); font-size: .76rem; font-weight: 750; overflow-wrap: anywhere; }
.gl-view-wide { grid-column: 1 / -1; }
.gl-slab-editor { min-width: 0; margin: 0; padding: 12px; border: 1px solid var(--color-line); border-radius: 9px; background: var(--color-surface-alt); }
.gl-slab-editor[hidden], [data-gl-charge-value-field][hidden] { display: none !important; }
.gl-slab-editor > legend { float: none; width: auto; margin: 0 0 4px; color: var(--color-ink); font-size: .74rem; font-weight: 750; }
.gl-slab-editor > p { margin: 0 0 8px; color: var(--color-muted); font-size: .64rem; line-height: 1.4; }
.gl-slab-table { --bs-table-bg: transparent; }
.gl-slab-table th { color: var(--color-muted); font-size: .62rem; text-transform: uppercase; font-weight: 750; }
.gl-slab-table td { vertical-align: middle; }
.gl-slab-table th:last-child, .gl-slab-table td:last-child { width: 44px; text-align: end; }
.gl-slab-table .form-control { min-height: 36px; }
.gl-slab-from { color: var(--color-muted); font-size: .74rem; font-weight: 750; white-space: nowrap; }
.gl-slab-summary { margin: 0; padding: 0; list-style: none; font-size: .7rem; line-height: 1.5; }
.loan-lifecycle-form { padding: 22px; }
.lifecycle-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.lifecycle-setting-card { display: flex; align-items: center; justify-content: space-between; gap: 22px; min-height: 105px; padding: 18px; border: 1px solid var(--color-line); border-radius: 13px; background: var(--color-surface); }
.lifecycle-setting-card > span { display: grid; gap: 4px; }
.lifecycle-setting-card strong { color: var(--color-ink); font-size: .86rem; }
.lifecycle-setting-card small { color: var(--color-muted); font-size: .7rem; line-height: 1.4; }
.lifecycle-setting-card .input-group { width: 155px; flex: 0 0 155px; }
.lifecycle-setting-toggle .form-check-input { width: 2.5rem; height: 1.3rem; flex: 0 0 auto; }
@media (max-width: 1000px) { .archive-stat-grid, .archive-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .lifecycle-settings-grid { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .gl-filter-bar { grid-template-columns: 1fr 1fr; } .gl-search-field { grid-column: 1 / -1; } }
@media (max-width: 600px) { .archive-stat-grid, .archive-detail-grid, .archive-confirm-details { grid-template-columns: 1fr; } .lifecycle-setting-card { align-items: flex-start; flex-direction: column; } .lifecycle-setting-card .input-group { width: 100%; flex-basis: auto; } .gl-master-content { padding: 13px; } .gl-filter-bar, .gl-form-grid, .gl-view-grid { grid-template-columns: 1fr; } .gl-search-field, .gl-form-wide, .gl-view-wide { grid-column: auto; } }
/* Collection operations */
.collection-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.75rem;margin-bottom:1rem}.collection-tab{display:flex;align-items:center;justify-content:space-between;gap:.75rem;padding:.9rem 1rem;border:1px solid var(--cp-border,#dce3ed);border-radius:12px;background:var(--cp-surface,#fff);color:var(--cp-text,#172033);text-decoration:none;font-weight:700}.collection-tab strong{display:grid;place-items:center;min-width:28px;height:28px;padding:0 .45rem;border-radius:999px;background:#eef3fa;color:#345}.collection-tab.active{border-color:var(--cp-primary,#1758ad);box-shadow:0 0 0 2px rgba(23,88,173,.08);color:var(--cp-primary,#1758ad)}.collection-tab.active strong{background:var(--cp-primary,#1758ad);color:#fff}.collection-table-shell{padding:.35rem}.collection-table{font-size:.82rem;min-width:1500px}.collection-table thead th{white-space:nowrap}.collection-status,.collection-transaction-status{display:inline-flex;align-items:center;white-space:nowrap;padding:.32rem .6rem;border-radius:999px;font-size:.74rem;font-weight:800}.collection-status--upcoming{background:#e9f2ff;color:#1758ad}.collection-status--due{background:#fff1da;color:#a85d00}.collection-status--partial{background:#fff6cc;color:#8a6700}.collection-status--overdue,.collection-transaction-status--reversed{background:#fee8e8;color:#b42318}.collection-status--collected,.collection-transaction-status--confirmed{background:#e7f7ed;color:#14763c}.collection-transaction-status--pending{background:#fff1da;color:#a85d00}.collection-modal-summary{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:.75rem;padding:1rem;border-radius:12px;background:#f7f9fc}.collection-modal-summary div{display:flex;flex-direction:column;gap:.2rem}.collection-modal-summary small,.collection-summary-grid small{color:#68758a;font-size:.72rem;text-transform:uppercase;letter-spacing:.04em;font-weight:700}.collection-modal-summary strong{font-size:.92rem}.collection-modal-total{padding-left:.75rem;border-left:2px solid var(--cp-primary,#1758ad)}.collection-detail-stack{display:grid;gap:1rem}.collection-detail-heading{display:flex;justify-content:space-between;align-items:center;gap:1rem;margin-bottom:1rem}.collection-detail-heading small{display:block;color:#68758a;text-transform:uppercase;letter-spacing:.05em;font-weight:700}.collection-detail-heading h2{margin:.15rem 0 0}.collection-summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.8rem}.collection-summary-grid>div{display:flex;flex-direction:column;gap:.25rem;padding:.9rem;border:1px solid #e3e8f0;border-radius:11px;background:#fbfcfe}.collection-summary-grid strong{font-size:1rem}.collection-summary-emphasis{border-color:#aac7ed!important;background:#f2f7ff!important}.collection-history-table{font-size:.82rem;min-width:1250px}.collection-mode-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.75rem}.collection-mode-grid label{display:flex;align-items:center;gap:.65rem;padding:.8rem;border:1px solid #e1e7ef;border-radius:10px;background:#fafcff;font-weight:700}.dashboard-collection-section{margin:1rem 0 1.25rem;padding:1rem;border:1px solid var(--cp-border,#dce3ed);border-radius:16px;background:var(--cp-surface,#fff)}.collection-dashboard-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.75rem;margin-top:.8rem}.collection-dashboard-card{display:flex;align-items:center;gap:.75rem;padding:.9rem;border-radius:12px;background:#f7f9fc;border:1px solid #e5eaf1}.collection-dashboard-card>span{display:grid;place-items:center;width:36px;height:36px;border-radius:10px;background:#e8f0fb;color:#1758ad}.collection-dashboard-card div{display:flex;flex-direction:column}.collection-dashboard-card small{color:#68758a;font-weight:700}.collection-dashboard-card strong{font-size:1.05rem}.collection-dashboard-card--danger>span{background:#fee8e8;color:#b42318}.collection-dashboard-card--success>span{background:#e7f7ed;color:#14763c}.collection-dashboard-card--warning>span{background:#fff1da;color:#a85d00}.badge-loan-overdue{background:#fee8e8!important;color:#b42318!important}.badge-loan-closed{background:#e7f7ed!important;color:#14763c!important}
@media(max-width:991px){.collection-tabs{grid-template-columns:repeat(2,minmax(0,1fr))}.collection-modal-summary,.collection-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.collection-dashboard-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.collection-mode-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:575px){.collection-tabs,.collection-modal-summary,.collection-summary-grid,.collection-dashboard-grid,.collection-mode-grid{grid-template-columns:1fr}.collection-detail-heading{align-items:flex-start;flex-direction:column}.collection-modal-total{padding-left:0;border-left:0}}

/* Month-wise collection calendar */
.collection-page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.collection-calendar-shell { overflow: hidden; }
.collection-calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--color-line);
  background: var(--color-surface);
}
.collection-month-summary { display: flex; align-items: stretch; min-width: 0; }
.collection-month-summary > div {
  display: grid;
  align-content: center;
  gap: 2px;
  min-width: 110px;
  padding: 3px 18px;
  border-left: 1px solid var(--color-line);
}
.collection-month-summary > div:first-child { min-width: 140px; padding-left: 0; border-left: 0; }
.collection-month-summary small,
.collection-date-panel-header > small {
  color: var(--color-muted);
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.collection-month-summary strong { color: var(--color-ink); font-size: .84rem; white-space: nowrap; }
.collection-calendar-controls { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.collection-product-filter { width: min(230px, 24vw); }
.collection-product-filter .form-select { min-height: 40px; padding-block: 7px; font-size: .78rem; }
.collection-month-picker { display: flex; align-items: center; min-width: 220px; height: 40px; border: 1px solid var(--color-line); border-radius: 10px; overflow: hidden; }
.collection-month-picker .btn { width: 39px; height: 38px; display: grid; place-items: center; flex: none; padding: 0; border: 0; border-radius: 0; background: var(--color-surface-alt); color: var(--color-ink); }
.collection-month-picker strong { flex: 1; padding: 0 12px; color: var(--color-ink); font-size: .78rem; text-align: center; white-space: nowrap; }
.collection-calendar-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(290px, 34%); min-height: 600px; }
.collection-calendar-wrap { min-width: 0; overflow-x: auto; }
.collection-calendar-wrap--full { width: 100%; }
.collection-calendar-wrap--full .collection-weekdays,
.collection-calendar-wrap--full .collection-calendar-grid,
.collection-calendar-wrap--full .collection-calendar-legend { min-width: 760px; }
.collection-calendar-wrap--full .collection-calendar-day { min-height: 112px; }
.collection-weekdays,
.collection-calendar-grid { min-width: 620px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.collection-weekdays { background: var(--color-sidebar); color: var(--color-inverse); }
.collection-weekdays span { padding: 7px; border-right: 1px solid color-mix(in srgb, var(--color-inverse) 14%, transparent); font-size: .64rem; font-weight: 850; letter-spacing: .08em; text-align: center; text-transform: uppercase; }
.collection-calendar-grid { gap: 1px; padding-bottom: 1px; background: var(--color-line); }
.collection-calendar-day {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 104px;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 9px 10px;
  background: var(--color-surface);
  color: var(--color-ink);
  outline: 0 solid transparent;
  outline-offset: -2px;
}
.collection-calendar-day:hover { z-index: 1; background: color-mix(in srgb, var(--color-accent-soft) 42%, var(--color-surface)); color: var(--color-ink); }
.collection-calendar-day:focus-visible { z-index: 2; outline: 3px solid color-mix(in srgb, var(--color-primary) 55%, transparent); }
.collection-calendar-day--empty { background: var(--color-surface-alt); opacity: .62; }
.collection-calendar-day.is-selected { z-index: 2; background: color-mix(in srgb, var(--color-accent-soft) 65%, var(--color-surface)); outline: 2px solid var(--color-primary); }
.collection-calendar-day.is-today .collection-day-number { background: var(--color-primary); color: var(--color-primary-text); }
.collection-calendar-day.is-overdue { box-shadow: inset 3px 0 0 var(--color-danger); }
.collection-calendar-day.is-due { box-shadow: inset 3px 0 0 #d49300; }
.collection-calendar-day.is-upcoming { box-shadow: inset 3px 0 0 var(--color-primary); }
.collection-calendar-day.is-collected { box-shadow: inset 3px 0 0 var(--color-success); }
.collection-day-number { display: grid; width: 25px; height: 25px; place-items: center; margin-left: auto; border-radius: 50%; color: var(--color-ink); font-size: .75rem; font-weight: 850; }
.collection-day-amount { max-width: 100%; overflow: hidden; color: var(--color-ink); font-size: .86rem; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
.collection-day-count,
.collection-day-state { display: inline-flex; align-items: center; gap: 5px; color: var(--color-muted); font-size: .65rem; font-weight: 700; }
.collection-day-state { margin-top: auto; color: var(--color-success); }
.collection-day-empty-label { margin: auto 0; color: color-mix(in srgb, var(--color-muted) 68%, transparent); font-size: .62rem; }
.collection-calendar-legend { display: flex; align-items: center; gap: 16px; min-width: 620px; padding: 9px 14px; color: var(--color-muted); font-size: .67rem; font-weight: 700; }
.collection-calendar-legend > span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.collection-calendar-legend small { margin-left: auto; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-primary); }
.legend-dot--due { background: #d49300; }
.legend-dot--overdue { background: var(--color-danger); }
.legend-dot--collected { background: var(--color-success); }
.collection-date-panel { min-width: 0; border-left: 1px solid var(--color-line); background: var(--color-surface); }
.collection-date-empty { min-height: 100%; display: flex; align-items: center; justify-content: center; flex-direction: column; padding: 32px; color: var(--color-muted); text-align: center; }
.collection-date-empty > i { margin-bottom: 12px; color: var(--color-primary); font-size: 2rem; }
.collection-date-empty strong { color: var(--color-ink); font-size: .9rem; }
.collection-date-empty span { max-width: 250px; margin-top: 5px; font-size: .73rem; line-height: 1.5; }
.collection-date-empty--compact { min-height: 300px; }
.collection-date-panel-header { padding: 18px; border-bottom: 1px solid var(--color-line); background: var(--color-surface-alt); }
.collection-date-panel-header h2 { margin: 3px 0 12px; color: var(--color-ink); font-size: 1.05rem; font-weight: 850; }
.collection-date-panel-header > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.collection-date-panel-header > div span { color: var(--color-muted); font-size: .72rem; font-weight: 700; }
.collection-date-panel-header > div strong { color: var(--color-primary); font-size: 1.05rem; }
.collection-date-panel-header p { margin: 3px 0 0; color: var(--color-muted); font-size: .68rem; text-align: right; }
.collection-date-list { display: grid; gap: 10px; max-height: 585px; padding: 12px; overflow-y: auto; }
.collection-recovery-card { display: grid; gap: 11px; padding: 13px; border: 1px solid var(--color-line); border-radius: 12px; background: var(--color-surface); box-shadow: 0 4px 14px color-mix(in srgb, var(--color-ink) 4%, transparent); }
.collection-recovery-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.collection-recovery-card-top > div { display: grid; min-width: 0; }
.collection-recovery-card-top a { font-size: .82rem; font-weight: 850; }
.collection-recovery-card-top small { overflow: hidden; color: var(--color-muted); font-size: .66rem; text-overflow: ellipsis; white-space: nowrap; }
.collection-recovery-customer { display: grid; min-width: 0; }
.collection-recovery-customer strong { overflow: hidden; color: var(--color-ink); font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.collection-recovery-customer span { color: var(--color-muted); font-size: .68rem; }
.collection-recovery-card dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
.collection-recovery-card dl > div { padding: 8px 9px; border-radius: 8px; background: var(--color-surface-alt); }
.collection-recovery-card dt { color: var(--color-muted); font-size: .6rem; font-weight: 800; text-transform: uppercase; }
.collection-recovery-card dd { margin: 2px 0 0; color: var(--color-ink); font-size: .78rem; font-weight: 850; }
.collection-recovery-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.collection-recovery-actions .btn { min-height: 34px; font-size: .7rem; }
.collection-recovered-label,
.collection-not-due-label { display: inline-flex; align-items: center; gap: 5px; color: var(--color-success); font-size: .68rem; font-weight: 800; }
.collection-not-due-label { color: var(--color-muted); }

.collection-day-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.collection-day-heading-copy { display: flex; align-items: flex-start; gap: 13px; }
.collection-day-heading-copy > div { display: grid; }
.collection-day-heading-copy small,
.collection-day-list-header small { color: var(--color-muted); font-size: .65rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.collection-day-heading-copy h1 { margin: 2px 0 3px; color: var(--color-ink); font-size: 1.65rem; font-weight: 850; }
.collection-day-heading-copy p { margin: 0; color: var(--color-muted); font-size: .8rem; }
.collection-day-back { width: 40px; height: 40px; display: grid; place-items: center; flex: none; border: 1px solid var(--color-line); border-radius: 10px; background: var(--color-surface); color: var(--color-ink); }
.collection-day-back:hover { border-color: var(--color-primary); background: var(--color-accent-soft); color: var(--color-primary); }
.collection-day-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.collection-day-stats > div { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 14px 16px; }
.collection-day-stats > div > span { width: 38px; height: 38px; display: grid; place-items: center; flex: none; border-radius: 10px; background: var(--color-accent-soft); color: var(--color-primary); }
.collection-day-stats > div > div { display: grid; min-width: 0; }
.collection-day-stats small { color: var(--color-muted); font-size: .65rem; font-weight: 750; text-transform: uppercase; }
.collection-day-stats strong { overflow: hidden; color: var(--color-ink); font-size: 1.05rem; text-overflow: ellipsis; white-space: nowrap; }
.collection-day-stat--warning > span { background: var(--color-warning-bg)!important; color: var(--color-warning)!important; }
.collection-day-stat--success > span { background: var(--color-success-bg)!important; color: var(--color-success)!important; }
.collection-day-list-shell { overflow: hidden; }
.collection-day-list-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 18px; border-bottom: 1px solid var(--color-line); }
.collection-day-list-header h2 { margin: 2px 0 0; color: var(--color-ink); font-size: 1.05rem; font-weight: 850; }
.collection-day-list-empty { min-height: 360px; }
.collection-day-table { width: 100%; min-width: 0; table-layout: fixed; font-size: .7rem; }
.collection-day-table thead th { padding: 9px 7px; background: var(--color-surface-alt); color: var(--color-muted); font-size: .58rem; font-weight: 850; letter-spacing: .03em; line-height: 1.2; text-transform: uppercase; white-space: normal; }
.collection-day-table tbody td { min-width: 0; padding: 10px 7px; overflow-wrap: anywhere; }
.collection-day-table th:nth-child(1) { width: 14%; }
.collection-day-table th:nth-child(2) { width: 14%; }
.collection-day-table th:nth-child(3),
.collection-day-table th:nth-child(4) { width: 9%; }
.collection-day-table th:nth-child(5) { width: 10.5%; }
.collection-day-table th:nth-child(6),
.collection-day-table th:nth-child(7),
.collection-day-table th:nth-child(8) { width: 7.5%; }
.collection-day-table th:nth-child(9) { width: 8%; }
.collection-day-table th:nth-child(10) { width: 12%; }
.collection-day-table tbody td:first-child > strong,
.collection-day-table tbody td:first-child > small,
.collection-day-table tbody td:nth-child(2) > strong,
.collection-day-table tbody td:nth-child(2) > small { display: block; }
.collection-day-table tbody td small { color: var(--color-muted); font-size: .65rem; }
.collection-day-loan-link { display: block; margin-bottom: 2px; font-weight: 850; }
.collection-day-outstanding { color: var(--color-primary); font-weight: 850; }
.collection-day-remarks { white-space: normal; overflow-wrap: anywhere; }
.collection-day-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; min-width: 0; }
.collection-day-actions .btn { min-height: 34px; padding-inline: 9px; font-size: .64rem; white-space: nowrap; }

@media (max-width: 1350px) {
  .collection-calendar-header { align-items: flex-start; flex-direction: column; }
  .collection-calendar-controls { width: 100%; justify-content: space-between; }
  .collection-product-filter { width: min(300px, 45%); }
}
@media (max-width: 1100px) {
  .collection-calendar-layout { grid-template-columns: 1fr; }
  .collection-date-panel { min-height: 350px; border-top: 1px solid var(--color-line); border-left: 0; }
  .collection-date-list { max-height: none; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .collection-page-heading { align-items: stretch; flex-direction: column; }
  .collection-page-heading .btn { width: 100%; }
  .collection-month-summary { width: 100%; overflow-x: auto; }
  .collection-month-summary > div { min-width: 105px; padding-inline: 12px; }
  .collection-calendar-controls { align-items: stretch; flex-direction: column; }
  .collection-product-filter,
  .collection-month-picker { width: 100%; min-width: 0; }
  .collection-date-list { grid-template-columns: 1fr; }
  .collection-day-heading { align-items: stretch; flex-direction: column; }
  .collection-day-heading > .btn { width: 100%; }
  .collection-day-heading-copy h1 { font-size: 1.35rem; }
  .collection-day-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) { .collection-day-stats { grid-template-columns: 1fr; } }
.collection-modal-summary { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 991px) { .collection-modal-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.income-assessment-summary{margin:.8rem 0 1rem;border:1px solid #d8e2ef;border-radius:12px;background:#f8fbff;overflow:hidden}.income-assessment-summary>header{display:flex;align-items:center;justify-content:space-between;gap:.75rem;padding:.65rem .8rem;border-bottom:1px solid #dfe7f1}.income-assessment-summary>header small{display:block;font-size:.58rem;line-height:1.15;letter-spacing:.1em;color:#64748b;font-weight:800}.income-assessment-summary>header h3{font-size:.88rem;line-height:1.15;margin:.1rem 0 0;font-weight:800}.income-assessment-state{font-size:.62rem;line-height:1.1;font-weight:800;padding:.25rem .5rem;border-radius:999px;background:#fff3cd;color:#7a5300}.income-assessment-state.state-verified,.income-assessment-state.state-manual_override{background:#dff7e8;color:#126b3a}.income-assessment-state.state-loading{background:#e7f0ff;color:#174d99}.income-assessment-state.state-verification_required{background:#fff0e3;color:#974313}.income-assessment-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:1px;background:#dfe7f1}.income-assessment-grid>div{min-width:0;padding:.6rem .7rem;background:#fff}.income-assessment-grid span{display:block;color:#667085;font-size:.62rem;line-height:1.2;font-weight:700}.income-assessment-grid strong{display:block;margin-top:.18rem;color:#152238;font-size:.88rem;line-height:1.15}.income-assessment-grid small{display:block;color:#7b8798;font-size:.58rem;line-height:1.15;margin-top:.12rem}.income-assessment-grid .income-total{background:#edf4ff}.income-assessment-grid .income-obligations strong{color:#b54708}.income-assessment-grid .income-net{background:#e7f7ee}.income-assessment-grid .income-net strong{font-size:.98rem;color:#11683a}@media(max-width:900px){.income-assessment-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.income-assessment-grid .income-net{grid-column:span 2}}@media(max-width:520px){.employment-detail-row-vintage dt{white-space:normal}.income-assessment-summary>header{align-items:flex-start;flex-direction:column}.income-assessment-grid{grid-template-columns:1fr}.income-assessment-grid .income-net{grid-column:auto}}

/* Operational ledger workspace */
.ledger-print-header, .ledger-print-footer { display: none; }
.ledger-report-shell { overflow: hidden; border-radius: 16px; }
.ledger-report-header { display: flex; min-height: 58px; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px 12px 20px; border-bottom: 1px solid var(--color-line); }
.ledger-report-header h1 { margin: 0; color: var(--color-ink); font-size: 1.25rem!important; font-weight: 850; }
.ledger-report-actions { display: flex; align-items: center; gap: 8px; }
.ledger-report-actions .btn { min-height: 38px; border-radius: 10px; font-size: .72rem; font-weight: 750; }
.ledger-download-toggle { display: inline-flex; align-items: center; gap: 7px; padding-inline: 13px; border-color: var(--color-line); background: var(--color-surface); color: var(--color-ink); }
.ledger-refresh-button { display: inline-grid; width: 38px; padding: 0; place-items: center; font-size: .9rem!important; }
.ledger-report-actions .dropdown-menu { min-width: 180px; padding: 6px; border-color: var(--color-line); border-radius: 10px; box-shadow: 0 12px 30px color-mix(in srgb, var(--color-ink) 12%, transparent); }
.ledger-report-actions .dropdown-item { display: flex; align-items: center; gap: 8px; padding: 8px 9px; border-radius: 7px; font-size: .72rem; }
.ledger-report-filters { display: grid; grid-template-columns: minmax(235px, 295px) 145px 145px max-content; align-items: end; justify-content: start; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--color-line); background: var(--color-surface); }
.ledger-report-filters label { display: grid; gap: 5px; min-width: 0; margin: 0; }
.ledger-report-filters label > span { color: var(--color-muted); font-size: .61rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.ledger-report-filters .form-control,
.ledger-report-filters .form-select,
.ledger-generate-button { min-height: 39px; border-color: var(--color-line); border-radius: 9px; font-size: .73rem; }
.ledger-report-filters .form-control,
.ledger-report-filters .form-select { color: var(--color-ink); font-weight: 650; }
.ledger-report-filters input[type="date"] { color-scheme: light; }
.ledger-generate-button { min-width: 88px; padding-inline: 17px; font-weight: 800; }
.ledger-report-canvas { min-height: max(430px, calc(100vh - 275px)); margin: 14px 16px 16px; border: 1px dashed var(--color-line); border-radius: 13px; background: var(--color-surface-alt); }
.ledger-report-empty { display: flex; min-height: max(430px, calc(100vh - 275px)); align-items: center; justify-content: center; flex-direction: column; padding: 30px; color: var(--color-muted); text-align: center; }
.ledger-report-empty > span { display: grid; width: 42px; height: 42px; place-items: center; margin-bottom: 10px; border-radius: 12px; background: color-mix(in srgb, var(--color-accent-soft) 70%, var(--color-surface)); color: var(--color-primary); font-size: 1.15rem; }
.ledger-report-empty strong { color: var(--color-ink); font-size: .82rem; }
.ledger-report-empty p { max-width: 500px; margin: 5px 0 0; font-size: .71rem; line-height: 1.5; }
.ledger-report-results { padding: 14px 16px 16px; }
.ledger-summary-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.ledger-summary-grid--four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ledger-summary-card { display: grid; gap: 5px; min-width: 0; padding: 11px 13px; border: 1px solid var(--color-line); border-radius: 10px; background: var(--color-surface); }
.ledger-summary-card small { color: var(--color-muted); font-size: .59rem; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.ledger-summary-card strong { overflow: hidden; color: var(--color-ink); font-size: .9rem; text-overflow: ellipsis; white-space: nowrap; }
.ledger-summary-card--debit strong { color: var(--color-danger); }
.ledger-summary-card--credit strong { color: var(--color-success); }
.ledger-table-shell { overflow: visible; border: 1px solid var(--color-line); border-radius: 12px; background: var(--color-surface); }
.ledger-table-shell > header { position: relative; display: flex; min-height: 40px; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 8px 5px 12px; border-bottom: 1px solid var(--color-line); border-radius: 11px 11px 0 0; background: var(--color-surface-alt); }
.ledger-table-shell > header h2 { margin: 0; color: var(--color-ink); font-size: .78rem!important; font-weight: 850; }
.ledger-table-header-actions { display: flex; align-items: center; gap: 12px; }
.ledger-table-header-actions > span { color: var(--color-muted); font-size: .65rem; font-weight: 700; }
.ledger-table-download .ledger-download-toggle { min-height: 32px; border-radius: 8px; font-size: .68rem; font-weight: 750; }
.ledger-table-download .dropdown-menu { min-width: 180px; padding: 6px; border-color: var(--color-line); border-radius: 10px; box-shadow: 0 12px 30px color-mix(in srgb, var(--color-ink) 12%, transparent); }
.ledger-table-download .dropdown-item { display: flex; align-items: center; gap: 8px; padding: 8px 9px; border-radius: 7px; font-size: .72rem; }
.ledger-report-table { min-width: 1280px; }
.ledger-report-table thead th { padding: 7px 9px; border-bottom-color: var(--color-line); background: var(--color-surface-alt); color: var(--color-ink); font-size: .57rem; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.ledger-report-table tbody td { padding: 7px 9px; border-bottom-color: var(--color-line); color: var(--color-ink); font-size: .68rem; vertical-align: middle; }
.ledger-report-table tbody td > small { display: block; margin-top: 2px; color: var(--color-muted); font-size: .59rem; }
.ledger-reference { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .62rem; }
.ledger-source { display: inline-flex; padding: 4px 7px; border-radius: 999px; background: var(--color-accent-soft); color: var(--color-primary); font-size: .58rem; font-weight: 800; white-space: nowrap; }
.ledger-payment-mode { color: var(--color-muted)!important; font-weight: 750; white-space: nowrap; }
.ledger-remarks { min-width: 190px; max-width: 280px; white-space: normal; }
.ledger-debit { color: var(--color-danger)!important; font-weight: 800; }
.ledger-credit { color: var(--color-success)!important; font-weight: 800; }
.ledger-no-transactions { height: 48px; color: var(--color-muted)!important; text-align: left; }
.ledger-table-footer { display: flex; min-height: 38px; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 8px; border-top: 1px solid var(--color-line); color: var(--color-muted); font-size: .65rem; }
.ledger-table-footer > div { display: flex; align-items: center; gap: 6px; }
.ledger-table-footer strong { padding: 5px 8px; border: 1px solid var(--color-line); border-radius: 7px; color: var(--color-ink); font-size: .64rem; }
.ledger-table-footer .btn { display: inline-grid; width: 26px; height: 26px; padding: 0; place-items: center; border-radius: 7px; }

.general-ledger-table { width: 100%; min-width: 0; table-layout: fixed; }
.general-ledger-table th:nth-child(1) { width: 14%; }
.general-ledger-table th:nth-child(2) { width: 19%; }
.general-ledger-table th:nth-child(3) { width: 16%; }
.general-ledger-table th:nth-child(4) { width: 16%; }
.general-ledger-table th:nth-child(5) { width: 12%; }
.general-ledger-table th:nth-child(6) { width: 11%; }
.general-ledger-table th:nth-child(7) { width: 12%; }
@media (max-width: 820px) {
  .ledger-report-filters { grid-template-columns: 1fr 1fr; }
  .ledger-account-field { grid-column: 1 / -1; }
  .ledger-generate-button { width: 100%; }
  .ledger-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ledger-summary-card:last-child { grid-column: 1 / -1; }
  .ledger-summary-grid--four .ledger-summary-card:last-child { grid-column: auto; }
}
@media (max-width: 520px) {
  .ledger-report-header { align-items: flex-start; flex-direction: column; }
  .ledger-report-actions { width: 100%; }
  .ledger-report-actions .dropdown { flex: 1; }
  .ledger-report-actions .ledger-download-toggle { width: 100%; justify-content: center; }
  .ledger-report-filters { grid-template-columns: 1fr; }
  .ledger-account-field { grid-column: auto; }
  .ledger-summary-grid { grid-template-columns: 1fr; }
  .ledger-summary-card:last-child { grid-column: auto; }
  .ledger-table-footer { align-items: flex-start; flex-direction: column; }
}
@media print {
  .admin-sidebar, .topbar, .ledger-report-actions, .ledger-report-filters, .ledger-table-download { display: none!important; }
  .portal-shell { padding-left: 0!important; }
  .main-content { padding: 0!important; }
  .ledger-report-shell { border: 0; box-shadow: none; }
}

/* Cash & bank ledger and operating-bank master */
.bank-ledger-subtitle { display: block; margin-top: 3px; color: var(--color-muted); font-size: .65rem; font-weight: 650; }
.cash-bank-balance-breakdown { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.cash-bank-balance-breakdown article { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 13px; border: 1px solid var(--color-line); border-radius: 10px; background: var(--color-surface-alt); }
.cash-bank-balance-breakdown small { color: var(--color-muted); font-size: .61rem; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.cash-bank-balance-breakdown strong { color: var(--color-ink); font-size: .82rem; }
.cash-bank-balance-combined { border-color: color-mix(in srgb, var(--color-primary) 24%, var(--color-line))!important; background: var(--color-accent-soft)!important; }
.bank-ledger-table { width: 100%; min-width: 0; table-layout: fixed; }
.bank-ledger-table th:nth-child(1) { width: 13%; }
.bank-ledger-table th:nth-child(2) { width: 20%; }
.bank-ledger-table th:nth-child(3) { width: 14%; }
.bank-ledger-table th:nth-child(4) { width: 15%; }
.bank-ledger-table th:nth-child(5) { width: 12%; }
.bank-ledger-table th:nth-child(6) { width: 12%; }
.bank-ledger-table th:nth-child(7) { width: 14%; }
.bank-ledger-table thead th { padding-inline: 7px; }
.bank-ledger-table tbody td { padding-block: 6px; }
.bank-ledger-table .ledger-reference { display: block; max-width: none; overflow: visible; overflow-wrap: anywhere; text-overflow: clip; white-space: normal; }
.bank-ledger-reference-cell { max-width: 155px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bank-ledger-table th:nth-child(n+5),
.bank-ledger-table td:nth-child(n+5) { padding-inline: 7px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bank-main-badge { display: inline-flex; margin-left: 8px; padding: 3px 7px; border-radius: 999px; background: #e5f6eb; color: #126b3a; font-size: .55rem; font-weight: 850; text-transform: uppercase; white-space: nowrap; }
.bank-master-table { min-width: 940px; }
.bank-movement-modal .modal-header small { display: block; margin-top: 3px; }
.bank-movement-modal .modal-title { margin: 0; font-weight: 850; }
@media (max-width: 720px) {
  .bank-ledger-page .ledger-report-actions { flex-wrap: wrap; }
  .bank-ledger-page .ledger-report-actions > .btn { flex: 1; }
  .cash-bank-balance-breakdown { grid-template-columns: 1fr; }
}
/* Applicant-owned customer ledger */
.customer-ledger-filters { grid-template-columns: minmax(310px, 500px) 180px 145px 145px max-content; }
.customer-ledger-loan-field { display: grid; gap: 6px; min-width: 0; }
.customer-ledger-loan-field > label { margin: 0; }
.customer-ledger-search-wrap { position: relative; }
.customer-ledger-search-wrap > i { position: absolute; z-index: 2; top: 50%; left: 13px; transform: translateY(-50%); color: #64748b; }
.customer-ledger-search-wrap .form-control { padding-left: 36px; }
.customer-ledger-search-wrap .form-control[aria-expanded="true"] { border-color: #4d7fca; box-shadow: 0 0 0 3px rgb(42 96 173 / 12%); }

.upfront-charge-panel { padding: 12px 14px; }
.upfront-charge-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.upfront-charge-header h2 { margin: 0; font-size: .94rem; }
.upfront-charge-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(390px, .9fr); gap: 10px; align-items: stretch; }
.upfront-charge-breakdown { align-self: start; overflow: hidden; border: 1px solid #f1dca7; border-radius: 9px; background: #fff9e9; }
.upfront-charge-breakdown-heading { display: flex; justify-content: space-between; gap: 10px; padding: 7px 10px; border-bottom: 1px solid #f1dca7; }
.upfront-charge-breakdown-heading small { display: block; color: #815617; font-size: .64rem; font-weight: 800; text-transform: uppercase; }
.upfront-charge-breakdown-heading span { display: block; margin-top: 1px; color: var(--color-muted); font-size: .66rem; }
.upfront-charge-breakdown-rows { background: rgb(255 255 255 / 45%); }
.upfront-charge-breakdown-row { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; padding: 5px 10px; border-bottom: 1px solid rgb(225 197 133 / 45%); font-size: .71rem; }
.upfront-charge-breakdown-row > :last-child { color: var(--color-ink); font-weight: 750; }
.upfront-charge-breakdown-row--tax { padding-block: 4px; padding-left: 24px; color: var(--color-muted); font-size: .66rem; }
.upfront-charge-breakdown-row--total { border-bottom: 0; background: #fff3cf; color: #815100; }
.upfront-charge-breakdown-row--total strong:last-child { color: #9b5f00; font-size: .88rem; }
.upfront-charge-side { min-width: 0; }
.upfront-charge-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-items: end; height: 100%; margin: 0; }
.upfront-charge-form .form-label { margin-bottom: 3px; font-size: .66rem; font-weight: 750; }
.upfront-charge-form .form-label span { color: var(--color-muted); font-weight: 600; }
.upfront-charge-form .form-control, .upfront-charge-form .form-select, .upfront-charge-form .btn { min-height: 36px; padding-block: 6px; font-size: .72rem; }
.upfront-charge-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; height: 100%; margin: 0; }
.upfront-charge-details div { padding: 7px 9px; border: 1px solid var(--color-line); border-radius: 8px; }
.upfront-charge-details dt { color: var(--color-muted); font-size: .66rem; text-transform: uppercase; }
.upfront-charge-details dd { margin: 3px 0 0; font-size: .78rem; font-weight: 750; overflow-wrap: anywhere; }
@media (max-width: 1100px) {
    .upfront-charge-layout { grid-template-columns: 1fr; }
    .upfront-charge-form .btn { width: 100%; }
    .upfront-charge-details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
    .upfront-charge-form, .upfront-charge-details { grid-template-columns: 1fr; }
    .disbursement-otp-heading { align-items: stretch; flex-direction: column; }
    .disbursement-otp-entry { grid-template-columns: 1fr; }
}

/* Branded ledger print / PDF document */
.ledger-print-table-period { position: absolute; top: 50%; left: 50%; display: block; margin: 0; color: var(--color-muted); font-size: .72rem; font-weight: 750; text-align: center; white-space: nowrap; transform: translate(-50%, -50%); }
@media (max-width: 900px) {
  .ledger-print-table-period { position: static; margin-top: 3px; text-align: left; white-space: normal; transform: none; }
}
@media print {
  @page { size: 210mm 297mm; margin: 0; }

  html, body { min-width: 0!important; margin: 0!important; background: #fff!important; }
  body { color: var(--color-ink)!important; font-family: Arial, Helvetica, sans-serif; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  body * { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .admin-sidebar, .topbar, .bottom-nav, .alert, .modal, .ledger-report-header, .ledger-report-filters,
  .ledger-report-actions, .ledger-table-download, .ledger-table-footer .btn { display: none!important; }
  .portal-shell { min-height: 0!important; padding: 0!important; }
  .main-content { width: 100%!important; max-width: none!important; padding: 0!important; animation: none!important; transform: none!important; }
  .ledger-report-page { width: 100%!important; margin: 0!important; }
  .ledger-report-shell { overflow: visible!important; border: 0!important; border-radius: 0!important; background: #fff!important; box-shadow: none!important; }
  .ledger-report-results { box-sizing: border-box!important; width: 210mm!important; margin: 0 auto!important; padding: 10mm 10mm 13mm!important; }

  .ledger-print-header { display: grid!important; grid-template-columns: 1fr 1.55fr 1.15fr; align-items: center; gap: 4mm; margin: 0 0 5mm; padding: 0 0 4mm; border-bottom: 2px solid var(--color-primary); }
  .ledger-print-brand { display: flex; align-items: center; gap: 3mm; }
  .ledger-print-brand img { width: 17mm; height: auto; }
  .ledger-print-brand strong, .ledger-print-brand small { display: block; }
  .ledger-print-brand strong { color: var(--color-primary); font-size: 10pt; letter-spacing: .08em; }
  .ledger-print-brand small { margin-top: 1mm; color: var(--color-muted); font-size: 6.5pt; }
  .ledger-print-title { text-align: center; }
  .ledger-print-title > small { color: var(--color-primary); font-size: 6.5pt; font-weight: 800; letter-spacing: .16em; }
  .ledger-print-title h1 { margin: 1.2mm 0 .8mm!important; color: var(--color-ink)!important; font-size: 15pt!important; line-height: 1.1; }
  .ledger-print-title p { margin: 0; color: var(--color-muted); font-size: 8pt; font-weight: 700; }
  .ledger-print-meta { display: grid; gap: 2mm; margin: 0; }
  .ledger-print-meta-period { display: block!important; }
  .ledger-print-meta > div { padding: 2mm 2.5mm; border: 1px solid var(--color-line); border-radius: 2mm; background: var(--color-surface-alt); }
  .ledger-print-meta dt { color: var(--color-muted); font-size: 5.5pt; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
  .ledger-print-meta dd { margin: .8mm 0 0; color: var(--color-ink); font-size: 7pt; font-weight: 750; }
  .ledger-print-footer { position: fixed; right: 10mm; bottom: 6mm; left: 10mm; display: flex!important; align-items: center; justify-content: space-between; padding-top: 2mm; border-top: 1px solid var(--color-line); color: var(--color-muted); font-size: 6pt; }

  .ledger-summary-grid { display: grid!important; grid-template-columns: repeat(5, minmax(0, 1fr))!important; gap: 2mm!important; margin: 0 0 4mm!important; }
  .ledger-summary-card:last-child { grid-column: auto!important; }
  .ledger-summary-card { min-height: 14mm; padding: 2.5mm 3mm!important; border-radius: 2mm!important; break-inside: avoid; }
  .ledger-summary-card small { font-size: 5.5pt!important; letter-spacing: .04em!important; }
  .ledger-summary-card strong { margin-top: 1mm; font-size: 8.5pt!important; }

  .ledger-table-shell, .customer-ledger-transactions { overflow: visible!important; margin: 0!important; border-color: color-mix(in srgb, var(--color-primary) 28%, var(--color-line))!important; border-radius: 2.5mm!important; break-inside: auto; }
  .ledger-table-shell > header { min-height: 0!important; padding: 2.8mm 3mm!important; border-bottom-color: color-mix(in srgb, var(--color-primary) 28%, var(--color-line))!important; border-radius: 2.3mm 2.3mm 0 0!important; background: color-mix(in srgb, var(--color-accent-soft) 75%, #fff)!important; }
  .ledger-table-shell > header h2 { color: var(--color-primary)!important; font-size: 8pt!important; letter-spacing: .02em; }
  .ledger-table-heading { min-width: 0; }
  .ledger-print-table-period { display: none!important; }
  .ledger-table-header-actions > span { color: var(--color-muted)!important; font-size: 6pt!important; }
  .table-responsive { overflow: visible!important; }
  .ledger-report-table, .customer-ledger-table, .bank-ledger-table { width: 100%!important; min-width: 0!important; table-layout: auto!important; border-collapse: collapse!important; }
  .ledger-report-table thead { display: table-header-group; }
  .ledger-report-table tr { break-inside: avoid; }
  .ledger-report-table thead th { padding: 2.2mm 1.5mm!important; border-bottom: 1px solid var(--color-primary)!important; background: var(--color-primary)!important; color: var(--color-primary-text)!important; font-size: 6.2pt!important; letter-spacing: .025em!important; }
  .ledger-report-table tbody td { padding: 2.3mm 1.5mm!important; border-bottom: 1px solid color-mix(in srgb, var(--color-primary) 13%, var(--color-line))!important; color: var(--color-ink)!important; font-size: 7pt!important; line-height: 1.3!important; overflow-wrap: anywhere; white-space: normal!important; }
  .ledger-report-table tbody tr:only-child td { padding-block: 3.4mm!important; }
  .ledger-report-table tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--color-accent-soft) 30%, #fff)!important; }
  .ledger-report-table tbody td > small, .ledger-reference { font-size: 6.3pt!important; }
  .ledger-source { padding: 1mm 1.5mm!important; background: var(--color-accent-soft)!important; color: var(--color-primary)!important; font-size: 6pt!important; }
  .ledger-remarks { min-width: 0!important; max-width: none!important; }
  .ledger-table-footer { display: none!important; }
  a { color: var(--color-primary)!important; text-decoration: none!important; }
}
.customer-ledger-options { position: absolute; z-index: 1050; top: calc(100% + 7px); right: 0; left: 0; overflow: hidden; border: 1px solid #d5deea; border-radius: 12px; background: #fff; box-shadow: 0 14px 35px rgb(23 43 77 / 18%), 0 3px 10px rgb(23 43 77 / 8%); }
.customer-ledger-options[hidden] { display: none; }
.customer-ledger-options-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 12px; border-bottom: 1px solid #e7edf5; background: #f8fafd; }
.customer-ledger-options-head span { color: #43536a; font-size: .61rem; font-weight: 850; letter-spacing: .055em; text-transform: uppercase; }
.customer-ledger-options-head small { color: #7a8799; font-size: .59rem; font-weight: 700; }
.customer-ledger-options-list { max-height: 280px; overflow-y: auto; overscroll-behavior: contain; padding: 5px; scrollbar-color: #c7d2e2 transparent; scrollbar-width: thin; }
.customer-ledger-option { display: grid; width: 100%; grid-template-columns: 34px minmax(0, 1fr) auto 18px; align-items: center; gap: 10px; padding: 9px; border: 0; border-radius: 9px; background: transparent; color: #172033; text-align: left; transition: background-color .15s ease, color .15s ease; }
.customer-ledger-option:hover, .customer-ledger-option.is-active { background: #edf4ff; }
.customer-ledger-option[aria-selected="true"] { background: #e7f0fd; }
.customer-ledger-option-avatar { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid #cfe0f8; border-radius: 50%; background: #edf4ff; color: #1955a6; font-size: .7rem; font-weight: 850; }
.customer-ledger-option-details { min-width: 0; }
.customer-ledger-option-details strong { display: block; overflow: hidden; color: #172033; font-size: .72rem; font-weight: 800; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.customer-ledger-option-details small { display: flex; min-width: 0; align-items: center; gap: 7px; margin-top: 2px; color: #65748a; font-size: .6rem; font-weight: 600; }
.customer-ledger-option-details small span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.customer-ledger-option-details small span + span::before { margin-right: 7px; color: #b0bac8; content: "\2022"; }
.customer-ledger-option-loans { padding: 3px 7px; border-radius: 999px; background: #f0f3f7; color: #59687d; font-size: .57rem; font-weight: 800; white-space: nowrap; }
.customer-ledger-option-check { visibility: hidden; color: #1c5aab; font-size: .72rem; }
.customer-ledger-option[aria-selected="true"] .customer-ledger-option-check { visibility: visible; }
.customer-ledger-options-empty { padding: 24px 16px; text-align: center; }
.customer-ledger-options-empty[hidden] { display: none; }
.customer-ledger-options-empty > span { display: grid; width: 34px; height: 34px; margin: 0 auto 8px; place-items: center; border-radius: 50%; background: #eef3f8; color: #66768b; }
.customer-ledger-options-empty strong, .customer-ledger-options-empty small { display: block; }
.customer-ledger-options-empty strong { color: #243248; font-size: .7rem; }
.customer-ledger-options-empty small { margin-top: 3px; color: #758398; font-size: .61rem; }
.customer-ledger-alert { margin: 12px 16px 0; padding: 9px 12px; border-radius: 10px; font-size: .75rem; }
.customer-ledger-summary { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; padding: 12px 16px 0; }
.customer-ledger-summary article { min-width: 0; padding: 10px 12px; border: 1px solid var(--color-line); border-radius: 11px; background: #fff; }
.customer-ledger-summary small, .customer-ledger-profile dt { display: block; color: #64748b; font-size: .58rem; font-weight: 800; letter-spacing: .06em; line-height: 1.2; text-transform: uppercase; }
.customer-ledger-summary strong { display: block; overflow: hidden; margin-top: 5px; color: #172033; font-size: .92rem; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.customer-ledger-summary article:last-child { border-color: #b8d0f4; background: #edf4ff; }
.customer-ledger-summary article:last-child strong { color: #174f9c; }
.customer-ledger-profile { margin: 10px 16px; overflow: hidden; border: 1px solid var(--color-line); border-radius: 12px; background: #fff; }
.customer-ledger-profile h2, .customer-ledger-profile h3 { margin: 0; color: #172033; font-weight: 850; }
.customer-ledger-profile .customer-ledger-name { overflow: hidden; margin-bottom: 8px; font-size: .78rem; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.customer-ledger-profile-grid { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 1px; background: var(--color-line); }
.customer-ledger-profile-grid > article { min-width: 0; padding: 10px 12px; background: #fff; }
.customer-ledger-profile-grid > article:nth-child(1) { background: #fff0f3; }
.customer-ledger-profile-grid > article:nth-child(2) { background: #edf6ff; }
.customer-ledger-profile-grid > article:nth-child(3) { background: #fff6df; }
.customer-ledger-profile-grid h3 { margin-bottom: 8px; color: #1450a0; font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; }
.customer-ledger-profile dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; margin: 0; }
.customer-ledger-portfolio dl, .customer-ledger-exposure dl { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.customer-ledger-profile dl > div { min-width: 0; }
.customer-ledger-profile dl .wide { grid-column: 1 / -1; }
.customer-ledger-profile dd { overflow: hidden; margin: 2px 0 0; color: #162033; font-size: .7rem; font-weight: 700; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.customer-ledger-transactions { margin: 0 16px 14px; }
.customer-ledger-transactions > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.customer-ledger-transactions > header span { color: #64748b; font-size: .63rem; font-weight: 700; }
.customer-ledger-table { min-width: 940px; }
.ledger-report-empty small { display: block; margin-top: 5px; color: #7b8798; font-size: .68rem; font-weight: 500; }

/* Accounting transactions */
.accounting-transactions-page, .batch-report-page { display: grid; gap: 16px; }
.accounting-page-heading, .batch-report-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0; }
.accounting-page-heading h1, .batch-report-heading h1 { margin: 2px 0 3px; }
.accounting-page-heading p, .batch-report-heading p { margin: 0; }
.accounting-section-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.accounting-section-tabs { display: flex; align-items: center; gap: 5px; width: fit-content; padding: 4px; border: 1px solid var(--color-line); border-radius: 10px; background: var(--color-surface); }
.accounting-section-tabs a { display: inline-flex; min-height: 34px; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 7px; color: var(--color-muted); font-size: .69rem; font-weight: 800; text-decoration: none; }
.accounting-section-tabs a:hover { background: var(--color-surface-alt); color: var(--color-ink); }
.accounting-section-tabs a.active { background: var(--color-primary); color: var(--color-primary-text); box-shadow: 0 4px 10px color-mix(in srgb, var(--color-primary) 18%, transparent); }
.accounting-mode-bar { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--color-line); border-bottom: 1px solid var(--color-line); }
.accounting-mode-bar .btn { display: inline-flex; min-width: 74px; align-items: center; justify-content: center; gap: 6px; }
.accounting-toolbar-actions { display: flex; align-items: center; gap: 8px; }
.accounting-view-transaction, .accounting-dtr-link { display: inline-flex; min-height: 34px; align-items: center; justify-content: center; gap: 6px; }
.accounting-toolbar-actions .btn-dark { border-color: #3f4650; background: #3f4650; color: #fff; }
.accounting-toolbar-actions .btn-dark:hover, .accounting-toolbar-actions .btn-dark:focus { border-color: #30363d; background: #30363d; color: #fff; }
.accounting-balance-rule, .batch-report-health { display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid color-mix(in srgb, var(--color-success) 25%, var(--color-line)); border-radius: 999px; background: color-mix(in srgb, var(--color-success-bg) 70%, var(--color-surface)); color: var(--color-success); font-size: .7rem; font-weight: 800; white-space: nowrap; }
.accounting-summary-grid, .batch-report-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.accounting-summary-grid article, .batch-report-summary article { display: flex; min-width: 0; align-items: center; gap: 11px; padding: 13px 15px; border: 1px solid var(--color-line); border-radius: 12px; background: var(--color-surface); }
.accounting-summary-grid article > span, .batch-report-summary article > span { display: grid; width: 36px; height: 36px; flex: none; place-items: center; border-radius: 10px; background: var(--color-accent-soft); color: var(--color-primary); }
.accounting-summary-grid article > div, .batch-report-summary article > div { display: grid; min-width: 0; gap: 1px; }
.accounting-summary-grid small, .batch-report-summary small { color: var(--color-muted); font-size: .62rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.accounting-summary-grid strong, .batch-report-summary strong { color: var(--color-ink); font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.accounting-transfer-card { width: min(100%, 980px); margin: 0 auto; overflow: hidden; border: 1px solid var(--color-line); border-radius: 14px; background: var(--color-surface); }
.accounting-history-card, .batch-report-surface { overflow: hidden; border-radius: 14px; }
.accounting-history-card > header { display: flex; min-height: 62px; align-items: center; gap: 11px; padding: 12px 15px; border-bottom: 1px solid var(--color-line); background: var(--color-surface-alt); }
.accounting-transfer-card h2, .accounting-history-card h2 { margin: 0; font-size: .9rem; font-weight: 850; }
.accounting-transfer-card header p, .accounting-history-card header p { margin: 2px 0 0; color: var(--color-muted); font-size: .68rem; }
.accounting-transfer-form { display: grid; gap: 20px; padding: 20px; }
.accounting-transfer-form label { display: grid; min-width: 0; gap: 5px; margin: 0; }
.accounting-transfer-form label > span, .accounting-history-filters label > span { color: var(--color-muted); font-size: .61rem; font-style: normal; font-weight: 800; letter-spacing: .035em; text-transform: uppercase; }
.accounting-transfer-form label > span em { float: right; font-size: .57rem; font-style: normal; font-weight: 650; letter-spacing: 0; text-transform: none; }
.accounting-transfer-form label > small { color: var(--color-muted); font-size: .61rem; }
.accounting-ledger-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.accounting-ledger-side { overflow: hidden; border: 1px solid var(--color-line); border-radius: 13px; }
.accounting-ledger-side > header { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--color-line); background: var(--color-surface-alt); }
.accounting-ledger-side > header > span { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 8px; }
.accounting-ledger-side > header strong { color: var(--color-ink); font-size: .82rem; }
.accounting-ledger-side--debit > header > span { background: var(--color-danger-bg); color: var(--color-danger); }
.accounting-ledger-side--credit > header > span { background: var(--color-success-bg); color: var(--color-success); }
.accounting-ledger-fields { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: start; gap: 10px; padding: 14px; }
.accounting-ledger-fields [data-ledger-account][hidden] { display: none !important; }
.accounting-ledger-fields label > small { min-height: 15px; }
.accounting-ledger-fields label > small strong { color: var(--color-ink); }
.accounting-transaction-fields { display: grid; grid-template-columns: minmax(230px, .75fr) minmax(0, 1.8fr); gap: 16px; }
.accounting-transaction-meta { display: grid; align-content: start; gap: 12px; }
.accounting-particulars textarea { min-height: 112px; resize: vertical; }
.accounting-particulars > small { text-align: right; }
.accounting-submit-row { display: flex; justify-content: center; padding-top: 16px; border-top: 1px solid var(--color-line); }
.accounting-post-button { display: inline-flex; min-width: 140px; align-items: center; justify-content: center; gap: 7px; min-height: 42px; font-weight: 800; }
.accounting-history-filters { display: grid; grid-template-columns: minmax(220px, 1fr) 130px 130px 40px; align-items: end; gap: 8px; padding: 11px 12px; border-bottom: 1px solid var(--color-line); }
.accounting-history-filters label { display: grid; gap: 4px; margin: 0; }
.accounting-filter-search, .batch-filter-search { position: relative; }
.accounting-filter-search > i, .batch-filter-search > i { position: absolute; top: 50%; left: 11px; z-index: 2; color: var(--color-muted); transform: translateY(-50%); }
.accounting-filter-search .form-control, .batch-filter-search .form-control { padding-left: 32px; }
.accounting-history-filters .btn { width: 40px; height: 38px; display: grid; padding: 0; place-items: center; }
.accounting-transfers-table { min-width: 1180px; }
.accounting-transfers-table thead th, .batch-report-table thead th { padding: 9px 10px; border-bottom-color: var(--color-line); background: var(--color-surface-alt); color: var(--color-muted); font-size: .57rem; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.accounting-transfers-table tbody td, .batch-report-table tbody td { padding: 10px; border-bottom-color: var(--color-line); color: var(--color-ink); font-size: .67rem; vertical-align: middle; }
.accounting-transfers-table tbody td > small, .batch-report-table tbody td > small { display: block; max-width: 220px; margin-top: 2px; color: var(--color-muted); font-size: .58rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.accounting-transfers-table .empty-state, .batch-report-table .empty-state { display: flex; min-height: 95px; align-items: center; justify-content: center; flex-direction: column; gap: 3px; color: var(--color-muted); text-align: center; }
.accounting-transfers-table .empty-state > i, .batch-report-table .empty-state > i { margin-bottom: 3px; color: var(--color-primary); font-size: 1rem; }
.accounting-transfers-table .empty-state > strong, .batch-report-table .empty-state > strong { color: var(--color-ink); font-size: .72rem; }
.accounting-transfers-table .empty-state > span, .batch-report-table .empty-state > span { font-size: .62rem; }
.accounting-transaction-id, .batch-run-reference { color: var(--color-primary); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .61rem; font-weight: 800; }
.accounting-status { display: inline-flex!important; width: fit-content; padding: 2px 6px; border-radius: 999px; background: var(--color-success-bg); color: var(--color-success)!important; font-weight: 850; }
.accounting-transfer-arrow { width: 30px; color: var(--color-primary)!important; text-align: center; }
.accounting-transfer-amount { color: var(--color-ink); font-size: .75rem!important; font-weight: 850; white-space: nowrap; }
.accounting-pagination, .batch-report-pagination { display: flex; min-height: 49px; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border-top: 1px solid var(--color-line); color: var(--color-muted); font-size: .64rem; }
.accounting-pagination > div, .batch-report-pagination > div { display: flex; align-items: center; gap: 9px; }

/* Journal transaction lookup */
.journal-transaction-view { overflow: hidden; width: min(100%, 1160px); margin: 0 auto; border-radius: 14px; }
.journal-transaction-view > header { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--color-line); background: var(--color-surface-alt); }
.journal-transaction-view > header > span { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 9px; background: var(--color-accent-soft); color: var(--color-primary); }
.journal-transaction-view h2 { margin: 0; color: var(--color-ink); font-size: .86rem; font-weight: 850; }
.journal-transaction-view header p { margin: 2px 0 0; color: var(--color-muted); font-size: .64rem; }
.journal-view-search { display: grid; grid-template-columns: minmax(180px, .7fr) minmax(260px, 1.3fr) max-content; align-items: end; gap: 10px; padding: 14px; border-bottom: 1px solid var(--color-line); }
.journal-view-search label { display: grid; gap: 5px; margin: 0; }
.journal-view-search label > span { color: var(--color-muted); font-size: .59rem; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.journal-view-search .btn { display: inline-flex; min-height: 38px; align-items: center; gap: 7px; font-weight: 800; }
.journal-view-empty { display: flex; min-height: 260px; align-items: center; justify-content: center; flex-direction: column; gap: 5px; padding: 28px; color: var(--color-muted); text-align: center; }
.journal-view-empty > i { display: grid; width: 42px; height: 42px; place-items: center; margin-bottom: 4px; border-radius: 11px; background: var(--color-accent-soft); color: var(--color-primary); font-size: 1.05rem; }
.journal-view-empty strong { color: var(--color-ink); font-size: .76rem; }
.journal-view-empty span { font-size: .64rem; }
.journal-view-details { padding: 14px; }
.journal-view-details > header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 12px; border: 1px solid var(--color-line); border-radius: 10px 10px 0 0; background: var(--color-surface-alt); }
.journal-view-details > header > div { display: grid; gap: 2px; }
.journal-view-details > header > div span { color: var(--color-muted); font-size: .57rem; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.journal-view-details > header > div strong { color: var(--color-primary); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .72rem; }
.journal-view-details > header .accounting-status { align-items: center; gap: 5px; padding: 5px 8px; }
.journal-view-meta { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0 0 12px; border: 1px solid var(--color-line); border-top: 0; border-radius: 0 0 10px 10px; }
.journal-view-meta > div { min-width: 0; padding: 9px 10px; border-right: 1px solid var(--color-line); }
.journal-view-meta > div:last-child { border-right: 0; }
.journal-view-meta dt, .journal-entry-side dt { color: var(--color-muted); font-size: .56rem; font-weight: 850; letter-spacing: .035em; text-transform: uppercase; }
.journal-view-meta dd { overflow: hidden; margin: 3px 0 0; color: var(--color-ink); font-size: .66rem; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.journal-entry-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.journal-entry-side { overflow: hidden; border: 1px solid var(--color-line); border-radius: 11px; }
.journal-entry-side > header { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border-bottom: 1px solid var(--color-line); background: var(--color-surface-alt); }
.journal-entry-side > header > span { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 7px; }
.journal-entry-side--debit > header > span { background: var(--color-danger-bg); color: var(--color-danger); }
.journal-entry-side--credit > header > span { background: var(--color-success-bg); color: var(--color-success); }
.journal-entry-side > header strong { color: var(--color-ink); font-size: .72rem; }
.journal-entry-side dl { margin: 0; }
.journal-entry-side .journal-entry-line + .journal-entry-line { border-top: 4px solid var(--color-line); }
.journal-entry-side dl > div { display: grid; grid-template-columns: 145px 1fr; border-bottom: 1px solid var(--color-line); }
.journal-entry-side dl > div:last-child { border-bottom: 0; }
.journal-entry-side dt, .journal-entry-side dd { margin: 0; padding: 8px 10px; }
.journal-entry-side dt { background: var(--color-surface-alt); }
.journal-entry-side dd { color: var(--color-ink); font-size: .66rem; font-weight: 700; overflow-wrap: anywhere; }

/* Cash and bank transaction workspace */
.cash-bank-account-section { overflow: hidden; border: 1px solid color-mix(in srgb, var(--color-primary) 22%, var(--color-line)); border-radius: 13px; background: var(--color-surface); box-shadow: 0 8px 24px color-mix(in srgb, var(--color-ink) 10%, transparent); }
.cash-bank-account-section > header { display: flex; min-height: 60px; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 14px; border-bottom: 1px solid color-mix(in srgb, var(--color-primary) 18%, var(--color-line)); background: color-mix(in srgb, var(--color-primary) 10%, var(--color-surface)); }
.cash-bank-account-section > header > div { display: flex; align-items: center; gap: 10px; }
.cash-bank-account-section > header > div > span, .cash-bank-movement-card > header > div > span { display: grid; width: 34px; height: 34px; flex: none; place-items: center; border-radius: 9px; background: var(--color-accent-soft); color: var(--color-primary); }
.cash-bank-account-section h2, .cash-bank-movement-card h2 { margin: 0; color: var(--color-ink); font-size: .86rem; font-weight: 850; }
.cash-bank-account-section header p, .cash-bank-movement-card header p { margin: 2px 0 0; color: var(--color-muted); font-size: .65rem; }
.cash-bank-account-section > header > strong { padding: 4px 8px; border-radius: 999px; background: var(--color-success-bg); color: var(--color-success); font-size: .61rem; font-weight: 850; }
.cash-bank-account-table { min-width: 980px; }
.cash-bank-account-table thead th { padding: 9px 12px; background: color-mix(in srgb, var(--color-primary) 7%, var(--color-surface)); color: var(--color-muted); font-size: .58rem; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.cash-bank-account-table tbody td { padding: 11px 12px; border-bottom-color: var(--color-line); color: var(--color-ink); font-size: .69rem; vertical-align: middle; }
.cash-bank-account-table tbody tr:last-child td { border-bottom: 0; }
.cash-bank-account-table td small { display: block; margin-top: 2px; color: var(--color-muted); font-size: .58rem; }
.cash-bank-account-table .account-number { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 750; }
.cash-bank-action { display: inline-flex; min-width: 118px; align-items: center; justify-content: center; gap: 6px; font-weight: 800; white-space: nowrap; }
.cash-bank-movement-card { overflow: hidden; width: min(100%, 1120px); margin: 0 auto; border-radius: 14px; }
.cash-bank-movement-card > header { display: flex; align-items: center; justify-content: flex-start; gap: 11px; padding: 13px 15px; border-bottom: 1px solid var(--color-line); background: var(--color-surface-alt); }
.cash-bank-movement-card > header > div { display: flex; align-items: center; gap: 11px; }
.cash-bank-movement-card > header > .btn { display: inline-flex; align-items: center; gap: 6px; font-weight: 750; }
.cash-bank-movement-form { display: grid; grid-template-columns: minmax(300px, .72fr) minmax(0, 1.45fr); gap: 18px; padding: 17px; }
.cash-denomination-panel { overflow: hidden; align-self: start; border: 1px solid var(--color-line); border-radius: 11px; }
.cash-denomination-heading { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--color-line); background: var(--color-surface-alt); }
.cash-denomination-heading strong { font-size: .73rem; }
.cash-denomination-heading span { color: var(--color-muted); font-size: .6rem; }
.cash-denomination-table { display: grid; }
.cash-denomination-table .head, .cash-denomination-table label, .cash-denomination-table .total { display: grid; grid-template-columns: 90px 1fr 105px; align-items: center; gap: 8px; min-height: 39px; margin: 0; padding: 5px 9px; border-bottom: 1px solid var(--color-line); }
.cash-denomination-table .head { min-height: 31px; background: color-mix(in srgb, var(--color-primary) 7%, var(--color-surface)); color: var(--color-muted); font-size: .57rem; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.cash-denomination-table label > span { color: var(--color-ink); font-size: .67rem; font-weight: 750; }
.cash-denomination-table label .form-control { min-height: 30px; padding: 4px 8px; font-size: .68rem; }
.cash-denomination-table label strong, .cash-denomination-table .total strong { color: var(--color-muted); font-size: .66rem; text-align: right; }
.cash-denomination-table .total { border-bottom: 0; background: var(--color-accent-soft); }
.cash-denomination-table .total span:first-child, .cash-denomination-table .total strong { color: var(--color-primary); font-weight: 850; }
.cash-movement-details { display: grid; align-content: start; gap: 15px; }
.cash-movement-account-summary { display: grid; grid-template-columns: 1fr 28px 1fr; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--color-line); border-radius: 11px; background: var(--color-surface-alt); }
.cash-movement-account-summary > div { display: grid; min-width: 0; gap: 3px; }
.cash-movement-account-summary small { color: var(--color-muted); font-size: .57rem; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.cash-movement-account-summary strong { overflow: hidden; color: var(--color-ink); font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.cash-movement-account-summary span { color: var(--color-muted); font-size: .6rem; }
.cash-movement-account-summary > i { color: var(--color-primary); text-align: center; }
.cash-movement-field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cash-movement-field-grid label { display: grid; gap: 5px; margin: 0; }
.cash-movement-field-grid label > span { color: var(--color-muted); font-size: .59rem; font-weight: 850; letter-spacing: .035em; text-transform: uppercase; }
.cash-movement-field-grid .wide { grid-column: 1 / -1; }
.cash-movement-field-grid textarea { resize: vertical; }
.cash-movement-submit { display: flex; justify-content: center; padding-top: 14px; border-top: 1px solid var(--color-line); }
.cash-movement-submit .btn { display: inline-flex; min-width: 170px; align-items: center; justify-content: center; gap: 7px; min-height: 40px; font-weight: 800; }

/* Daily transaction report */
.dtr-workspace { overflow: hidden; border-radius: 14px; }
.dtr-page-heading { justify-content: flex-start; }
.dtr-back { display: inline-flex; width: 36px; min-height: 36px; align-items: center; justify-content: center; padding-inline: 0; font-weight: 800; }
.dtr-actions { display: flex; align-items: center; gap: 6px; }
.dtr-actions .btn { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; gap: 5px; font-weight: 800; white-space: nowrap; }
.dtr-refresh { width: 34px; padding-inline: 0; }
.dtr-controls { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding: 10px 12px; border-bottom: 1px solid var(--color-line); }
.dtr-summary { display: grid; width: min(548px, 100%); min-width: 0; flex: 0 1 548px; grid-template-columns: 150px repeat(2, 192px); gap: 7px; margin-left: auto; }
.dtr-stat { display: flex; min-width: 0; align-items: center; gap: 8px; padding: 8px 9px; border: 1px solid var(--color-line); border-radius: 9px; background: var(--color-surface); }
.dtr-stat > span { display: grid; width: 31px; height: 31px; flex: none; place-items: center; border-radius: 8px; }
.dtr-stat > div { display: grid; min-width: 0; gap: 1px; }
.dtr-stat small { color: var(--color-muted); font-size: .56rem; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.dtr-stat strong { overflow: hidden; color: var(--color-ink); font-size: .86rem; text-overflow: ellipsis; white-space: nowrap; }
.dtr-stat--transactions > span { background: var(--color-accent-soft); color: var(--color-primary); }
.dtr-stat--debit > span { background: var(--color-danger-bg); color: var(--color-danger); }
.dtr-stat--credit > span { background: var(--color-success-bg); color: var(--color-success); }
.dtr-filters { display: grid; grid-template-columns: 130px 130px max-content; align-items: end; gap: 7px; }
.dtr-filters label { display: grid; gap: 4px; margin: 0; }
.dtr-filters label > span { color: var(--color-muted); font-size: .56rem; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.dtr-filters .btn { min-height: 38px; font-weight: 800; }
.dtr-table-actions { display: flex; min-height: 48px; align-items: center; justify-content: flex-end; padding: 5px 12px; border-bottom: 1px solid var(--color-line); background: var(--color-surface-alt); }
.dtr-workspace > .table-responsive { overflow-x: hidden; overscroll-behavior-inline: contain; scrollbar-width: thin; }
.dtr-workspace > .table-responsive::-webkit-scrollbar { height: 10px; }
.dtr-workspace > .table-responsive::-webkit-scrollbar-track { background: var(--color-surface-alt); }
.dtr-workspace > .table-responsive::-webkit-scrollbar-thumb { border: 2px solid var(--color-surface-alt); border-radius: 999px; background: color-mix(in srgb, var(--color-muted) 45%, transparent); }
.dtr-table { width: 100%; min-width: 0; table-layout: fixed; }
.dtr-table th:nth-child(1) { width: 13%; }
.dtr-table th:nth-child(2) { width: 14%; }
.dtr-table th:nth-child(3) { width: 15%; }
.dtr-table th:nth-child(4) { width: 7%; }
.dtr-table th:nth-child(5) { width: 11%; }
.dtr-table th:nth-child(6) { width: 24%; }
.dtr-table th:nth-child(7) { width: 16%; }
.dtr-table th:nth-child(4), .dtr-table tbody td:nth-child(4) { text-align: center; }
.dtr-table thead th { padding: 7px 6px; border-bottom-color: var(--color-line); background: var(--color-surface-alt); color: var(--color-muted); font-size: .48rem; font-weight: 850; letter-spacing: .02em; line-height: 1.15; text-transform: uppercase; white-space: normal; }
.dtr-table tbody td { min-width: 0; padding: 8px 6px; border-bottom-color: var(--color-line); color: var(--color-ink); font-size: .56rem; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; white-space: nowrap; }
.dtr-table td small { display: block; margin-top: 2px; color: var(--color-muted); font-size: .54rem; }
.dtr-lan-customer strong, .dtr-lan-customer small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dtr-table code { color: var(--color-ink); font-size: .58rem; white-space: nowrap; }
.dtr-reference { display: block; overflow: hidden; color: var(--color-primary); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .55rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.dtr-side { display: inline-flex; min-width: 27px; justify-content: center; padding: 3px 5px; border-radius: 5px; font-size: .56rem; font-weight: 850; }
.dtr-side--dr { background: var(--color-danger-bg); color: var(--color-danger); }
.dtr-side--cr { background: var(--color-success-bg); color: var(--color-success); }
.dtr-particulars { display: block; max-width: none; line-height: 1.35; overflow: visible; overflow-wrap: anywhere; text-overflow: clip; white-space: normal; }
.dtr-table tfoot td { padding: 9px 12px; border: 0; background: var(--color-surface-alt); }
.dtr-table-totals { display: flex; align-items: center; justify-content: flex-end; gap: 24px; color: var(--color-muted); font-size: .62rem; }
.dtr-table-totals strong { margin-left: 3px; font-size: .67rem; }
.dtr-table-totals span:first-child strong { color: var(--color-danger); }
.dtr-table-totals span:last-child strong { color: var(--color-success); }
.dtr-empty { display: flex; min-height: 115px; align-items: center; justify-content: center; flex-direction: column; gap: 5px; color: var(--color-muted); }
.dtr-empty i { color: color-mix(in srgb, var(--color-primary) 45%, var(--color-line)); font-size: .8rem; }
.dtr-empty strong { color: var(--color-ink); font-size: .68rem; }
.dtr-pagination { display: flex; min-height: 46px; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 12px; border-top: 1px solid var(--color-line); color: var(--color-muted); font-size: .62rem; }
.dtr-pagination > div { display: flex; align-items: center; gap: 8px; }

/* Batch run reports */
.batch-report-page { gap: 0; }
.batch-report-workspace { overflow: hidden; border-radius: 15px; }
.batch-report-primary-row { min-height: 68px; padding: 13px 16px; border-bottom: 1px solid var(--color-line); }
.batch-report-primary-row h1 { margin: 2px 0 0; color: var(--color-ink); font-size: 1.2rem; font-weight: 850; }
.batch-report-subtabs { display: flex; min-height: 54px; align-items: center; gap: 6px; padding: 8px 16px; border-bottom: 1px solid var(--color-line); background: var(--color-surface-alt); }
.batch-report-subtabs a { display: inline-flex; min-height: 36px; align-items: center; justify-content: center; padding: 7px 16px; border: 1px solid var(--color-line); border-radius: 7px; background: var(--color-surface); color: var(--color-ink); font-size: .7rem; font-weight: 800; text-decoration: none; white-space: nowrap; }
.batch-report-subtabs a:hover { border-color: color-mix(in srgb, var(--color-primary) 38%, var(--color-line)); color: var(--color-primary); }
.batch-report-subtabs .active { border-color: var(--color-primary); background: var(--color-primary); color: var(--color-primary-text); box-shadow: 0 4px 10px color-mix(in srgb, var(--color-primary) 18%, transparent); }
.batch-report-filters { display: grid; grid-template-columns: 155px 155px 190px max-content 1fr 38px; align-items: end; gap: 8px; padding: 13px 16px; border-bottom: 1px solid var(--color-line); }
.batch-report-filters label { display: grid; gap: 5px; margin: 0; }
.batch-report-filters label > span { color: var(--color-muted); font-size: .59rem; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.batch-report-generate { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; gap: 7px; padding-inline: 17px; font-weight: 800; }
.batch-report-refresh { display: inline-grid; grid-column: -2 / -1; width: 38px; height: 38px; padding: 0; place-items: center; }
.batch-report-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--color-line); background: color-mix(in srgb, var(--color-surface-alt) 48%, var(--color-surface)); }
.batch-report-totals article { display: flex; min-width: 0; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--color-line); border-radius: 10px; background: var(--color-surface); }
.batch-report-totals article > div { display: grid; gap: 1px; }
.batch-report-totals small { color: var(--color-muted); font-size: .58rem; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.batch-report-totals strong { color: var(--color-ink); font-size: 1rem; }
.batch-report-total-icon { display: grid; width: 32px; height: 32px; flex: none; place-items: center; border-radius: 9px; background: var(--color-accent-soft); color: var(--color-primary); }
.batch-report-total-icon.is-success { background: var(--color-success-bg); color: var(--color-success); }
.batch-report-total-icon.is-failed { background: var(--color-danger-bg); color: var(--color-danger); }
.batch-report-table { min-width: 1260px; }
.batch-report-table code { color: var(--color-ink); font-size: .63rem; white-space: nowrap; }
.batch-status { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 999px; font-size: .58rem; font-weight: 850; }
.batch-status--success { background: var(--color-success-bg); color: var(--color-success); }
.batch-status--failed { background: var(--color-danger-bg); color: var(--color-danger); }
.batch-status--running { background: var(--color-warning-bg); color: var(--color-warning); }
.batch-status--upcoming { background: var(--color-accent-soft); color: var(--color-primary); }
.batch-status--due, .batch-status--partial { background: var(--color-warning-bg); color: var(--color-warning); }
.batch-status--overdue { background: var(--color-danger-bg); color: var(--color-danger); }
.batch-status--collected { background: var(--color-success-bg); color: var(--color-success); }
.batch-report-action { display: inline-flex; align-items: center; gap: 3px; color: var(--color-primary); font-size: .62rem; font-weight: 800; white-space: nowrap; }
.batch-error { display: block; max-width: 240px; color: var(--color-danger); font-size: .62rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.batch-response-counts { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.batch-response-counts span { display: inline-flex; align-items: center; gap: 3px; padding: 3px 5px; border: 1px solid var(--color-line); border-radius: 5px; color: var(--color-muted); font-size: .54rem; font-weight: 700; }
.batch-response-counts strong { color: inherit; font-size: .58rem; }
.batch-response-counts .batch-response-count--scheduled { border-color: color-mix(in srgb, var(--color-warning) 32%, var(--color-line)); background: var(--color-warning-bg); color: var(--color-warning); }
.batch-response-counts .batch-response-count--successful { border-color: color-mix(in srgb, var(--color-success) 32%, var(--color-line)); background: var(--color-success-bg); color: var(--color-success); }
.batch-response-counts .batch-response-count--failed { border-color: color-mix(in srgb, var(--color-danger) 32%, var(--color-line)); background: var(--color-danger-bg); color: var(--color-danger); }
.batch-response-message { display: block; margin-top: 4px; color: var(--color-muted); font-size: .56rem; }
.batch-details { margin-top: 4px; }
.batch-details summary { color: var(--color-primary); cursor: pointer; font-size: .62rem; font-weight: 800; }
.batch-details dl { display: grid; min-width: 230px; gap: 5px; margin: 8px 0 0; padding: 8px; border: 1px solid var(--color-line); border-radius: 8px; background: var(--color-surface-alt); }
.batch-details dl > div { display: flex; justify-content: space-between; gap: 12px; }
.batch-details dt, .batch-details dd { margin: 0; font-size: .59rem; }
.batch-details dt { color: var(--color-muted); font-weight: 700; }
.batch-details dd { color: var(--color-ink); font-weight: 800; text-align: right; }

@media (max-width: 1180px) {
  .dtr-controls { align-items: stretch; flex-direction: column; }
  .dtr-summary { width: 100%; flex-basis: auto; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-left: 0; }
  .dtr-workspace > .table-responsive { overflow-x: auto; }
  .dtr-table { width: 1250px; min-width: 1250px; }
  .batch-report-filters { grid-template-columns: 1fr 1fr 1fr max-content 38px; }
  .batch-report-refresh { grid-column: auto; }
}
@media (max-width: 767px) {
  .accounting-page-heading, .batch-report-heading { align-items: flex-start; flex-direction: column; }
  .accounting-section-toolbar { align-items: stretch; flex-direction: column; }
  .accounting-toolbar-actions { justify-content: flex-end; }
  .accounting-section-tabs { width: 100%; }
  .accounting-section-tabs a { flex: 1; justify-content: center; }
  .accounting-view-transaction { align-self: flex-end; }
  .dtr-controls { align-items: stretch; flex-direction: column; }
  .dtr-actions { flex-wrap: wrap; justify-content: flex-end; }
  .dtr-summary, .dtr-filters { grid-template-columns: 1fr; }
  .accounting-summary-grid, .batch-report-summary { grid-template-columns: 1fr; }
  .batch-report-totals { grid-template-columns: 1fr; }
  .accounting-ledger-pair, .accounting-ledger-fields, .accounting-transaction-fields, .accounting-history-filters, .batch-report-filters { grid-template-columns: 1fr; }
  .accounting-transfer-form { padding: 13px; }
  .cash-bank-movement-form { grid-template-columns: 1fr; padding: 12px; }
  .journal-view-search, .journal-view-meta, .journal-entry-pair { grid-template-columns: 1fr; }
  .journal-view-meta > div { border-right: 0; border-bottom: 1px solid var(--color-line); }
  .journal-view-meta > div:last-child { border-bottom: 0; }
  .cash-movement-account-summary, .cash-movement-field-grid { grid-template-columns: 1fr; }
  .cash-movement-account-summary > i { transform: rotate(90deg); }
  .cash-movement-field-grid .wide { grid-column: auto; }
  .batch-report-subtabs { overflow-x: auto; }
  .batch-report-filters { grid-template-columns: 1fr; }
  .batch-report-refresh { grid-column: auto; justify-self: end; }
  .accounting-history-filters .btn, .batch-report-filters .btn-primary { width: 100%; }
}

/* Master interest batch control */
.interest-batch-settings-form { overflow: hidden; margin: 14px 16px 16px; border-radius: 14px; }
.interest-batch-settings-form .master-heading { margin: 0; padding: 14px; border-bottom: 1px solid var(--color-line); }
.interest-batch-settings-body { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px; }
.interest-batch-settings-body .lifecycle-setting-card > input.form-control { width: 120px; flex: 0 0 120px; }
.asset-quality-report-page { display: grid; gap: 13px; }
.asset-quality-report-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.asset-quality-report-heading h1 { margin: 2px 0 3px; }
.asset-quality-report-heading p { margin: 0; color: var(--color-muted); }
.asset-quality-report-actions { display: flex; gap: 8px; }
.asset-quality-report-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; }
.asset-quality-report-stat { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--color-line); border-radius: 12px; background: var(--color-surface); }
.asset-quality-report-stat > span { color: var(--color-muted); font-size: .6rem; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.asset-quality-report-stat > strong { color: var(--color-ink); font-size: 1.15rem; }
.asset-quality-report-stat > small { color: var(--color-muted); font-size: .61rem; }
.asset-quality-report-stat.sma-0, .asset-quality-report-stat.sma-1, .asset-quality-report-stat.sma-2 { border-top: 3px solid #e68a2e; }
.asset-quality-report-stat.npa { border-top: 3px solid var(--color-danger); }
.asset-quality-report-surface { overflow: hidden; border-radius: 14px; }
.asset-quality-report-filters { display: grid; grid-template-columns: minmax(220px, 1.4fr) 150px minmax(190px, 1fr) 145px 145px max-content max-content; align-items: end; gap: 8px; padding: 13px 15px; border-bottom: 1px solid var(--color-line); }
.asset-quality-report-filters label { display: grid; gap: 5px; margin: 0; }
.asset-quality-report-filters label > span { color: var(--color-muted); font-size: .57rem; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.asset-quality-report-search > div { position: relative; }
.asset-quality-report-search i { position: absolute; top: 50%; left: 11px; transform: translateY(-50%); color: var(--color-muted); }
.asset-quality-report-search input { padding-left: 32px; }
.asset-quality-report-totals { display: flex; gap: 22px; padding: 10px 15px; border-bottom: 1px solid var(--color-line); background: var(--color-surface-alt); color: var(--color-muted); font-size: .65rem; }
.asset-quality-report-totals strong { margin-right: 4px; color: var(--color-ink); }
.asset-quality-report-table { min-width: 1220px; }
.asset-quality-report-table thead th { padding: 8px 9px; border-bottom-color: var(--color-line); background: var(--color-surface-alt); color: var(--color-muted); font-size: .56rem; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.asset-quality-report-table tbody td { padding: 9px; border-bottom-color: var(--color-line); color: var(--color-ink); font-size: .66rem; vertical-align: middle; }
.asset-quality-report-table tbody td small { display: block; margin-top: 2px; color: var(--color-muted); font-size: .58rem; }
.asset-quality-report-badge { display: inline-flex; padding: 5px 8px; border-radius: 999px; background: var(--color-success-bg); color: var(--color-success); font-size: .59rem; font-weight: 850; white-space: nowrap; }
.asset-quality-report-badge.sma-0, .asset-quality-report-badge.sma-1, .asset-quality-report-badge.sma-2 { background: #fff0df; color: #c45b12; }
.asset-quality-report-badge.npa { background: var(--color-danger-bg); color: var(--color-danger); }
@media (max-width: 1400px) {
  .asset-quality-report-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .asset-quality-report-filters { grid-template-columns: 1.4fr 1fr 1.2fr; }
}
@media (max-width: 700px) {
  .asset-quality-report-heading { align-items: flex-start; flex-direction: column; }
  .asset-quality-report-actions { width: 100%; }
  .asset-quality-report-actions .btn { flex: 1; }
  .asset-quality-report-summary, .asset-quality-report-filters { grid-template-columns: 1fr; }
  .asset-quality-report-totals { align-items: flex-start; flex-direction: column; gap: 5px; }
}
@media print {
  .asset-quality-report-actions, .asset-quality-report-filters, .admin-sidebar, .topbar, .bottom-nav { display: none!important; }
  .asset-quality-report-page { display: block; }
  .asset-quality-report-summary { margin-bottom: 8mm; }
  .asset-quality-report-table { min-width: 0; }
}
@media (max-width: 767px) {
  .interest-batch-settings-body { grid-template-columns: 1fr; }
  .interest-batch-settings-form { margin-inline: 10px; }
}
@media (max-width: 1100px) {
  .customer-ledger-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .customer-ledger-filters { grid-template-columns: minmax(0, 1fr) 145px 145px max-content; }
  .customer-ledger-filters > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 820px) {
  .customer-ledger-filters { grid-template-columns: 1fr 1fr; }
  .customer-ledger-filters > .customer-ledger-loan-field { grid-column: 1 / -1; }
  .customer-ledger-profile-grid { grid-template-columns: 1fr; }
  .customer-ledger-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .customer-ledger-summary { grid-template-columns: 1fr; }
  .customer-ledger-profile dl { grid-template-columns: 1fr; }
  .customer-ledger-profile dl .wide { grid-column: auto; }
}
@media print {
  .customer-ledger-summary { display: grid!important; grid-template-columns: repeat(3, minmax(0, 1fr))!important; gap: 2mm!important; margin: 0 0 3mm!important; padding: 0!important; }
  .customer-ledger-summary article { padding: 2.2mm 2.8mm!important; border-radius: 2mm!important; break-inside: avoid; }
  .customer-ledger-summary small { font-size: 5.3pt!important; }
  .customer-ledger-summary strong { margin-top: 1mm!important; font-size: 8pt!important; }
  .customer-ledger-profile { display: block!important; margin: 0 0 4mm!important; border-radius: 2mm!important; break-inside: avoid; }
  .customer-ledger-profile-grid { grid-template-columns: 1.1fr 1fr 1fr!important; }
  .customer-ledger-profile-grid > article { padding: 2.4mm 2.8mm!important; }
  .customer-ledger-profile-grid h3 { margin-bottom: 1.5mm!important; font-size: 5.5pt!important; }
  .customer-ledger-profile .customer-ledger-name { margin-bottom: 1.5mm!important; font-size: 7.5pt!important; }
  .customer-ledger-profile dl { gap: 1.5mm 2.5mm!important; }
  .customer-ledger-profile dt { font-size: 5pt!important; }
  .customer-ledger-profile dd { font-size: 6.2pt!important; }
  .customer-ledger-transactions { margin-inline: 0; }
}

/* Business rule engine */
.bre-assessment{overflow:hidden;border:1px solid var(--color-line);border-radius:14px;background:var(--color-surface);box-shadow:var(--shadow-sm)}
.bre-assessment-heading{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:18px 20px;border-bottom:1px solid var(--color-line)}
.bre-assessment-heading h2{margin:2px 0 3px;font-size:1.18rem;font-weight:850}.bre-assessment-heading p{margin:0;color:var(--color-muted);font-size:.78rem}.bre-assessment-actions{display:flex;align-items:center;gap:10px}.bre-assessment-actions form{margin:0}
.bre-frozen-badge{display:inline-flex;align-items:center;gap:6px;padding:7px 10px;border:1px solid #cbd5e1;border-radius:999px;background:#f1f5f9;color:#475569;font-size:.7rem;font-weight:800}
.bre-summary-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px;padding:16px 20px}.bre-summary-grid>div{min-height:68px;padding:11px 13px;border:1px solid var(--color-line);border-radius:10px;background:#f8fafc}.bre-summary-grid small{display:block;color:var(--color-muted);font-size:.64rem;font-weight:750}.bre-summary-grid strong{display:block;margin-top:4px;font-size:1.05rem}.bre-summary-grid .is-pass{border-color:#b8e7cd;background:#ecfdf3;color:#087443}.bre-summary-grid .is-fail{border-color:#fecaca;background:#fff1f2;color:#b42318}.bre-summary-grid .is-pending{border-color:#fed7aa;background:#fff7ed;color:#b54708}.bre-summary-grid .bre-overall.is-pass{border-color:#86efac;background:#dcfce7;color:#166534}.bre-summary-grid .bre-overall.is-fail{border-color:#fca5a5;background:#fee2e2;color:#991b1b}.bre-summary-grid .bre-overall.is-pending{border-color:#fdba74;background:#ffedd5;color:#9a3412}
.bre-result-table-shell{margin:0 20px 20px;border:1px solid var(--color-line);border-radius:10px}.bre-result-table{min-width:1050px}.bre-result-table th{padding:10px;background:#eef3f9;color:#526071;font-size:.62rem;letter-spacing:.04em;text-transform:uppercase}.bre-result-table td{padding:10px;font-size:.72rem;vertical-align:middle}.bre-result-table td:nth-child(1){width:55px}.bre-result-table td:nth-child(2){min-width:280px}.bre-result-table td:nth-child(3){min-width:140px}.bre-result-table td:nth-child(5){min-width:145px}.bre-result-table td:nth-child(6){min-width:190px}.bre-result-table td strong,.bre-result-table td small,.bre-expected,.bre-review-audit{display:block}.bre-result-table td small{margin-top:2px;color:var(--color-muted)}.bre-expected{margin-top:5px;color:#64748b;font-size:.62rem}.bre-review-audit{margin-top:4px;color:var(--color-muted);font-size:.6rem}.bre-decision{display:inline-flex;padding:4px 8px;border-radius:999px;font-size:.62rem;font-weight:850}.bre-decision.is-pass,.bre-decision.is-approved{background:#dcfce7;color:#166534}.bre-decision.is-fail,.bre-decision.is-rejected{background:#fee2e2;color:#991b1b}.bre-decision.is-pending{background:#ffedd5;color:#9a3412}
.bre-empty-state{display:grid;justify-items:center;gap:8px;padding:58px 20px;text-align:center;color:var(--color-muted)}.bre-empty-state i{font-size:2rem;color:var(--color-primary)}.bre-empty-state strong{color:var(--color-ink);font-size:1rem}.bre-empty-state p{margin:0;font-size:.78rem}
.bre-manual-override{display:block;margin-top:4px;color:#64748b;font-size:.58rem;font-weight:700}
.bre-master-content{padding:20px}.bre-master-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:18px;margin-bottom:14px}.bre-master-heading h2{margin:2px 0;font-size:1.2rem;font-weight:850}.bre-master-heading p{margin:0;color:var(--color-muted);font-size:.78rem}.bre-master-table-shell{border:1px solid var(--color-line);border-radius:12px}.bre-master-table{min-width:1080px}.bre-master-table th{padding:10px;background:#eef3f9;color:#526071;font-size:.62rem;letter-spacing:.04em;text-transform:uppercase}.bre-master-table td{padding:11px;font-size:.72rem}.bre-master-table td:nth-child(2){min-width:240px}.bre-master-table td strong,.bre-master-table td small,.bre-master-table td p{display:block}.bre-master-table td small{color:var(--color-primary);font-size:.6rem;font-weight:800}.bre-master-table td p{max-width:320px;margin:3px 0 0;color:var(--color-muted);font-size:.64rem}.bre-priority{display:grid;place-items:center;width:32px;height:32px;border-radius:50%;background:var(--color-accent-soft);color:var(--color-primary);font-weight:850}.bre-condition{display:block;color:var(--color-muted);font-size:.62rem}.bre-rule-status{display:inline-flex;padding:4px 8px;border-radius:999px;font-size:.62rem;font-weight:800}.bre-rule-status.is-active{background:#dcfce7;color:#166534}.bre-rule-status.is-inactive{background:#e2e8f0;color:#475569}.bre-rule-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.bre-rule-form-grid label{display:grid;align-content:start;gap:5px;font-size:.72rem;font-weight:750}.bre-rule-form-grid label small{color:var(--color-muted);font-size:.62rem;font-weight:500}.bre-rule-form-wide{grid-column:1/-1}.bre-rule-active{display:flex!important;align-items:center;gap:10px;padding-top:22px}.bre-rule-active span{display:grid}
.bre-severity{display:inline-flex;align-items:center;gap:4px;white-space:nowrap;margin-top:6px;padding:2px 7px;border-radius:999px;font-size:.58rem;font-weight:800;letter-spacing:.02em}.bre-severity.is-hard{background:#fee2e2;color:#991b1b}.bre-severity.is-soft{background:#e0e7ff;color:#3730a3}.bre-master-table .bre-severity{margin-top:0}.bre-run-meta{display:flex;flex-wrap:wrap;gap:6px 14px;margin:0;color:var(--color-muted);font-size:.72rem}.bre-run-meta strong{color:var(--color-ink)}.bre-sanction-note{display:flex;align-items:flex-start;gap:9px;margin:0 20px 14px;padding:10px 13px;border-radius:10px;font-size:.74rem;border:1px solid #fed7aa;background:#fff7ed;color:#9a3412}.bre-sanction-note.is-ready{border-color:#b8e7cd;background:#ecfdf3;color:#087443}.bre-sanction-note i{font-size:.95rem;line-height:1.2}.bre-hard-stop-note{display:block;color:#991b1b;font-size:.64rem;font-weight:700}.bre-summary-grid .bre-overall small span{font-weight:600;opacity:.8}
@media(max-width:991px){.bre-summary-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.bre-assessment-heading,.bre-master-heading{align-items:flex-start;flex-direction:column}.bre-rule-form-grid{grid-template-columns:1fr}.bre-rule-form-wide{grid-column:auto}}
@media(max-width:600px){.bre-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr));padding:12px}.bre-result-table-shell{margin:0 12px 12px}.bre-assessment-heading{padding:15px}.bre-assessment-actions{align-items:flex-start;flex-direction:column}}

/* ===================== Interactive admin dashboard (.dx) ===================== */
.dx { --dx-blue: #3b82f6; --dx-green: #16a34a; display: grid; gap: 16px; }
.dx-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.dx-kicker { margin: 0 0 4px; color: var(--color-primary); font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.admin-portal .main-content .dx-head h1, .dx-head h1 { margin: 0; font-size: 1.65rem; font-weight: 800; color: var(--color-ink); }
.dx-sub { margin: 4px 0 0; color: var(--color-muted); }
.dx-sub strong { color: var(--color-ink); font-weight: 700; }
.dx-controls { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dx-select { position: relative; display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 0 8px 0 10px; height: 32px; border: 1px solid var(--color-line); border-radius: 8px; background: var(--color-surface); color: var(--color-ink); box-shadow: 0 1px 2px color-mix(in srgb, var(--color-ink) 6%, transparent); }
.dx-select i { color: var(--color-muted); font-size: .8rem; }
.dx-select select { border: 0; background: transparent; color: inherit; font-weight: 700; font-size: .76rem; padding-right: 4px; cursor: pointer; outline: none; }
.dx-icon-btn { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--color-line); border-radius: 8px; background: var(--color-surface); color: var(--color-primary); font-size: .85rem; }
.dx-icon-btn:hover { border-color: var(--color-primary); background: var(--color-accent-soft); }
.dx-cta { height: 40px; display: inline-flex; align-items: center; gap: 6px; border-radius: 10px; }
.dx-spin { animation: dx-spin .8s linear infinite; display: inline-block; }
@keyframes dx-spin { to { transform: rotate(360deg); } }
.dx.is-busy .dx-panel, .dx.is-busy .dx-kpi { transition: opacity .2s; opacity: .7; }
.dx-error { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--color-danger); border-radius: 12px; background: var(--color-danger-bg); color: var(--color-danger); font-weight: 700; }
.dx-error .btn { margin-left: auto; }

.dx-card { background: var(--color-surface); border: 1px solid var(--color-line); border-radius: 14px; box-shadow: 0 1px 2px color-mix(in srgb, var(--color-ink) 4%, transparent); }
.dx-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(138px, 1fr)); gap: 10px; }
.dx-kpi { position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr); column-gap: 8px; row-gap: 1px; align-content: start; padding: 11px 11px 0; min-height: 0; overflow: hidden; color: var(--color-ink); text-decoration: none; transition: transform .15s, box-shadow .15s, border-color .15s; }
a.dx-kpi:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--tone) 45%, var(--color-line)); box-shadow: 0 8px 22px color-mix(in srgb, var(--tone) 16%, transparent); color: var(--color-ink); }
.dx-kpi-icon { grid-row: 2; grid-column: 1; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: color-mix(in srgb, var(--tone) 13%, transparent); color: var(--tone); font-size: .9rem; }
.dx-kpi-label { grid-row: 1; grid-column: 1 / -1; margin-bottom: 6px; font-size: .72rem; font-weight: 700; color: var(--color-muted); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dx-kpi-value { grid-row: 2; grid-column: 2; align-self: center; }
.dx-kpi-value { font-size: 1.08rem; font-weight: 800; line-height: 1.2; color: var(--color-ink); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dx-change { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 3px; margin-top: 5px; font-size: .68rem; font-weight: 800; white-space: nowrap; overflow: hidden; }
.dx-change em { overflow: hidden; text-overflow: ellipsis; }
.dx-change em { font-style: normal; font-weight: 600; color: var(--color-muted); }
.dx-change.is-up { color: var(--color-success); }
.dx-change.is-down { color: var(--color-danger); }
.dx-change.is-flat { color: var(--color-muted); font-weight: 600; }
.dx-kpi-spark { grid-column: 1 / -1; display: block; margin: 4px -11px 0; height: 26px; }
.dx-spark { display: block; width: 100%; height: 26px; }

.dx-row { display: grid; gap: 12px; }
.dx-row-3 { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, 1.1fr); }
.dx-row-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); }
.dx-panel { padding: 16px 18px; min-width: 0; }
.dx-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.admin-portal .main-content .dx-panel-head h2, .dx-panel-head h2 { margin: 0; font-size: 1rem; font-weight: 800; color: var(--color-ink); }
.dx-muted { color: var(--color-muted); font-size: .76rem; font-weight: 600; }
.dx-link { font-size: .78rem; font-weight: 700; color: var(--color-primary); text-decoration: none; }
.dx-link:hover { text-decoration: underline; }
.dx-chip { padding: 4px 10px; border: 1px solid var(--color-line); border-radius: 8px; font-size: .72rem; font-weight: 700; color: var(--color-muted); background: var(--color-surface-alt); }

.dx-legend { display: flex; gap: 14px; margin: -2px 0 6px; }
.dx-legend-item { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; font-size: .78rem; font-weight: 600; color: var(--color-ink); cursor: pointer; }
.dx-legend-item[aria-pressed="false"] { opacity: .4; text-decoration: line-through; }
.dx-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; }
.dx-chart { position: relative; }
.dx-trend-svg { display: block; width: 100%; height: 170px; overflow: visible; }
.dx-trend-head { align-items: flex-start; }
.dx-trend-head .dx-muted { display: block; margin-top: 2px; }
.dx-trend-head { flex-wrap: wrap; row-gap: 4px; }
.dx-trend-head h2 { white-space: nowrap; }
.dx-trend-head .dx-legend { margin: 2px 0 0; flex-wrap: nowrap; gap: 12px; white-space: nowrap; }
.dx-grid { stroke: var(--color-line); stroke-width: 1; stroke-dasharray: 3 3; }
.dx-axis { fill: var(--color-muted); font-size: 10.5px; font-weight: 600; }
.dx-bar { fill: color-mix(in srgb, var(--dx-blue) 70%, transparent); }
.dx-hit:hover { fill: color-mix(in srgb, var(--color-primary) 7%, transparent); }
.dx-line { fill: none; stroke: var(--dx-green); stroke-width: 2.4; stroke-linejoin: round; }
.dx-point { fill: var(--color-surface); stroke: var(--dx-green); stroke-width: 2; pointer-events: none; }
.dx-empty-over { position: absolute; inset: 0 0 22px 44px; display: grid; place-items: center; margin: 0; color: var(--color-muted); font-size: .8rem; font-weight: 600; pointer-events: none; }

.dx-donut-wrap { display: grid; grid-template-columns: 130px minmax(0, 1fr); align-items: center; gap: 12px; }
.dx-donut { position: relative; width: 130px; height: 130px; }
.dx-donut-svg { width: 100%; height: 100%; }
.dx-arc { transition: opacity .15s, stroke-width .15s; cursor: pointer; }
.dx-arc:hover { stroke-width: 28; }
.dx-arc.is-dim { opacity: .25; }
.dx-donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.dx-donut-center strong { font-size: 1.6rem; font-weight: 800; line-height: 1; color: var(--color-ink); }
.dx-donut-center span { font-size: .74rem; color: var(--color-muted); font-weight: 600; }
.dx-status-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.dx-status-list a { display: flex; align-items: center; gap: 6px; padding: 3px 4px; border-radius: 8px; color: var(--color-ink); text-decoration: none; font-size: .8rem; white-space: nowrap; }
.dx-status-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.dx-status-list a:hover { background: var(--color-surface-alt); }
.dx-status-list a.is-zero { opacity: .55; }
.dx-status-list strong { font-variant-numeric: tabular-nums; }
.dx-status-list em { flex: none; font-style: normal; color: var(--color-muted); font-size: .7rem; min-width: 34px; text-align: right; }

.dx-risk-row { display: grid; grid-template-columns: 84px minmax(40px, 1fr) 88px 40px; align-items: center; gap: 10px; padding: 4px 0; font-size: .8rem; }
.dx-risk-label { white-space: nowrap; }
.dx-risk-label { font-weight: 600; color: var(--color-ink); }
.dx-risk-track { height: 10px; border-radius: 4px; background: var(--color-surface-alt); overflow: hidden; }
.dx-risk-fill { display: block; height: 100%; width: var(--w); min-width: 2px; border-radius: 4px; background: var(--c); transition: width .6s ease; }
.dx-risk-row strong { font-variant-numeric: tabular-nums; font-size: .82rem; text-align: right; white-space: nowrap; }
.dx-risk-row em { font-style: normal; text-align: right; color: var(--color-muted); font-size: .76rem; }
.dx-risk-total { display: flex; justify-content: space-between; margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--color-line); font-size: .82rem; color: var(--color-muted); font-weight: 600; }
.dx-risk-total strong { color: var(--color-ink); }

/* Authenticated-session inactivity timeout */
.session-timeout-active { overflow: hidden; }
.session-timeout-overlay { position: fixed; inset: 0; z-index: 20000; display: grid; place-items: center; padding: 24px; background: color-mix(in srgb, #f3f6fa 88%, transparent); backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px); }
.session-timeout-overlay[hidden] { display: none!important; }
.session-timeout-card { width: min(408px, 100%); padding: 28px 26px 26px; border: 1px solid #d9dee7; border-radius: 20px; background: #fff; box-shadow: 0 24px 55px rgba(15, 23, 42, .22); text-align: center; }
.session-timeout-icon { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 16px; border-radius: 14px; background: #f1f5f9; color: var(--color-primary); font-size: 1.3rem; }
.admin-portal .main-content .session-timeout-card h2, .session-timeout-card h2 { margin: 0; color: #111827; font-size: 1.42rem; font-weight: 850; }
.session-timeout-card p { margin: 8px 0 20px; color: #64748b; font-size: .86rem; }
.session-timeout-login { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 42px; border-radius: 10px; background: var(--color-primary); color: #fff; font-size: .86rem; font-weight: 800; text-decoration: none; }
.session-timeout-login:hover, .session-timeout-login:focus { background: color-mix(in srgb, var(--color-primary) 88%, #000); color: #fff; }

.dx-collect-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.dx-tile { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; background: var(--color-surface-alt); }
.dx-tile-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: color-mix(in srgb, var(--tone) 14%, transparent); color: var(--tone); flex: none; }
.dx-tile small, .dx-rate-head small { display: block; color: var(--color-muted); font-size: .74rem; font-weight: 600; }
.dx-tile strong { font-size: 1.05rem; font-weight: 800; color: var(--color-ink); }
.dx-rate-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 8px; }
.dx-rate-head strong { font-size: 1.3rem; font-weight: 800; }
.dx-rate-head .is-up { color: var(--color-success); } .dx-rate-head .is-down { color: var(--color-danger); } .dx-rate-head .is-flat { color: var(--color-muted); }
.dx-target { text-align: right; }
.dx-target strong { font-size: .95rem; color: var(--color-ink); }
.dx-rate-track { position: relative; height: 10px; border-radius: 999px; background: var(--color-surface-alt); }
.dx-rate-fill { display: block; height: 100%; width: var(--w); border-radius: 999px; background: var(--color-success); transition: width .6s ease; }
.dx-rate-fill.is-down { background: #f59e0b; }
.dx-rate-target { position: absolute; top: -5px; bottom: -5px; left: var(--t); border-left: 2px dashed var(--color-ink); opacity: .55; }
.dx-rate-note { margin: 10px 0 0; }

.dx-table-wrap { overflow-x: auto; }
.dx-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.dx-table th { padding: 9px 14px; background: var(--color-surface-alt); color: var(--color-muted); font-size: .72rem; font-weight: 700; text-align: left; white-space: nowrap; }
.dx-table td { padding: 10px 14px; border-bottom: 1px solid var(--color-line); vertical-align: middle; color: var(--color-ink); }
.dx-table tr:last-child td { border-bottom: 0; }
.dx-table tbody tr:hover td { background: color-mix(in srgb, var(--color-primary) 4%, transparent); }
.dx-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.dx-bar-col { width: 24%; min-width: 120px; }
.dx-table th:first-child, .dx-table td:first-child { width: 36px; padding-right: 4px; }
.dx-agent-cell { white-space: nowrap; }
.dx-agent { display: inline-flex; align-items: center; gap: 10px; }
.dx-agent .dx-avatar { margin-right: 0; }
.dx-agent-name { font-weight: 600; }
.dx-mini-track { display: block; height: 8px; border-radius: 4px; background: var(--color-surface-alt); }
.dx-mini-track span { display: block; height: 100%; width: var(--w); min-width: 2px; border-radius: 4px; background: var(--dx-blue); transition: width .6s ease; }
.dx-avatar { display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: 8px; border-radius: 50%; background: color-mix(in srgb, var(--tone) 18%, transparent); color: var(--tone); font-size: .66rem; font-weight: 800; flex: none; vertical-align: middle; }

.dx-list { list-style: none; margin: 0; padding: 0; }
.dx-list li + li { border-top: 1px solid var(--color-line); }
.dx-list a { display: flex; align-items: center; gap: 10px; padding: 9px 4px; color: var(--color-ink); text-decoration: none; border-radius: 8px; }
.dx-list a:hover { background: var(--color-surface-alt); }
.dx-date { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--color-accent-soft); color: var(--color-primary); font-size: .66rem; font-weight: 700; line-height: 1.05; text-transform: uppercase; flex: none; }
.dx-date strong { font-size: .98rem; }
.dx-list-main { flex: 1; min-width: 0; }
.dx-list-main strong { display: block; font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dx-list-main small { color: var(--color-muted); font-size: .74rem; }
.dx-list-amt { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-weight: 800; font-size: .84rem; font-variant-numeric: tabular-nums; }
.dx-pill { padding: 1px 8px; border-radius: 999px; font-size: .66rem; font-weight: 800; }
.dx-pill-green { background: var(--color-success-bg); color: var(--color-success); }
.dx-pill-blue { background: var(--color-accent-soft); color: var(--color-primary); }
.dx-pill-amber { background: var(--color-warning-bg); color: var(--color-warning); }
.dx-pill-red, .dx-pill-orange { background: var(--color-danger-bg); color: var(--color-danger); }
.dx-pill-violet { background: color-mix(in srgb, #8b5cf6 14%, transparent); color: #7c3aed; }
.dx-pill-slate { background: var(--color-surface-alt); color: var(--color-muted); }
.dx-empty { margin: 0; padding: 22px 8px; text-align: center; color: var(--color-muted); font-size: .84rem; font-weight: 600; }
.dx-foot { margin: 0; text-align: right; color: var(--color-muted); font-size: .74rem; }

.dx-tooltip { position: fixed; z-index: 2000; max-width: 240px; padding: 8px 10px; border-radius: 8px; background: #111827; color: #fff; font-size: .76rem; line-height: 1.45; box-shadow: 0 8px 20px #0003; pointer-events: none; }
.dx-tooltip .dx-dot { margin-right: 5px; }

.dx-skel { display: block; border-radius: 6px; background: linear-gradient(90deg, var(--color-surface-alt) 25%, color-mix(in srgb, var(--color-line) 60%, transparent) 50%, var(--color-surface-alt) 75%); background-size: 200% 100%; animation: dx-shimmer 1.2s infinite; }
@keyframes dx-shimmer { to { background-position: -200% 0; } }
.dx-kpi.is-loading { display: flex; flex-direction: column; gap: 7px; padding-bottom: 11px; }
.dx-skel-icon { width: 30px; height: 30px; border-radius: 8px; }
.dx-skel-line { width: 70%; height: 10px; }
.dx-skel-big { width: 50%; height: 20px; }
.dx-skel-chart { height: 180px; }
.dx-skel-donut { width: 130px; height: 130px; border-radius: 50%; }

@media (max-width: 1300px) { .dx-row-3 { grid-template-columns: 1fr 1fr; } .dx-row-3 > :first-child { grid-column: 1 / -1; } .dx-row-2 { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .dx-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dx-row-3 { grid-template-columns: 1fr; }
  .dx-donut-wrap { grid-template-columns: 1fr; justify-items: center; }
  .dx-status-list { width: 100%; }
  .dx-collect-tiles { grid-template-columns: 1fr; }
  .dx-controls { width: 100%; }
  .dx-cta { flex: 1; justify-content: center; }
}
/* Login: Remember me */
.login-remember { padding-left: 1.6em; }
.login-remember .form-check-label { font-size: .86rem; font-weight: 600; }
.login-remember small { font-size: .72rem; margin-top: 1px; }
/* Disbursement summary: repayment details */
.disbursement-repayment { display: grid; gap: 6px; margin-top: 10px; }
.disbursement-repayment-title { color: var(--color-muted); font-size: .58rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.disbursement-repayment-empty { margin: 0; color: var(--color-muted); font-size: .7rem; }
.disbursement-repayment-status { display: inline-flex; padding: 1px 7px; border-radius: 999px; background: var(--color-surface-alt); }
.disbursement-repayment-status.is-due { background: #fff7ed; color: #9a3412; }
.disbursement-repayment-status.is-overdue { background: #fee2e2; color: #991b1b; }
.disbursement-repayment-status.is-paid { background: #dcfce7; color: #166534; }
/* Active Loans: collection status */
.collection-status-badge { display: inline-flex; padding: 3px 9px; border-radius: 999px; background: var(--color-surface-alt); color: var(--color-muted); font-size: .72rem; font-weight: 750; white-space: nowrap; }
.collection-status-badge.is-upcoming { background: #e0e7ff; color: #3730a3; }
.collection-status-badge.is-due { background: #fff7ed; color: #9a3412; }
.collection-status-badge.is-overdue { background: #fee2e2; color: #991b1b; }
.collection-status-badge.is-paid { background: #dcfce7; color: #166534; }
/* Loan lists: compact filter bar (search, optional agent, From/To dates) */
.loan-queue-filters { display: flex; flex-wrap: nowrap; align-items: center; gap: 10px; }
.loan-queue-search { flex: 0 1 540px; min-width: 220px; }
.loan-queue-dates { flex-shrink: 0; margin-left: auto; }
.loan-queue-dates .date-input-shell { width: 150px; }
.loan-queue-dates .date-input-control { cursor: pointer; }
@media (max-width: 767px) {
  .loan-queue-filters { flex-wrap: wrap; }
  .loan-queue-search { flex: 1 1 100%; }
  .loan-queue-dates { width: 100%; margin-left: 0; justify-content: space-between; }
  .loan-queue-dates .customer-date-field { flex: 1 1 0; }
  .loan-queue-dates .date-input-shell { width: 100%; }
}
/* Batch Run report: daily job status */
.batch-job-status { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; padding: 14px 16px 0; }
.batch-job-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--color-line); border-left-width: 4px; border-radius: 12px; background: var(--color-surface); }
.batch-job-card form { margin: 0; flex-shrink: 0; }
.batch-job-card-main { display: grid; gap: 2px; min-width: 0; }
.batch-job-card-main strong { font-size: .92rem; }
.batch-job-card-main small { color: var(--color-muted); font-size: .72rem; }
.batch-job-state { display: inline-flex; align-items: center; gap: 5px; width: fit-content; padding: 2px 8px; border-radius: 999px; font-size: .64rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; background: var(--color-surface-alt); color: var(--color-muted); }
.batch-job-card.is-done { border-left-color: #16a34a; } .batch-job-card.is-done .batch-job-state { background: #dcfce7; color: #166534; }
.batch-job-card.is-due { border-left-color: #f59e0b; } .batch-job-card.is-due .batch-job-state { background: #fff7ed; color: #9a3412; }
.batch-job-card.is-failed { border-left-color: #dc2626; } .batch-job-card.is-failed .batch-job-state { background: #fee2e2; color: #991b1b; }
.batch-job-card.is-waiting { border-left-color: #6366f1; } .batch-job-card.is-waiting .batch-job-state { background: #e0e7ff; color: #3730a3; }
.batch-job-card.is-disabled { border-left-color: #94a3b8; }
.batch-run-outcome { display: block; margin-top: 4px; color: var(--color-muted); font-size: .68rem; }
/* Disbursement modal: captcha */
.disbursement-otp-section .captcha-field { margin: 4px 0 6px; }
/* Disbursement modal: captcha first, then Send OTP */
.disbursement-otp-send-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 10px 0 12px; }
.disbursement-otp-send-row .btn .captcha-step, .disbursement-otp-send-row .captcha-step { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: 4px; border-radius: 50%; background: rgba(255, 255, 255, .25); font-size: .66rem; }
/* Portal header: Light / System / Dark theme switcher */
.theme-switcher { display: inline-flex; align-items: center; gap: 1px; padding: 2px; border: 1px solid var(--color-line); border-radius: 999px; background: var(--color-surface-alt); }
.theme-switcher-option { display: inline-grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--color-ink); font-size: .8rem; line-height: 1; cursor: pointer; transition: background .18s ease, color .18s ease, box-shadow .18s ease; }
.theme-switcher-option:hover { background: color-mix(in srgb, var(--color-ink) 8%, transparent); }
.theme-switcher-option:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.theme-switcher-option.is-active { color: #fff; background: linear-gradient(135deg, #1f3c88 0%, #5a3d6e 55%, #c8742c 100%); box-shadow: 0 1px 5px rgba(31, 60, 136, .3); }
.theme-switcher-option.is-active:hover { background: linear-gradient(135deg, #1f3c88 0%, #5a3d6e 55%, #c8742c 100%); }
@media (max-width: 575px) { .theme-switcher-option { width: 24px; height: 24px; font-size: .75rem; } }
/* ==========================================================================
   Dark theme fixes for hard-coded light colours.
   <html data-bs-theme="dark"> is set for "Dark" and for "System" on a dark
   device (see partials/theme_head.php). Colours come from the Master palette.
   ========================================================================== */
[data-bs-theme="dark"] .brand-logo { padding: 4px 8px; border-radius: 8px; background: #fff; }
[data-bs-theme="dark"] .btn-outline-primary { --bs-btn-color: var(--color-accent); --bs-btn-border-color: var(--color-accent); --bs-btn-hover-bg: var(--color-primary); --bs-btn-hover-border-color: var(--color-primary); --bs-btn-hover-color: var(--color-primary-text); --bs-btn-active-bg: var(--color-primary-hover); --bs-btn-active-color: var(--color-primary-text); }
[data-bs-theme="dark"] .btn-light { --bs-btn-bg: var(--color-surface-alt); --bs-btn-border-color: var(--color-line); --bs-btn-color: var(--color-ink); --bs-btn-hover-bg: var(--color-line); --bs-btn-hover-color: var(--color-ink); }
[data-bs-theme="dark"] .btn-outline-dark { --bs-btn-color: var(--color-ink); --bs-btn-border-color: var(--color-line); --bs-btn-hover-bg: var(--color-surface-alt); --bs-btn-hover-color: var(--color-ink); }

/* Status badges: success / danger / warning / info / neutral */
[data-bs-theme="dark"] :is(.bre-decision.is-pass, .bre-decision.is-approved, .bre-rule-status.is-active, .collection-status-badge.is-paid, .batch-job-card.is-done .batch-job-state, .consent-status--accepted, .consent-event-status--success, .disbursement-repayment-status.is-paid, .captcha-verified-badge) { background: var(--color-success-bg); color: var(--color-success); }
[data-bs-theme="dark"] :is(.bre-decision.is-fail, .bre-decision.is-rejected, .bre-severity.is-hard, .collection-status-badge.is-overdue, .batch-job-card.is-failed .batch-job-state, .consent-status--rejected, .consent-status--failed, .consent-event-status--failed, .disbursement-repayment-status.is-overdue) { background: var(--color-danger-bg); color: var(--color-danger); }
[data-bs-theme="dark"] :is(.bre-decision.is-pending, .collection-status-badge.is-due, .batch-job-card.is-due .batch-job-state, .consent-status--pending, .consent-event-status--pending, .disbursement-repayment-status.is-due) { background: var(--color-warning-bg); color: var(--color-warning); }
[data-bs-theme="dark"] :is(.bre-severity.is-soft, .collection-status-badge.is-upcoming, .batch-job-card.is-waiting .batch-job-state) { background: var(--color-info-bg); color: var(--color-info); }
[data-bs-theme="dark"] :is(.bre-rule-status.is-inactive, .consent-status--expired, .consent-status--not_generated) { background: var(--color-surface-alt); color: var(--color-muted); }

/* BRE result tiles and notes */
[data-bs-theme="dark"] .bre-summary-grid > div { border-color: var(--color-line); background: var(--color-surface-alt); color: var(--color-ink); }
[data-bs-theme="dark"] .bre-summary-grid .is-pass, [data-bs-theme="dark"] .bre-summary-grid .bre-overall.is-pass { border-color: color-mix(in srgb, var(--color-success) 40%, var(--color-line)); background: var(--color-success-bg); color: var(--color-success); }
[data-bs-theme="dark"] .bre-summary-grid .is-fail, [data-bs-theme="dark"] .bre-summary-grid .bre-overall.is-fail { border-color: color-mix(in srgb, var(--color-danger) 40%, var(--color-line)); background: var(--color-danger-bg); color: var(--color-danger); }
[data-bs-theme="dark"] .bre-summary-grid .is-pending, [data-bs-theme="dark"] .bre-summary-grid .bre-overall.is-pending { border-color: color-mix(in srgb, var(--color-warning) 40%, var(--color-line)); background: var(--color-warning-bg); color: var(--color-warning); }
[data-bs-theme="dark"] .bre-sanction-note { border-color: color-mix(in srgb, var(--color-warning) 40%, var(--color-line)); background: var(--color-warning-bg); color: var(--color-warning); }
[data-bs-theme="dark"] .bre-sanction-note.is-ready { border-color: color-mix(in srgb, var(--color-success) 40%, var(--color-line)); background: var(--color-success-bg); color: var(--color-success); }
[data-bs-theme="dark"] .bre-result-table th, [data-bs-theme="dark"] .bre-master-table th { background: var(--color-surface-alt); color: var(--color-muted); }

/* Application header chips and consent link */
[data-bs-theme="dark"] .loan-record-shell .summary-chip--submitted { border-color: color-mix(in srgb, var(--color-warning) 35%, var(--color-line)); background: var(--color-warning-bg); }
[data-bs-theme="dark"] .loan-record-shell .summary-chip--submitted strong { color: var(--color-warning); }
[data-bs-theme="dark"] .summary-chip--customer-active { border-color: color-mix(in srgb, var(--color-success) 35%, var(--color-line)); background: var(--color-success-bg); }
[data-bs-theme="dark"] .summary-chip--customer-active :is(small, strong) { color: var(--color-success); }
[data-bs-theme="dark"] .consent-link-card { border-color: var(--color-line); background: var(--color-accent-soft); }

/* Captcha box and OTP gate */
[data-bs-theme="dark"] .captcha-field { border-color: var(--color-line); background: var(--color-surface); }
[data-bs-theme="dark"] .captcha-field.is-verified { border-color: color-mix(in srgb, var(--color-success) 40%, var(--color-line)); background: var(--color-success-bg); }
[data-bs-theme="dark"] :is(.captcha-input, .captcha-refresh) { border-color: var(--color-line); background: var(--color-surface-alt); color: var(--color-ink); }
[data-bs-theme="dark"] .captcha-status { color: var(--color-muted); }
[data-bs-theme="dark"] .captcha-status.is-error { color: var(--color-danger); }
[data-bs-theme="dark"] .captcha-status.is-success { color: var(--color-success); }
/* Users & Roles: tab permission matrix */
.role-permissions { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--color-line); }
.role-permissions-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.role-permissions-tools { display: flex; align-items: center; gap: 8px; }
.role-permissions-count { padding: 4px 10px; border-radius: 999px; background: var(--color-accent-soft); color: var(--color-primary); font-size: .74rem; font-weight: 800; }
.role-permissions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.role-permission-segment { margin: 0; padding: 10px 12px; border: 1px solid var(--color-line); border-radius: 12px; background: var(--color-surface); min-width: 0; }
.role-permission-segment.is-on { border-color: color-mix(in srgb, var(--color-primary) 45%, var(--color-line)); background: color-mix(in srgb, var(--color-accent-soft) 45%, var(--color-surface)); }
.role-permission-segment-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; float: none; width: 100%; margin: 0 0 6px; padding: 0 0 6px; border-bottom: 1px solid var(--color-line); font-size: .82rem; font-weight: 800; }
.role-permission-segment-head label { display: inline-flex; align-items: center; gap: 7px; margin: 0; cursor: pointer; }
.role-permission-segment-head i { color: var(--color-primary); }
.role-permission-segment-head small { color: var(--color-muted); font-size: .68rem; font-weight: 700; }
.role-permission-tabs { display: grid; gap: 3px; }
.role-permission-tab { display: flex; align-items: center; gap: 8px; margin: 0; padding: 3px 4px; border-radius: 6px; font-size: .78rem; cursor: pointer; }
.role-permission-tab:hover { background: var(--color-surface-alt); }
.role-access-pill { display: inline-flex; padding: 3px 9px; border-radius: 999px; background: var(--color-info-bg); color: var(--color-info); font-size: .72rem; font-weight: 800; white-space: nowrap; }
.role-access-pill.is-full { background: var(--color-success-bg); color: var(--color-success); }
.role-access-pill.is-none { background: var(--color-danger-bg); color: var(--color-danger); }
/* Users & Roles: full-page role form */
.role-form-page { display: grid; gap: 0; }
.role-form-header { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 18px; }
.role-form-header > div:nth-child(2) { flex: 1 1 auto; }
.role-form-back { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--color-line); border-radius: 50%; background: var(--color-surface); color: var(--color-ink); }
.role-form-back:hover { border-color: var(--color-primary); color: var(--color-primary); }
.role-form-actions, .role-form-footer { display: flex; gap: 8px; }
.role-form-footer { justify-content: flex-end; margin-top: 16px; }
.role-form-permissions .role-permissions { margin-top: 0; padding-top: 0; border-top: 0; }
/* Customer addresses: Location API card */
.customer-location-meta { display: block; margin-top: 4px; color: var(--color-muted); font-size: .7rem; }

/* Searchable lender dropdown (Securities step) */
.lender-combobox { position: relative; }
.lender-combobox-native { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.lender-combobox-trigger { display: block; width: 100%; overflow: hidden; text-align: left; text-overflow: ellipsis; white-space: nowrap; color: var(--color-ink); background-color: var(--color-surface); }
.lender-combobox-trigger.is-placeholder { color: var(--color-ink); }
.lender-combobox-trigger[aria-expanded="true"] { border-color: var(--color-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 14%, transparent); }
.lender-combobox-panel { position: absolute; z-index: 1050; top: calc(100% + 6px); right: 0; left: 0; overflow: hidden; border: 1px solid var(--color-line); border-radius: 12px; background: var(--color-surface); box-shadow: 0 14px 35px rgb(23 43 77 / 18%), 0 3px 10px rgb(23 43 77 / 8%); }
.lender-combobox-panel[hidden] { display: none; }
.lender-combobox-search { position: relative; padding: 10px; border-bottom: 1px solid var(--color-line); background: var(--color-surface-alt); }
.lender-combobox-search > i { position: absolute; top: 50%; left: 23px; transform: translateY(-50%); color: var(--color-muted); }
.lender-combobox-search .form-control { padding-left: 36px; }
.lender-combobox-list { max-height: 280px; overflow-y: auto; padding: 6px 0; }
.lender-combobox-group { padding: 8px 14px 4px; color: var(--color-muted); font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.lender-combobox-option { padding: 8px 14px 8px 22px; color: var(--color-ink); cursor: pointer; }
.lender-combobox-option.is-active { background: var(--color-accent-soft); }
.lender-combobox-option[aria-selected="true"] { color: var(--color-primary); font-weight: 600; }
.lender-combobox-group[hidden], .lender-combobox-option[hidden], .lender-combobox-empty[hidden] { display: none; }
.lender-combobox-empty { padding: 18px 14px; color: var(--color-muted); text-align: center; }

/* Change co-applicant (admin Borrowers tab) */
.borrower-summary-change { align-self: center; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border: 1px solid color-mix(in srgb, var(--color-primary) 35%, var(--color-line)); border-radius: 999px; background: var(--color-surface); color: var(--color-primary); font-size: .6rem; font-weight: 800; text-decoration: none; white-space: nowrap; }
.borrower-summary-change:hover, .borrower-summary-change:focus-visible { background: var(--color-accent-soft); color: var(--color-primary); }

/* ===== Leads ===== */
.lead-queue-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.lead-queue-tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; border: 1px solid var(--color-line); border-radius: 999px; background: var(--color-surface); color: var(--color-ink); font-weight: 700; font-size: .86rem; }
.lead-queue-tabs a i { color: var(--color-muted); }
.lead-queue-tabs a span { min-width: 22px; padding: 0 7px; border-radius: 999px; background: var(--color-surface-alt); color: var(--color-muted); font-size: .7rem; text-align: center; }
.lead-queue-tabs a:hover { border-color: var(--color-primary); }
.lead-queue-tabs a.active { border-color: var(--color-primary); background: var(--color-primary); color: var(--color-primary-text); }
.lead-queue-tabs a.active i, .lead-queue-tabs a.active span { color: var(--color-primary-text); }
.lead-queue-tabs a.active span { background: color-mix(in srgb, var(--color-primary-text) 22%, transparent); }
.lead-list-shell { padding: 0; overflow: hidden; }
.lead-filters { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(140px, 190px) minmax(140px, 190px) max-content; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--color-line); }
.lead-due-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 16px; border-bottom: 1px solid var(--color-line); background: var(--color-surface-alt); }
.lead-due-chips a { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border: 1px solid var(--color-line); border-radius: 999px; background: var(--color-surface); color: var(--color-ink); font-size: .74rem; font-weight: 700; }
.lead-due-chips a span { color: var(--color-muted); }
.lead-due-chips a.is-overdue span { color: var(--color-danger); }
.lead-due-chips a.is-today span { color: var(--color-warning); }
.lead-due-chips a.active { border-color: var(--color-primary); color: var(--color-primary); background: var(--color-accent-soft); }
.lead-table { font-size: .82rem; min-width: 920px; }
.lead-table thead th { padding: 10px 14px; background: var(--color-surface-alt); color: var(--color-muted); font-size: .64rem; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.lead-table tbody td { padding: 12px 14px; vertical-align: top; }
.lead-table small { color: var(--color-muted); }
.lead-table tbody tr.is-overdue td:first-child { box-shadow: inset 3px 0 0 var(--color-danger); }
.lead-table tbody tr.is-today td:first-child { box-shadow: inset 3px 0 0 var(--color-warning); }
.lead-name { color: var(--color-ink); font-weight: 800; font-size: .9rem; }
.lead-name:hover { color: var(--color-primary); }
.lead-phone { display: inline-flex; align-items: center; gap: 5px; margin-top: 3px; font-weight: 700; }
.lead-snippet { max-width: 260px; }
.lead-source { display: inline-block; padding: 3px 9px; border-radius: 999px; background: var(--color-surface-alt); color: var(--color-muted); font-size: .7rem; font-weight: 800; white-space: nowrap; }
.lead-source--website { background: var(--color-accent-soft); color: var(--color-primary); }
.lead-source--referral { background: var(--color-success-bg); color: var(--color-success); }
.lead-source--walk_in, .lead-source--phone { background: var(--color-info-bg); color: var(--color-info); }
.lead-due.is-overdue { color: var(--color-danger); }
.lead-due.is-today { color: var(--color-warning); }

.lead-detail-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: start; padding: 18px 20px; margin-bottom: 16px; }
.lead-detail-title small { letter-spacing: .04em; }
.lead-contact-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.lead-detail-status { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; text-align: right; }
.lead-detail-status small { color: var(--color-muted); font-weight: 700; }
.lead-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.lead-detail-main, .lead-detail-side { display: grid; gap: 16px; min-width: 0; }
.lead-work-card, .lead-timeline-card, .lead-info-card { padding: 18px 20px; }
.lead-work-card > header, .lead-timeline-card > header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.lead-work-card > header small, .lead-timeline-card > header small { color: var(--color-muted); }
.lead-field { margin: 0 0 16px; padding: 0; border: 0; }
.lead-field legend { margin-bottom: 8px; font-size: .78rem; font-weight: 800; color: var(--color-ink); }
.lead-chip-group { display: flex; flex-wrap: wrap; gap: 6px; }
.lead-chip input, .lead-step input { position: absolute; opacity: 0; pointer-events: none; }
.lead-chip span { display: inline-block; padding: 6px 12px; border: 1px solid var(--color-line); border-radius: 999px; background: var(--color-surface); font-size: .78rem; font-weight: 700; cursor: pointer; }
.lead-chip input:checked + span { border-color: var(--color-primary); background: var(--color-accent-soft); color: var(--color-primary); }
.lead-chip input:focus-visible + span, .lead-step input:focus-visible + span { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.lead-step-group { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.lead-step span { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 8px; row-gap: 0; height: 100%; padding: 7px 10px; border: 1px solid var(--color-line); border-radius: 10px; background: var(--color-surface); cursor: pointer; }
.lead-step span i { grid-row: span 2; font-size: .95rem; color: var(--color-muted); }
.lead-step span strong { font-size: .78rem; line-height: 1.2; }
.lead-step span small { color: var(--color-muted); font-size: .64rem; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead-step input:checked + span { border-color: var(--color-primary); background: var(--color-accent-soft); box-shadow: 0 0 0 1px var(--color-primary); }
.lead-step input:checked + span i { color: var(--color-primary); }
.lead-step.is-success input:checked + span { border-color: var(--color-success); background: var(--color-success-bg); box-shadow: 0 0 0 1px var(--color-success); }
.lead-step.is-success input:checked + span i { color: var(--color-success); }
.lead-step.is-decline input:checked + span { border-color: var(--color-danger); background: var(--color-danger-bg); box-shadow: 0 0 0 1px var(--color-danger); }
.lead-step.is-decline input:checked + span i { color: var(--color-danger); }
.lead-followup-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lead-followup-row .form-control { max-width: 240px; }
.lead-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.lead-work-actions { display: flex; justify-content: flex-end; }
.lead-outcome-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 20px; border-left: 3px solid var(--color-success) !important; }
.lead-outcome-card > div:first-child { display: flex; gap: 12px; align-items: flex-start; }
.lead-outcome-card > div:first-child > i { font-size: 1.6rem; color: var(--color-success); }
.lead-outcome-card.is-declined { border-left-color: var(--color-danger) !important; }
.lead-outcome-card.is-declined > div:first-child > i { color: var(--color-danger); }
.lead-outcome-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lead-outcome-actions .form-control { min-width: 220px; }
.lead-timeline { margin: 0; padding: 0; list-style: none; }
.lead-timeline-item { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; padding-bottom: 16px; }
.lead-timeline-item:not(:last-child)::before { content: ""; position: absolute; left: 15px; top: 32px; bottom: 0; width: 1px; background: var(--color-line); }
.lead-timeline-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--color-surface-alt); color: var(--color-muted); }
.lead-timeline-item.is-success .lead-timeline-icon { background: var(--color-success-bg); color: var(--color-success); }
.lead-timeline-item.is-declined .lead-timeline-icon { background: var(--color-danger-bg); color: var(--color-danger); }
.lead-timeline-item.is-follow_up .lead-timeline-icon, .lead-timeline-item.is-call .lead-timeline-icon { background: var(--color-accent-soft); color: var(--color-primary); }
.lead-timeline-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.lead-timeline-top strong { font-size: .86rem; }
.lead-timeline p { margin: 4px 0; font-size: .84rem; }
.lead-timeline small { color: var(--color-muted); font-size: .72rem; }
.lead-outcome-tag { padding: 2px 8px; border-radius: 999px; background: var(--color-surface-alt); color: var(--color-ink); font-size: .68rem; font-weight: 700; }
.lead-outcome-tag.is-date { background: var(--color-accent-soft); color: var(--color-primary); }
.lead-info-card h2 { margin-bottom: 12px; }
.lead-info-card dl { margin: 0; }
.lead-info-card dl div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--color-line); font-size: .82rem; }
.lead-info-card dl div:last-child { border-bottom: 0; }
.lead-info-card dt { color: var(--color-muted); font-weight: 600; }
.lead-info-card dd { margin: 0; font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.lead-requirement { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--color-surface-alt); font-size: .82rem; }
.lead-requirement p { margin: 4px 0 0; }
.lead-assign { display: flex; gap: 8px; }
.lead-note-card { border-left: 3px solid var(--color-info) !important; }
.lead-other-list { margin: 0; padding: 0; list-style: none; font-size: .82rem; }
.lead-other-list li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--color-line); }
.lead-other-list li:last-child { border-bottom: 0; }
.lead-other-list span { color: var(--color-muted); }
.lead-form { padding: 0; }
.lead-form-section { padding: 18px 20px; border-bottom: 1px solid var(--color-line); }
.lead-form-section h2 { margin-bottom: 12px; }
.lead-form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 20px; }
.lead-duplicate { display: flex; align-items: flex-start; }
@media (max-width: 1199.98px) { .lead-detail-grid { grid-template-columns: 1fr; } .lead-step-group { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767.98px) {
  .lead-filters { grid-template-columns: 1fr; }
  .lead-detail-head { grid-template-columns: auto minmax(0, 1fr); }
  .lead-detail-status { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; text-align: left; }
  .lead-followup-row .form-control { max-width: none; }
}

.lead-timeline-card > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; list-style: none; cursor: pointer; }
.lead-timeline-card > summary::-webkit-details-marker { display: none; }
.lead-timeline-summary { display: grid; gap: 2px; }
.lead-timeline-summary small, .lead-timeline-count { color: var(--color-muted); font-size: .76rem; }
.lead-timeline-count { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.lead-timeline-count i { transition: transform .2s; }
.lead-timeline-card[open] > summary { margin-bottom: 14px; }
.lead-timeline-card[open] .lead-timeline-count i { transform: rotate(180deg); }
.lead-timeline-card > summary:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 4px; border-radius: 8px; }
.collection-status--closed { background: var(--color-surface-alt); color: var(--color-muted); }

/* BRE is advisory only: its note is informational, never a warning that blocks sanction. */
.bre-sanction-note.is-advisory,
[data-bs-theme="dark"] .bre-sanction-note.is-advisory { border-color: color-mix(in srgb, var(--color-primary) 25%, var(--color-line)); background: var(--color-accent-soft); color: var(--color-ink); }
.bre-sanction-note.is-advisory i { color: var(--color-primary); }

/* GL view: the edit form, read-only. */
.gl-form-fields { min-width: 0; margin: 0; padding: 0; border: 0; }
[data-gl-form].is-viewing [data-gl-slab-add],
[data-gl-form].is-viewing [data-gl-slab-remove],
[data-gl-form].is-viewing .gl-slab-table th:last-child,
[data-gl-form].is-viewing .gl-slab-table td:last-child { display: none; }
[data-gl-form].is-viewing .form-control:disabled,
[data-gl-form].is-viewing .form-select:disabled,
[data-gl-form].is-viewing .bounded-select-trigger:disabled { opacity: 1; color: var(--color-ink); background: var(--color-surface-alt); }

/* Security cheques save in the background; dim the section while it redraws. */
#security-cheques.is-busy { opacity: .6; pointer-events: none; transition: opacity .15s; }

/* Consent link: expired / rejected state and re-initiation */
.consent-link-card.is-inactive { border-color: #e4e7ec; background: #f8f9fb; }
.consent-link-card.is-inactive input { text-decoration: line-through; color: #98a2b3; }
.consent-link-row form { display: contents; }
.consent-link-attempt { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: #e0eaff; color: #1d3f8a; font-size: 11px; font-weight: 700; }
[data-bs-theme="dark"] .consent-link-card.is-inactive { border-color: var(--bs-border-color); background: transparent; }
[data-bs-theme="dark"] .consent-link-attempt { background: rgba(99, 140, 255, .18); color: #a9c0ff; }
.consent-reinitiate-confirm:not([hidden]) { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.consent-reinitiate-question { font-size: 12px; font-weight: 600; color: var(--bs-body-color); }
.consent-link-row .consent-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 31px; padding: 0; }
