/* Loans → FCILL UI bridge
   This file overlays the legacy Loans “finance module” markup so it visually matches /ai/fcill/home/.
   Scope everything under body.loans-fcill to avoid impacting other modules.
*/

body.loans-fcill {
	background: radial-gradient(circle at top left, rgba(59, 130, 246, 0.14), transparent 55%),
				radial-gradient(circle at 20% 80%, rgba(249, 115, 22, 0.10), transparent 55%),
				radial-gradient(circle at 85% 65%, rgba(34, 197, 94, 0.10), transparent 55%),
				linear-gradient(140deg, #ffffff, #f8fafc) !important;
	color: var(--fc-text) !important;
}

/* Remove legacy chrome that clashes with FCILL shell */
body.loans-fcill .finance-sidebar,
body.loans-fcill .finance-header,
body.loans-fcill .finance-tabs,
body.loans-fcill .dark-mode-toggle,
body.loans-fcill .mobile-sidebar-toggle,
body.loans-fcill .menu-overlay {
	display: none !important;
}

/* Flatten legacy wrappers */
body.loans-fcill .main-content {
	margin-left: 0 !important;
	min-height: auto !important;
	background: transparent !important;
}

body.loans-fcill .finance-management,
body.loans-fcill .finance-container,
body.loans-fcill .finance-detail-main {
	background: transparent !important;
	padding: 0 !important;
	max-width: none !important;
}

body.loans-fcill .finance-content {
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
	padding: 0 !important;
}

/* Cards & sections */
body.loans-fcill .card,
body.loans-fcill .detail-section,
body.loans-fcill .section-card {
	background: var(--fc-surface) !important;
	border: 1px solid var(--fc-border) !important;
	border-radius: var(--brand-radius) !important;
	box-shadow: none !important;
}

body.loans-fcill .card-header,
body.loans-fcill .section-header {
	background: transparent !important;
	border-bottom: 1px solid var(--fc-border) !important;
}

body.loans-fcill .card-body,
body.loans-fcill .section-body {
	color: var(--fc-text);
}

/* Buttons – FCILL pill style */
body.loans-fcill .btn,
body.loans-fcill .finance-btn {
	border-radius: 999px !important;
	font-weight: 700;
	font-size: 0.92rem;
	padding: 0.65rem 1.25rem;
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	cursor: pointer;
	transition: all 0.18s ease;
	text-decoration: none !important;
	line-height: 1.35;
	white-space: nowrap;
	border: 1px solid transparent;
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
body.loans-fcill .finance-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(15, 23, 42, 0.10);
}
body.loans-fcill .finance-btn:active {
	transform: translateY(0);
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}
body.loans-fcill .finance-btn i {
	font-size: 0.88em;
}

body.loans-fcill .btn-primary,
body.loans-fcill .finance-btn.primary {
	background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-dark, #2563eb)) !important;
	border-color: var(--brand-primary) !important;
	color: #fff !important;
}
body.loans-fcill .btn-primary:hover,
body.loans-fcill .finance-btn.primary:hover {
	background: linear-gradient(135deg, var(--brand-primary-dark, #2563eb), var(--brand-primary)) !important;
	border-color: var(--brand-primary-dark, #2563eb) !important;
	box-shadow: 0 4px 14px rgba(59, 130, 246, 0.28) !important;
}

body.loans-fcill .btn-secondary,
body.loans-fcill .btn-outline-secondary,
body.loans-fcill .finance-btn.secondary {
	background: var(--fc-surface, #fff) !important;
	border: 1px solid var(--fc-border) !important;
	color: var(--fc-text) !important;
}
body.loans-fcill .btn-secondary:hover,
body.loans-fcill .btn-outline-secondary:hover,
body.loans-fcill .finance-btn.secondary:hover {
	background: var(--fc-surface-2, #f8fafc) !important;
	border-color: var(--brand-primary) !important;
	color: var(--brand-primary) !important;
	box-shadow: 0 4px 12px rgba(59, 130, 246, 0.12) !important;
}

body.loans-fcill .btn-outline-primary {
	background: transparent !important;
	border: 1px solid var(--brand-primary) !important;
	color: var(--brand-primary) !important;
}
body.loans-fcill .btn-outline-primary:hover {
	background: rgba(59, 130, 246, 0.08) !important;
}

body.loans-fcill .btn-outline-primary:hover {
	background: rgba(59, 130, 246, 0.10) !important;
}

/* Inputs */
body.loans-fcill .form-control,
body.loans-fcill .form-select,
body.loans-fcill .form-input,
body.loans-fcill select.form-input,
body.loans-fcill textarea {
	border-radius: 16px !important;
	border: 1px solid var(--fc-border) !important;
	background: var(--fc-surface-solid) !important;
	color: var(--fc-text) !important;
}

body.loans-fcill .form-control::placeholder,
body.loans-fcill textarea::placeholder {
	color: var(--fc-input-placeholder) !important;
}

body.loans-fcill .form-control:focus,
body.loans-fcill .form-select:focus,
body.loans-fcill textarea:focus {
	outline: none !important;
	border-color: rgba(59, 130, 246, 0.55) !important;
	box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.14) !important;
}

/* Tables */
body.loans-fcill table,
body.loans-fcill .table,
body.loans-fcill .finance-table,
body.loans-fcill .data-table {
	color: var(--fc-text) !important;
}

body.loans-fcill .table-responsive,
body.loans-fcill .table-container {
	border-radius: 18px !important;
	border: 1px solid var(--fc-border) !important;
	overflow: hidden;
	background: var(--fc-surface);
}

body.loans-fcill .table thead th,
body.loans-fcill .finance-table th,
body.loans-fcill .data-table th {
	background: var(--fc-surface-3) !important;
	border-bottom: 1px solid var(--fc-border) !important;
	color: var(--fc-muted) !important;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	font-size: 0.75rem;
}

body.loans-fcill .table td,
body.loans-fcill .finance-table td,
body.loans-fcill .data-table td {
	border-bottom: 1px solid var(--fc-border) !important;
}

body.loans-fcill .text-muted {
	color: var(--fc-muted-2) !important;
}

body.loans-fcill .status-badge,
body.loans-fcill .badge {
	border-radius: 999px;
}

/* Loans dashboard should be single-column (FCILL dashboard-grid is 2-col by default) */
@media (min-width: 1024px) {
	body.loans-fcill .loans-dashboard-grid {
		grid-template-columns: 1fr !important;
	}
}

body.loans-fcill a {
	text-decoration: none;
}

/* Utility helpers */
body.loans-fcill .fc-stack { display: grid; gap: 1.5rem; }
body.loans-fcill .fc-row { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
body.loans-fcill .fc-row.space { justify-content: space-between; }
body.loans-fcill .fc-muted { color: var(--fc-muted) !important; }
body.loans-fcill .fc-small { font-size: 0.82rem; color: var(--fc-muted-2) !important; }

/* Loans hero (FCILL rhythm) */
body.loans-fcill .loans-hero {
	display: grid;
	gap: 0.6rem;
	text-align: center;
	padding: 1.2rem 0 1.1rem;
}
body.loans-fcill .loans-hero h1 {
	margin: 0;
	font-size: clamp(2.05rem, 4vw, 3.15rem);
	letter-spacing: -0.05em;
	font-weight: 860;
	color: var(--fc-hero-title);
}
body.loans-fcill .loans-hero p {
	margin: 0;
	font-size: 1.06rem;
	color: var(--fc-muted);
}

/* FCILL-like table component (for new admin/provider pages) */
body.loans-fcill .fc-table-wrap {
	overflow: auto;
	border-radius: 18px;
	border: 1px solid var(--fc-border);
	background: var(--fc-surface);
}
body.loans-fcill .fc-table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	min-width: 640px;
}
body.loans-fcill .fc-table thead th {
	text-align: left;
	font-size: 0.78rem;
	font-weight: 750;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--fc-muted-2);
	padding: 0.85rem 1.15rem;
	border-bottom: 1px solid var(--fc-border);
	background: var(--fc-surface-3);
	white-space: nowrap;
}
body.loans-fcill .fc-table tbody td {
	padding: 0.85rem 1.15rem;
	border-bottom: 1px solid var(--fc-border);
	vertical-align: middle;
	color: var(--fc-text);
	font-size: 0.92rem;
}
body.loans-fcill .fc-table tbody tr:last-child td {
	border-bottom: none;
}
body.loans-fcill .fc-table tbody tr:hover td {
	background: rgba(59, 130, 246, 0.05);
}
body.loans-fcill .fc-table tbody tr:nth-child(even) td {
	background: rgba(15, 23, 42, 0.018);
}
body.loans-fcill .fc-table tbody tr:nth-child(even):hover td {
	background: rgba(59, 130, 246, 0.05);
}
body.loans-fcill .fc-table .cell-muted {
	color: var(--fc-muted-2);
	font-size: 0.86rem;
}
body.loans-fcill .fc-table .cell-mono {
	font-variant-numeric: tabular-nums;
	font-weight: 650;
	letter-spacing: -0.01em;
}

/* Badges */
body.loans-fcill .fc-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.35rem 0.65rem;
	border-radius: 999px;
	font-size: 0.78rem;
	font-weight: 750;
	border: 1px solid var(--fc-border);
	background: rgba(255, 255, 255, 0.9);
	color: var(--fc-muted);
	white-space: nowrap;
}
body.loans-fcill .fc-badge.good { border-color: rgba(34, 197, 94, 0.35); background: rgba(34, 197, 94, 0.10); color: rgba(15, 23, 42, 0.85); }
body.loans-fcill .fc-badge.warn { border-color: rgba(245, 158, 11, 0.35); background: rgba(245, 158, 11, 0.12); color: rgba(15, 23, 42, 0.85); }
body.loans-fcill .fc-badge.bad { border-color: rgba(244, 63, 94, 0.35); background: rgba(244, 63, 94, 0.10); color: rgba(15, 23, 42, 0.85); }
body.loans-fcill .fc-badge.info { border-color: rgba(59, 130, 246, 0.35); background: rgba(59, 130, 246, 0.10); color: rgba(15, 23, 42, 0.85); }

/* Compact icon buttons */
body.loans-fcill .fc-icon-btn {
	width: 38px;
	height: 38px;
	border-radius: 999px;
	border: 1px solid var(--fc-border);
	background: var(--fc-surface-elevated);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--fc-muted);
	cursor: pointer;
	transition: var(--transition-base);
}
body.loans-fcill .fc-icon-btn:hover { transform: translateY(-1px); border-color: rgba(59, 130, 246, 0.35); color: var(--brand-primary); }

/* Wizard stepper */
body.loans-fcill .fc-steps { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }
body.loans-fcill .fc-step {
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
	padding: 0.55rem 0.75rem;
	border-radius: 999px;
	border: 1px solid var(--fc-border);
	background: var(--fc-surface-elevated);
	color: var(--fc-muted);
	font-weight: 700;
	font-size: 0.88rem;
}
body.loans-fcill .fc-step .dot { width: 22px; height: 22px; border-radius: 999px; display: grid; place-items: center; background: rgba(15, 23, 42, 0.08); color: var(--fc-text); font-size: 0.78rem; }
body.loans-fcill .fc-step.active { border-color: rgba(59, 130, 246, 0.55); background: rgba(59, 130, 246, 0.08); color: var(--brand-primary); }
body.loans-fcill .fc-step.active .dot { background: rgba(59, 130, 246, 0.15); color: var(--brand-primary); }
body.loans-fcill .fc-step.done { border-color: rgba(34, 197, 94, 0.35); background: rgba(34, 197, 94, 0.10); color: rgba(15, 23, 42, 0.85); }
body.loans-fcill .fc-step.done .dot { background: rgba(34, 197, 94, 0.18); color: var(--brand-emerald); }

/* File input card */
body.loans-fcill .fc-file {
	border: 1px dashed var(--fc-border-strong);
	border-radius: 18px;
	background: var(--fc-surface-3);
	padding: 1rem;
	display: grid;
	gap: 0.35rem;
}
body.loans-fcill .fc-file strong { font-weight: 780; }
body.loans-fcill .fc-file input[type="file"] { width: 100%; }

/* Inline validation */
body.loans-fcill .fc-error { margin-top: 0.35rem; font-size: 0.86rem; color: var(--brand-rose); }

/* Success panel */
body.loans-fcill .fc-success {
	border: 1px solid rgba(34, 197, 94, 0.30);
	background: rgba(34, 197, 94, 0.10);
	border-radius: 18px;
	padding: 1rem;
}

/* Overview: remove outer section-card canvas (Plagiarism-style hero feel) */
body.loans-fcill .section-card.loans-overview-plain,
body.loans-fcill .section-card.loans-providers-plain,
body.loans-fcill .section-card.loans-reports-plain {
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
}

body.loans-fcill .section-card.loans-overview-plain .section-header,
body.loans-fcill .section-card.loans-providers-plain .section-header,
body.loans-fcill .section-card.loans-reports-plain .section-header {
	background: transparent !important;
	border-bottom: 0 !important;
}

body.loans-fcill .section-card.loans-overview-plain .section-body,
body.loans-fcill .section-card.loans-providers-plain .section-body,
body.loans-fcill .section-card.loans-reports-plain .section-body {
	padding-left: 0 !important;
	padding-right: 0 !important;
	padding-bottom: 0 !important;
}

/* Loans list: remove outer filter card canvas (Plagiarism-style search pill) */
body.loans-fcill .section-card.loans-filters-plain {
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
	margin-left: auto;
	margin-right: auto;
}

body.loans-fcill .section-card.loans-filters-plain .section-header {
	background: transparent !important;
	border-bottom: 0 !important;
}

body.loans-fcill .section-card.loans-filters-plain .section-body {
	padding-left: 0 !important;
	padding-right: 0 !important;
}

body.loans-fcill .section-card.loans-filters-plain .search-pill {
	margin: 0 auto;
	padding: 0.9rem 1rem;
	border-radius: 999px;
	width: 100%;
}

body.loans-fcill .section-card.loans-filters-plain .search-icon {
	width: 54px;
	height: 54px;
	font-size: 1.1rem;
}

body.loans-fcill .section-card.loans-filters-plain .search-input {
	font-size: 1.15rem;
	padding: 0.5rem 0.35rem;
}

body.loans-fcill .section-card.loans-filters-plain .fc-pill-select {
	padding: 0.8rem 1.1rem;
	font-size: 1rem;
	min-width: 0;
	max-width: 180px;
}

body.loans-fcill .section-card.loans-filters-plain .search-btn {
	padding: 1rem 1.6rem;
	font-size: 1.05rem;
}

@media (max-width: 900px) {
	body.loans-fcill .section-card.loans-filters-plain .search-pill {
		flex-wrap: wrap;
		border-radius: 24px;
	}
	body.loans-fcill .section-card.loans-filters-plain .search-input {
		width: 100%;
		flex: 1 0 100%;
	}
	body.loans-fcill .section-card.loans-filters-plain .fc-pill-select {
		flex: 1;
	}
	body.loans-fcill .section-card.loans-filters-plain .search-btn {
		width: 100%;
		justify-content: center;
	}
}

body.loans-fcill .section-card.loans-filters-plain form.fc-stack {
	width: 100%;
	margin-left: auto;
	margin-right: auto;
}

body.loans-fcill .section-card.loans-filters-plain .fc-row {
	justify-content: center;
}

/* ── Loan Detail Page ─────────────────────────────────────────────── */

/* Layout: kill legacy sidebar flex, let content flow naturally */
body.loans-fcill .finance-detail-layout {
	display: block;
}

/* Horizontal section nav (replaces hidden sidebar) */
body.loans-fcill .loan-detail-nav {
	display: flex;
	gap: 0.5rem;
	flex-wrap: wrap;
	padding: 0 0 1.5rem;
	justify-content: center;
}
body.loans-fcill .loan-detail-nav a {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.55rem 1rem;
	border-radius: 999px;
	border: 1px solid var(--fc-border);
	background: var(--fc-surface-elevated);
	color: var(--fc-muted);
	font-weight: 700;
	font-size: 0.88rem;
	transition: var(--transition-base);
	text-decoration: none;
}
body.loans-fcill .loan-detail-nav a:hover,
body.loans-fcill .loan-detail-nav a.active {
	border-color: rgba(59, 130, 246, 0.55);
	background: rgba(59, 130, 246, 0.08);
	color: var(--brand-primary);
}
body.loans-fcill .loan-detail-nav a.back-link {
	border-color: var(--fc-border);
	background: var(--fc-surface-3);
	color: var(--fc-muted-2);
}
body.loans-fcill .loan-detail-nav a.back-link:hover {
	border-color: rgba(59, 130, 246, 0.35);
	color: var(--brand-primary);
}
body.loans-fcill .loan-detail-nav a i {
	font-size: 0.82rem;
}

/* Detail header – styled FCILL card */
body.loans-fcill .detail-header {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	margin-bottom: 1.5rem;
	padding: 1.35rem 1.75rem;
	background: var(--fc-surface, #fff);
	border: 1px solid var(--fc-border);
	border-radius: var(--brand-radius, 18px);
	box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}
body.loans-fcill .detail-header h1 {
	font-size: clamp(1.35rem, 2.5vw, 1.75rem);
	font-weight: 860;
	letter-spacing: -0.04em;
	color: var(--fc-text);
	margin: 0;
	display: flex;
	align-items: center;
	gap: 0.65rem;
}
body.loans-fcill .detail-header h1 i {
	color: var(--brand-primary);
	font-size: 0.92em;
}
body.loans-fcill .detail-header p {
	color: var(--fc-muted);
	margin: 0.25rem 0 0;
	font-size: 0.95rem;
}
body.loans-fcill .detail-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.65rem;
}
body.loans-fcill .detail-actions .finance-btn {
	padding: 0.6rem 1.15rem;
	font-size: 0.88rem;
}

/* Detail search pill */
body.loans-fcill .detail-search-wrap {
	margin-bottom: 1.5rem;
}
body.loans-fcill .detail-search-pill {
	margin: 0 auto;
	width: 100%;
	padding: 0.6rem 0.75rem;
	box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
}
body.loans-fcill .detail-search-pill .search-input {
	font-size: 1.05rem;
}
body.loans-fcill .detail-search-pill .search-icon {
	width: 42px;
	height: 42px;
	font-size: 0.95rem;
}
body.loans-fcill .detail-search-count {
	flex: 0 0 auto;
	font-size: 0.82rem;
	font-weight: 650;
	color: var(--fc-muted);
	white-space: nowrap;
	padding: 0 0.35rem;
}
body.loans-fcill .detail-search-clear {
	padding: 0.6rem 1rem !important;
	font-size: 0.88rem !important;
	background: var(--fc-surface-3) !important;
	color: var(--fc-text) !important;
	border: 1px solid var(--fc-border) !important;
}
body.loans-fcill .detail-search-clear:hover {
	background: var(--fc-danger, #ef4444) !important;
	color: #fff !important;
	border-color: var(--fc-danger, #ef4444) !important;
}

/* Search highlight marks */
.detail-search-mark {
	background: rgba(250, 204, 21, 0.45);
	color: inherit;
	border-radius: 3px;
	padding: 0.05em 0.15em;
	box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.35);
}
.detail-search-mark-active {
	background: rgba(59, 130, 246, 0.35);
	box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
	outline: 2px solid var(--brand-primary);
	outline-offset: 1px;
}

/* Detail section – flat FCILL card */
body.loans-fcill .detail-section {
	margin-bottom: 1.5rem;
	padding: 1.5rem;
	transition: none !important;
}
body.loans-fcill .detail-section:hover {
	transform: none !important;
	box-shadow: none !important;
}
body.loans-fcill .detail-section h2 {
	font-size: 1.15rem;
	font-weight: 860;
	letter-spacing: -0.03em;
	color: var(--fc-text);
	border-bottom: 1px solid var(--fc-border);
	padding-bottom: 0.75rem;
	margin-bottom: 0.5rem;
	display: flex;
	align-items: center;
	gap: 0.55rem;
}
body.loans-fcill .detail-section h2 i {
	color: var(--brand-primary);
	background: rgba(59, 130, 246, 0.09);
	padding: 0.4rem;
	border-radius: 10px;
	font-size: 0.88em;
	width: 1.9rem;
	height: 1.9rem;
	display: inline-grid;
	place-items: center;
	flex: 0 0 auto;
}
body.loans-fcill .section-subtitle {
	color: var(--fc-muted) !important;
	font-style: normal;
}
body.loans-fcill .detail-section h3 {
	color: var(--fc-text);
}

/* Summary cards (stat-card feel) */
body.loans-fcill .detail-summary-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 1rem;
	margin-bottom: 1.5rem;
}
body.loans-fcill .summary-card {
	background: var(--fc-surface) !important;
	border: 1px solid var(--fc-border) !important;
	border-radius: var(--brand-radius) !important;
	padding: 1.25rem !important;
	box-shadow: none !important;
	transition: none !important;
}
body.loans-fcill .summary-card::before { display: none !important; }
body.loans-fcill .summary-card:hover {
	transform: none !important;
	box-shadow: none !important;
	background: var(--fc-surface) !important;
}
body.loans-fcill .summary-card h3 {
	font-size: 0.82rem;
	font-weight: 750;
	color: var(--fc-muted-2);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	margin-bottom: 0.5rem;
}
body.loans-fcill .summary-value {
	font-size: 1.55rem;
	font-weight: 880;
	letter-spacing: -0.04em;
	color: var(--fc-text);
	margin-bottom: 0.35rem;
	line-height: 1.2;
}
body.loans-fcill .summary-card small {
	font-size: 0.82rem;
	color: var(--fc-muted);
	margin-top: 0.5rem;
}

/* Status chip → badge feel */
body.loans-fcill .status-chip {
	border-radius: 999px;
	font-size: 0.78rem;
	font-weight: 750;
	padding: 0.35rem 0.75rem;
	box-shadow: none;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	border: 1px solid transparent;
}
body.loans-fcill .status-chip:hover { transform: none; }
body.loans-fcill .status-pending   { background: rgba(245, 158, 11, 0.12); color: rgba(15, 23, 42, 0.85); border-color: rgba(245, 158, 11, 0.35); }
body.loans-fcill .status-under_review { background: rgba(59, 130, 246, 0.10); color: rgba(15, 23, 42, 0.85); border-color: rgba(59, 130, 246, 0.35); }
body.loans-fcill .status-approved  { background: rgba(34, 197, 94, 0.12); color: rgba(15, 23, 42, 0.85); border-color: rgba(34, 197, 94, 0.35); }
body.loans-fcill .status-disbursed { background: rgba(34, 197, 94, 0.15); color: rgba(15, 23, 42, 0.85); border-color: rgba(34, 197, 94, 0.40); }
body.loans-fcill .status-completed { background: rgba(100, 116, 139, 0.10); color: rgba(15, 23, 42, 0.85); border-color: rgba(100, 116, 139, 0.35); }
body.loans-fcill .status-rejected  { background: rgba(244, 63, 94, 0.10); color: rgba(15, 23, 42, 0.85); border-color: rgba(244, 63, 94, 0.35); }
body.loans-fcill .status-cancelled { background: rgba(139, 92, 246, 0.10); color: rgba(15, 23, 42, 0.85); border-color: rgba(139, 92, 246, 0.35); }

/* Finance tag → fc-badge */
body.loans-fcill .finance-tag {
	border-radius: 999px;
	font-size: 0.78rem;
	font-weight: 750;
	padding: 0.35rem 0.65rem;
	box-shadow: none;
	border: 1px solid var(--fc-border);
}
body.loans-fcill .finance-tag:hover { transform: none; }
body.loans-fcill .finance-tag.success { border-color: rgba(34, 197, 94, 0.35); background: rgba(34, 197, 94, 0.10); color: rgba(15, 23, 42, 0.85); }
body.loans-fcill .finance-tag.warning { border-color: rgba(245, 158, 11, 0.35); background: rgba(245, 158, 11, 0.12); color: rgba(15, 23, 42, 0.85); }
body.loans-fcill .finance-tag.danger  { border-color: rgba(244, 63, 94, 0.35); background: rgba(244, 63, 94, 0.10); color: rgba(15, 23, 42, 0.85); }

/* Two-column layout */
body.loans-fcill .detail-two-column {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 1.5rem;
}

/* Key–value detail list */
body.loans-fcill .detail-list {
	display: flex;
	flex-direction: column;
	gap: 0;
}
body.loans-fcill .detail-list-item {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	padding: 0.65rem 0;
	border-bottom: 1px solid var(--fc-border);
	transition: none !important;
}
body.loans-fcill .detail-list-item:hover {
	background: transparent !important;
	margin: 0 !important;
	padding: 0.65rem 0 !important;
	border-radius: 0 !important;
}
body.loans-fcill .detail-list-item:last-child { border-bottom: none; }
body.loans-fcill .detail-list-item span:first-child {
	color: var(--fc-muted-2);
	font-weight: 650;
	font-size: 0.88rem;
	flex: 0 0 40%;
}
body.loans-fcill .detail-list-item span:last-child {
	color: var(--fc-text);
	font-weight: 550;
	text-align: right;
	flex: 1;
}

/* Progress */
body.loans-fcill .progress-stack {
	background: var(--fc-surface-3);
	border: 1px solid var(--fc-border);
	border-radius: var(--brand-radius);
	padding: 1rem;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}
body.loans-fcill .progress-wrapper {
	height: 10px;
	background: var(--fc-border);
	border-radius: 999px;
	overflow: hidden;
	box-shadow: none;
}
body.loans-fcill .progress-bar {
	height: 100%;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--brand-primary), var(--brand-emerald, #10b981));
	transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
body.loans-fcill .progress-bar::after { display: none; }

/* Empty states */
body.loans-fcill .empty-state {
	padding: 2.5rem 1.5rem;
	text-align: center;
	color: var(--fc-muted);
	background: var(--fc-surface-3);
	border: 2px dashed var(--fc-border);
	border-radius: var(--brand-radius);
}
body.loans-fcill .empty-state i {
	color: var(--brand-primary);
	opacity: 0.5;
	font-size: 2rem;
	margin-bottom: 0.75rem;
}

/* Status update form */
body.loans-fcill .status-update-form {
	background: var(--fc-surface-3);
	border: 1px solid var(--fc-border);
	border-radius: var(--brand-radius);
	padding: 1.25rem;
	margin-top: 1.5rem;
}
body.loans-fcill .status-update-form form {
	display: grid;
	grid-template-columns: 1fr 2fr auto;
	gap: 1rem;
	align-items: end;
}
body.loans-fcill .form-label {
	color: var(--fc-text);
	font-weight: 650;
	font-size: 0.88rem;
}

/* Finance alert */
body.loans-fcill .finance-alert {
	border: 1px solid rgba(59, 130, 246, 0.35);
	background: rgba(59, 130, 246, 0.08);
	color: var(--brand-primary);
	border-radius: var(--brand-radius);
	border-left: 4px solid var(--brand-primary);
	padding: 1rem 1.25rem;
	font-weight: 650;
	box-shadow: none;
	margin-bottom: 1.5rem;
}

/* Guarantor components */
body.loans-fcill .guarantor-management {
	background: var(--fc-surface-3);
	border: 1px solid var(--fc-border);
	border-radius: var(--brand-radius);
	padding: 1.25rem;
	margin-top: 1.5rem;
	box-shadow: none;
}
body.loans-fcill .guarantor-list {
	display: grid;
	gap: 1.5rem;
}
body.loans-fcill .guarantor-card {
	background: var(--fc-surface);
	border: 1px solid var(--fc-border);
	border-radius: var(--brand-radius);
	padding: 1.25rem;
	box-shadow: none;
	transition: none;
}
body.loans-fcill .guarantor-card:hover {
	transform: none;
	box-shadow: none;
}
body.loans-fcill .guarantor-card-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	margin-bottom: 1rem;
}
body.loans-fcill .guarantor-card-header h4 {
	margin: 0;
	font-size: 1rem;
	font-weight: 700;
	color: var(--fc-text);
}
body.loans-fcill .guarantor-remove {
	border: none;
	background: rgba(244, 63, 94, 0.10);
	color: var(--brand-rose, #ef4444);
	padding: 0.35rem 0.75rem;
	border-radius: 999px;
	font-weight: 650;
	cursor: pointer;
	transition: var(--transition-base);
}
body.loans-fcill .guarantor-remove:hover {
	background: rgba(244, 63, 94, 0.20);
}
body.loans-fcill .guarantor-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 1rem;
}
body.loans-fcill .guarantor-grid .form-group {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}
body.loans-fcill .guarantor-grid label {
	color: var(--fc-muted-2);
	font-weight: 650;
	font-size: 0.82rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}
body.loans-fcill .guarantor-grid input,
body.loans-fcill .guarantor-grid textarea,
body.loans-fcill .guarantor-grid select {
	border-radius: 16px !important;
	border: 1px solid var(--fc-border) !important;
	background: var(--fc-surface-solid) !important;
	color: var(--fc-text) !important;
	padding: 0.65rem 0.75rem;
}
body.loans-fcill .guarantor-grid textarea {
	min-height: 90px;
	resize: vertical;
}
body.loans-fcill .guarantor-actions {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 1rem;
	margin-bottom: 1.5rem;
}
body.loans-fcill .guarantor-feedback {
	font-size: 0.9rem;
	font-weight: 650;
	color: var(--fc-muted);
}
body.loans-fcill .guarantor-feedback.success { color: var(--brand-emerald, #10b981); }
body.loans-fcill .guarantor-feedback.error   { color: var(--brand-rose, #ef4444); }

/* Finance button .success variant */
body.loans-fcill .finance-btn.success {
	background: linear-gradient(135deg, var(--brand-emerald, #10b981), #059669) !important;
	border-color: var(--brand-emerald, #10b981) !important;
	color: #fff !important;
}
body.loans-fcill .finance-btn.success:hover {
	box-shadow: 0 4px 14px rgba(16, 185, 129, 0.28) !important;
	filter: brightness(1.04);
}

/* Finance button .danger variant */
body.loans-fcill .finance-btn.danger {
	background: linear-gradient(135deg, #ef4444, #dc2626) !important;
	border-color: #ef4444 !important;
	color: #fff !important;
}
body.loans-fcill .finance-btn.danger:hover {
	box-shadow: 0 4px 14px rgba(239, 68, 68, 0.28) !important;
	filter: brightness(1.04);
}

/* Finance button .warning variant */
body.loans-fcill .finance-btn.warning {
	background: linear-gradient(135deg, #f59e0b, #d97706) !important;
	border-color: #f59e0b !important;
	color: #fff !important;
}
body.loans-fcill .finance-btn.warning:hover {
	box-shadow: 0 4px 14px rgba(245, 158, 11, 0.28) !important;
	filter: brightness(1.04);
}

/* Small button variant */
body.loans-fcill .finance-btn.sm {
	padding: 0.42rem 0.85rem;
	font-size: 0.8rem;
	font-weight: 650;
}

/* Responsive – detail page */
@media (max-width: 768px) {
	body.loans-fcill .loan-detail-nav {
		gap: 0.35rem;
	}
	body.loans-fcill .loan-detail-nav a {
		font-size: 0.82rem;
		padding: 0.45rem 0.75rem;
	}
	body.loans-fcill .detail-header {
		flex-direction: column;
		align-items: flex-start;
	}
	body.loans-fcill .detail-search-pill {
		border-radius: 20px;
		padding: 0.5rem;
	}
	body.loans-fcill .detail-search-pill .search-icon {
		width: 36px;
		height: 36px;
	}
	body.loans-fcill .detail-two-column {
		grid-template-columns: 1fr;
	}
	body.loans-fcill .detail-summary-grid {
		grid-template-columns: 1fr;
	}
	body.loans-fcill .status-update-form form {
		grid-template-columns: 1fr;
	}
	body.loans-fcill .guarantor-card-header {
		flex-direction: column;
		align-items: flex-start;
	}
}

/* Bootstrap modals (global FCILL skin for Loans)
   Many legacy Loans screens still open Bootstrap 5 modals (create loan, provider CRUD, delete confirm).
   This ensures *all* modals match the FCILL surface/radius/typography without rewriting business logic.
*/
body.loans-fcill .modal-backdrop.show {
	opacity: 0.62;
}

body.loans-fcill .modal-dialog {
	margin: 1.25rem auto;
}

body.loans-fcill .modal-dialog.modal-xl {
	max-width: 1100px !important;
}

body.loans-fcill .modal-content {
	background: var(--fc-surface-elevated) !important;
	border: 1px solid var(--fc-border) !important;
	border-radius: var(--brand-radius) !important;
	box-shadow: var(--brand-shadow) !important;
	overflow: hidden;
}

body.loans-fcill .modal-content .modal-header {
	padding: 1.1rem 1.25rem !important;
	border-bottom: 1px solid var(--fc-border) !important;
	background: rgba(255, 255, 255, 0.45) !important;
	backdrop-filter: blur(14px);
}

body.loans-fcill .modal-content .modal-title {
	margin: 0 !important;
	font-size: 1.15rem !important;
	font-weight: 860 !important;
	letter-spacing: -0.03em;
	color: var(--fc-text) !important;
}

body.loans-fcill .modal-content .modal-body {
	padding: 1.25rem !important;
	color: var(--fc-text) !important;
}

body.loans-fcill .modal-content .modal-body {
	max-height: 80vh;
	overflow: auto;
}

body.loans-fcill .modal-content .modal-footer {
	padding: 1rem 1.25rem !important;
	border-top: 1px solid var(--fc-border) !important;
	background: rgba(255, 255, 255, 0.35) !important;
}

body.loans-fcill .modal-content .btn-close {
	opacity: 0.78;
	transition: var(--transition-base);
	border-radius: 999px;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 1px solid var(--fc-border);
	background-color: rgba(15, 23, 42, 0.06);
}

body.loans-fcill .modal-content .btn-close:hover {
	opacity: 1;
	transform: translateY(-1px);
	border-color: rgba(59, 130, 246, 0.35);
}

/* Stepper pills used in create-loan + similar wizards (legacy class names) */
body.loans-fcill .step-indicators {
	gap: 0.5rem !important;
}

body.loans-fcill .step-indicator {
	padding: 0.55rem 0.75rem !important;
	border-radius: 999px !important;
	border: 1px solid var(--fc-border) !important;
	background: var(--fc-surface-elevated) !important;
	color: var(--fc-muted) !important;
	font-weight: 780 !important;
	font-size: 0.88rem !important;
	box-shadow: none !important;
}

body.loans-fcill .step-indicator.active {
	background: rgba(59, 130, 246, 0.10) !important;
	border-color: rgba(59, 130, 246, 0.55) !important;
	color: var(--brand-primary) !important;
}

body.loans-fcill .step-indicator.completed {
	background: rgba(34, 197, 94, 0.12) !important;
	border-color: rgba(34, 197, 94, 0.35) !important;
	color: rgba(15, 23, 42, 0.85) !important;
}

body.loans-fcill .loan-step {
	padding: 0.5rem 0 0;
}

body.loans-fcill .step-header {
	margin: 0 0 1.15rem !important;
	padding: 0 0 0.95rem !important;
	border-bottom: 1px solid var(--fc-border) !important;
}

body.loans-fcill .step-header h4 {
	margin: 0;
	font-size: 1.45rem;
	font-weight: 880;
	letter-spacing: -0.04em;
	color: var(--fc-text) !important;
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
}

body.loans-fcill .step-header h4 i {
	color: var(--brand-primary);
}

body.loans-fcill .step-header p {
	margin: 0.35rem 0 0;
	font-size: 0.98rem;
	color: var(--fc-muted) !important;
}

body.loans-fcill .step-navigation {
	margin-top: 1.25rem !important;
	padding-top: 1rem !important;
	border-top: 1px solid var(--fc-border) !important;
}

body.loans-fcill .search-results {
	margin-top: 1rem !important;
	border: 1px solid var(--fc-border) !important;
	border-radius: 18px !important;
	padding: 1rem !important;
	background: var(--fc-surface) !important;
}

body.loans-fcill .search-results h6 {
	margin: 0 0 0.75rem;
	font-weight: 860;
	color: var(--fc-text) !important;
}

@media (max-width: 768px) {
	body.loans-fcill .modal-dialog {
		margin: 0.75rem;
	}

	body.loans-fcill .modal-dialog.modal-xl {
		max-width: none;
	}
}

/* ═══════════════════════════════════════════════════════════════
   Edit-mode form components (merged from loan_edit.php)
   ═══════════════════════════════════════════════════════════════ */

body.loans-fcill .form-card {
	background: var(--fc-surface);
	border: 1px solid var(--fc-border);
	border-radius: var(--brand-radius, 18px);
	padding: 1.5rem;
}

body.loans-fcill .form-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 1rem;
}

body.loans-fcill .form-grid .full-width {
	grid-column: 1 / -1;
}

body.loans-fcill .form-group {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

body.loans-fcill .form-group label {
	font-size: 0.82rem;
	font-weight: 700;
	color: var(--fc-muted);
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

body.loans-fcill .form-group input,
body.loans-fcill .form-group select,
body.loans-fcill .form-group textarea {
	padding: 0.55rem 0.75rem;
	font-size: 0.95rem;
	border: 1px solid var(--fc-border);
	border-radius: 10px;
	background: var(--fc-surface);
	color: var(--fc-text);
	transition: border-color 0.2s, box-shadow 0.2s;
	font-family: inherit;
}

body.loans-fcill .form-group input:focus,
body.loans-fcill .form-group select:focus,
body.loans-fcill .form-group textarea:focus {
	outline: none;
	border-color: var(--brand-primary);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

body.loans-fcill .form-group input:disabled,
body.loans-fcill .form-group select:disabled,
body.loans-fcill .form-group textarea:disabled {
	opacity: 0.55;
	cursor: not-allowed;
	background: var(--fc-surface-3, #f3f4f6);
}

body.loans-fcill .form-group textarea {
	min-height: 80px;
	resize: vertical;
}

body.loans-fcill .form-group.focused label {
	color: var(--brand-primary);
}

body.loans-fcill .form-switch {
	display: flex;
	align-items: center;
	gap: 0.6rem;
}

body.loans-fcill .form-switch input[type="checkbox"] {
	width: 18px;
	height: 18px;
	accent-color: var(--brand-primary);
	cursor: pointer;
}

body.loans-fcill .form-switch label {
	font-size: 0.92rem;
	font-weight: 600;
	color: var(--fc-text);
	cursor: pointer;
	text-transform: none;
	letter-spacing: 0;
}

/* ── Edit-mode banner ─────────────────────────────────────────── */

body.loans-fcill .edit-mode-banner {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.85rem 1.25rem;
	background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
	border: 1px solid #93c5fd;
	border-radius: var(--brand-radius, 18px);
	margin-bottom: 1.5rem;
	color: #1e40af;
	font-size: 0.92rem;
	font-weight: 600;
}

body.loans-fcill .edit-mode-banner i {
	font-size: 1.1rem;
}

/* ── Change log list ──────────────────────────────────────────── */

body.loans-fcill .change-list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	font-size: 0.88rem;
}

body.loans-fcill .change-list li {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	flex-wrap: wrap;
}

body.loans-fcill .change-metadata {
	font-size: 0.82rem;
	color: var(--fc-muted);
	margin-top: 0.25rem;
}

/* ── Schedule editor modal ────────────────────────────────────── */

body.loans-fcill .schedule-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
	backdrop-filter: blur(4px);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 2000;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s;
}

body.loans-fcill .schedule-modal-overlay.active {
	opacity: 1;
	pointer-events: auto;
}

body.loans-fcill .schedule-modal {
	background: var(--fc-surface);
	border-radius: var(--brand-radius, 18px);
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
	width: 95%;
	max-width: 640px;
	max-height: 90vh;
	overflow-y: auto;
}

body.loans-fcill .schedule-modal header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 1.25rem 1.5rem;
	border-bottom: 1px solid var(--fc-border);
}

body.loans-fcill .schedule-modal header h3 {
	font-size: 1.15rem;
	font-weight: 800;
	color: var(--fc-text);
}

body.loans-fcill .schedule-modal .modal-body {
	padding: 1.5rem;
}

body.loans-fcill .schedule-modal .modal-actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1rem 1.5rem;
	border-top: 1px solid var(--fc-border);
	flex-wrap: wrap;
}

body.loans-fcill .schedule-modal .action-buttons {
	display: flex;
	gap: 0.5rem;
}

body.loans-fcill .notify-hint {
	font-size: 0.8rem;
	color: var(--fc-muted);
	margin-top: 0.25rem;
}

/* ── Schedule actions hint row ────────────────────────────────── */

body.loans-fcill .schedule-actions {
	margin-bottom: 1rem;
	padding: 0.65rem 1rem;
	background: var(--fc-surface-3, #f9fafb);
	border-radius: 10px;
	border: 1px solid var(--fc-border);
}

/* ── Toast notifications ──────────────────────────────────────── */

.schedule-toast-container {
	position: fixed;
	top: 1rem;
	right: 1rem;
	z-index: 2100;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.schedule-toast {
	padding: 0.75rem 1.25rem;
	border-radius: 12px;
	font-size: 0.9rem;
	font-weight: 600;
	color: #fff;
	opacity: 0;
	transform: translateX(40px);
	transition: opacity 0.3s, transform 0.3s;
	max-width: 360px;
}

.schedule-toast.visible {
	opacity: 1;
	transform: translateX(0);
}

.schedule-toast.success {
	background: linear-gradient(135deg, #059669, #10b981);
}

.schedule-toast.error {
	background: linear-gradient(135deg, #dc2626, #ef4444);
}

/* ── Read-only lock banner ────────────────────────────────────── */

body.loans-fcill .edit-lock-banner {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.85rem 1.25rem;
	background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
	border: 1px solid #f59e0b;
	border-radius: var(--brand-radius, 18px);
	margin-bottom: 1.5rem;
	color: #92400e;
	font-size: 0.92rem;
	font-weight: 600;
}

body.loans-fcill .edit-lock-banner i {
	font-size: 1.1rem;
}

/* ── Bottom save bar ──────────────────────────────────────────── */

body.loans-fcill .edit-save-bar {
	display: flex;
	justify-content: flex-end;
	gap: 0.75rem;
	padding: 1.25rem 0 0;
	margin-top: 1.5rem;
	border-top: 1px solid var(--fc-border);
}

/* ═══════════════════════════════════════════════════════════════
   Record Payment page (FCILL version)
   ═══════════════════════════════════════════════════════════════ */

/* Tab pill nav */
body.loans-fcill .rp-tab-nav {
	display: flex;
	gap: 0.5rem;
	flex-wrap: wrap;
	padding: 0 0 1.5rem;
	justify-content: center;
}
body.loans-fcill .rp-tab-nav button {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.55rem 1rem;
	border-radius: 999px;
	border: 1px solid var(--fc-border);
	background: var(--fc-surface-elevated, #fff);
	color: var(--fc-muted);
	font-weight: 700;
	font-size: 0.88rem;
	cursor: pointer;
	transition: border-color 0.2s, background 0.2s, color 0.2s;
}
body.loans-fcill .rp-tab-nav button:hover,
body.loans-fcill .rp-tab-nav button.active {
	border-color: rgba(59, 130, 246, 0.55);
	background: rgba(59, 130, 246, 0.08);
	color: var(--brand-primary);
}
body.loans-fcill .rp-tab-nav button i {
	font-size: 0.82rem;
}

/* Summary strip */
body.loans-fcill .rp-summary-strip {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	align-items: center;
	margin-bottom: 0.5rem;
}
body.loans-fcill .rp-summary-strip .fc-badge {
	font-size: 0.85rem;
	padding: 0.4rem 0.85rem;
}

/* Info banner */
body.loans-fcill .rp-info-banner {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	padding: 1rem 1.25rem;
	border-radius: var(--brand-radius, 18px);
	border: 1px solid rgba(59, 130, 246, 0.2);
	background: rgba(59, 130, 246, 0.05);
	margin-bottom: 1.5rem;
	font-size: 0.92rem;
	color: var(--fc-text);
	line-height: 1.55;
}
body.loans-fcill .rp-info-banner i {
	color: var(--brand-primary);
	flex: 0 0 auto;
	margin-top: 0.15rem;
	font-size: 1.1rem;
}

/* Mobile money hint */
body.loans-fcill .rp-mobile-hint {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	padding: 1rem 1.25rem;
	border-radius: var(--brand-radius, 18px);
	border: 1px solid rgba(16, 185, 129, 0.3);
	background: rgba(16, 185, 129, 0.06);
	margin-bottom: 1rem;
	font-size: 0.92rem;
	color: var(--fc-text);
	line-height: 1.55;
}
body.loans-fcill .rp-mobile-hint i {
	color: var(--brand-emerald, #10b981);
	flex: 0 0 auto;
	margin-top: 0.15rem;
}

/* Tab panels */
body.loans-fcill .rp-tab-panel {
	display: none;
}
body.loans-fcill .rp-tab-panel.active {
	display: block;
}

/* Email preview */
body.loans-fcill .rp-email-preview {
	min-height: 260px;
	background: var(--fc-surface-3, #f3f4f6);
	border-radius: 12px;
	padding: 1rem 1.25rem;
	font-family: 'Fira Code', 'Consolas', monospace;
	font-size: 0.88rem;
	white-space: pre-wrap;
	color: var(--fc-text);
	border: 1px solid var(--fc-border);
	line-height: 1.6;
	overflow-y: auto;
	max-height: 360px;
}

/* Action footer */
body.loans-fcill .rp-action-footer {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	margin-top: 1.5rem;
	padding: 1.25rem 1.5rem;
	background: var(--fc-surface-3, #f3f4f6);
	border-radius: var(--brand-radius, 18px);
	border: 1px solid var(--fc-border);
}
body.loans-fcill .rp-action-footer small {
	color: var(--fc-muted);
	font-size: 0.85rem;
}

/* Payment radio group */
body.loans-fcill .rp-radio-group {
	display: flex;
	flex-wrap: wrap;
	gap: 1.25rem;
}
body.loans-fcill .rp-radio-group label {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	font-size: 0.92rem;
	font-weight: 600;
	color: var(--fc-text);
	cursor: pointer;
}
body.loans-fcill .rp-radio-group input[type="radio"] {
	accent-color: var(--brand-primary);
	width: 16px;
	height: 16px;
}

/* Loading indicator */
body.loans-fcill .rp-loading {
	display: none;
	align-items: center;
	gap: 0.5rem;
	color: var(--brand-primary);
	font-weight: 600;
	font-size: 0.88rem;
}
body.loans-fcill .rp-loading.active {
	display: inline-flex;
}

/* Record payment toast */
body.loans-fcill .rp-toast-container {
	position: fixed;
	top: 1.5rem;
	right: 1.5rem;
	z-index: 9999;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	pointer-events: none;
}
body.loans-fcill .rp-toast {
	pointer-events: auto;
	padding: 0.75rem 1.25rem;
	border-radius: 12px;
	font-size: 0.9rem;
	font-weight: 600;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	animation: rpToastIn 0.3s ease forwards;
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
body.loans-fcill .rp-toast.success {
	background: rgba(34, 197, 94, 0.12);
	border: 1px solid rgba(34, 197, 94, 0.35);
	color: #047857;
}
body.loans-fcill .rp-toast.error {
	background: rgba(244, 63, 94, 0.12);
	border: 1px solid rgba(244, 63, 94, 0.35);
	color: #be123c;
}
@keyframes rpToastIn {
	from { opacity: 0; transform: translateX(40px); }
	to   { opacity: 1; transform: translateX(0); }
}

/* Email columns */
body.loans-fcill .rp-email-columns {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
}

@media (max-width: 768px) {
	body.loans-fcill .rp-action-footer {
		flex-direction: column;
		align-items: stretch;
	}
	body.loans-fcill .rp-email-columns {
		grid-template-columns: 1fr;
	}
}
