/**
 * Simulateur d'investissement locatif - styles.
 *
 * 100 % scope sous #dbfi-sim-locatif. Aucune regle globale.
 * Portage a l'identique des styles qui vivaient dans la page :
 * - Tailwind CDN supprime (aucune classe utilitaire n'etait utilisee) ;
 * - les selecteurs globaux (body, *, table, thead, th, td) sont scopes ;
 * - CSS Grid remplace par flexbox (regle projet).
 */

#dbfi-sim-locatif {
	width: 100%;
	padding: 32px 20px;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	background: #ffffff;
	color: #1e293b;
}

#dbfi-sim-locatif,
#dbfi-sim-locatif *,
#dbfi-sim-locatif *::before,
#dbfi-sim-locatif *::after {
	box-sizing: border-box;
}

#dbfi-sim-locatif .loc-container {
	max-width: 1600px;
	margin: 0 auto;
	background: #ffffff;
	border-radius: 24px;
	box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
	overflow: hidden;
}

/* Etait .content-grid : display grid 450px 1fr -> flexbox. */
#dbfi-sim-locatif .loc-layout {
	display: flex;
	flex-direction: row;
	align-items: stretch;
	gap: 0;
	min-height: 700px;
}

#dbfi-sim-locatif .loc-sidebar {
	flex: 0 0 450px;
	min-width: 0;
	background: #f8fafc;
	padding: 32px;
	border-right: 2px solid #e2e8f0;
	overflow-y: auto;
	max-height: 800px;
}

#dbfi-sim-locatif .loc-sidebar::-webkit-scrollbar,
#dbfi-sim-locatif .loc-results::-webkit-scrollbar {
	width: 6px;
}

#dbfi-sim-locatif .loc-sidebar::-webkit-scrollbar-track,
#dbfi-sim-locatif .loc-results::-webkit-scrollbar-track {
	background: #e2e8f0;
}

#dbfi-sim-locatif .loc-sidebar::-webkit-scrollbar-thumb,
#dbfi-sim-locatif .loc-results::-webkit-scrollbar-thumb {
	background: #b3bc00;
	border-radius: 3px;
}

#dbfi-sim-locatif .loc-results {
	flex: 1 1 0;
	min-width: 0;
	padding: 32px;
	overflow-y: auto;
	max-height: 800px;
}

#dbfi-sim-locatif .loc-section-title {
	font-size: 24px;
	font-weight: 800;
	color: #000000;
	margin: 0 0 24px 0;
	padding-bottom: 12px;
	border-bottom: 4px solid #b3bc00;
	display: flex;
	align-items: center;
	gap: 12px;
}

#dbfi-sim-locatif .loc-subsection-title {
	font-size: 16px;
	font-weight: 700;
	color: #b3bc00;
	margin: 24px 0 16px 0;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

#dbfi-sim-locatif .loc-field {
	margin-bottom: 20px;
}

#dbfi-sim-locatif .loc-field label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: #475569;
	margin-bottom: 8px;
}

#dbfi-sim-locatif .loc-input-wrap {
	position: relative;
}

#dbfi-sim-locatif .loc-field input {
	width: 100%;
	padding: 12px 14px;
	border: 2px solid #cbd5e1;
	border-radius: 10px;
	font-size: 15px;
	font-weight: 500;
	transition: all 0.2s;
	background: #ffffff;
	color: #1e293b;
}

#dbfi-sim-locatif .loc-field input:focus {
	outline: none;
	border-color: #b3bc00;
	box-shadow: 0 0 0 4px rgba(179, 188, 0, 0.1);
}

#dbfi-sim-locatif .loc-unit {
	position: absolute;
	right: 14px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 14px;
	font-weight: 600;
	color: #64748b;
	pointer-events: none;
}

#dbfi-sim-locatif .loc-btn {
	width: 100%;
	background: #b3bc00;
	color: #000000;
	border: none;
	padding: 16px 32px;
	border-radius: 12px;
	font-size: 18px;
	font-weight: 700;
	cursor: pointer;
	transition: all 0.3s;
	margin-top: 24px;
	box-shadow: 0 4px 15px rgba(179, 188, 0, 0.4);
}

#dbfi-sim-locatif .loc-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 25px rgba(179, 188, 0, 0.6);
	background: #c5cf00;
}

#dbfi-sim-locatif .loc-btn:active {
	transform: translateY(0);
}

/* Bandeau d'information. */
#dbfi-sim-locatif .loc-info {
	background: #f8fafc;
	border: 2px solid #b3bc00;
	border-radius: 12px;
	padding: 16px 20px;
	margin-bottom: 24px;
	display: flex;
	align-items: center;
	gap: 12px;
}

#dbfi-sim-locatif .loc-info-icon {
	font-size: 24px;
}

#dbfi-sim-locatif .loc-info-text {
	font-size: 13px;
	color: #000000;
	font-weight: 500;
	line-height: 1.5;
}

/* Etait .kpi-grid : grid 2 colonnes -> flexbox. */
#dbfi-sim-locatif .loc-kpis {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	margin-bottom: 32px;
}

#dbfi-sim-locatif .loc-kpi {
	flex: 1 1 calc(50% - 10px);
	min-width: 0;
	background: #ffffff;
	border-radius: 16px;
	padding: 24px;
	border: 3px solid #b3bc00;
	box-shadow: 0 4px 20px rgba(179, 188, 0, 0.15);
	transition: all 0.3s;
}

#dbfi-sim-locatif .loc-kpi:hover {
	transform: translateY(-4px);
	box-shadow: 0 8px 30px rgba(179, 188, 0, 0.3);
	border-color: #c5cf00;
}

#dbfi-sim-locatif .loc-kpi-label {
	font-size: 13px;
	color: #64748b;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 12px;
}

#dbfi-sim-locatif .loc-kpi-value {
	font-size: 32px;
	font-weight: 800;
	color: #1e293b;
	line-height: 1;
}

#dbfi-sim-locatif .loc-kpi-value.loc-pos {
	color: #10b981;
}

#dbfi-sim-locatif .loc-kpi-value.loc-neg {
	color: #ef4444;
}

/* Etait .summary-grid : grid 3 colonnes -> flexbox. */
#dbfi-sim-locatif .loc-summary {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin-bottom: 32px;
	padding: 24px;
	background: #f8fafc;
	border-radius: 16px;
	border: 2px solid #e2e8f0;
}

#dbfi-sim-locatif .loc-summary-item {
	flex: 1 1 calc(33.333% - 11px);
	min-width: 0;
	text-align: center;
}

#dbfi-sim-locatif .loc-summary-label {
	font-size: 12px;
	color: #64748b;
	font-weight: 600;
	margin-bottom: 8px;
	text-transform: uppercase;
}

#dbfi-sim-locatif .loc-summary-value {
	font-size: 20px;
	font-weight: 700;
	color: #1e293b;
}

/* Accordeon. */
#dbfi-sim-locatif .loc-accordion {
	margin-bottom: 16px;
	border: 2px solid #e2e8f0;
	border-radius: 12px;
	overflow: hidden;
	background: #ffffff;
}

#dbfi-sim-locatif .loc-accordion-header {
	padding: 16px 20px;
	background: #f8fafc;
	cursor: pointer;
	display: flex;
	justify-content: space-between;
	align-items: center;
	transition: background 0.2s;
}

#dbfi-sim-locatif .loc-accordion-header:hover {
	background: #f1f5f9;
}

#dbfi-sim-locatif .loc-accordion-title {
	font-size: 16px;
	font-weight: 700;
	color: #1e293b;
}

#dbfi-sim-locatif .loc-accordion-icon {
	font-size: 20px;
	color: #b3bc00;
	transition: transform 0.3s;
}

#dbfi-sim-locatif .loc-accordion.is-open .loc-accordion-icon {
	transform: rotate(180deg);
}

#dbfi-sim-locatif .loc-accordion-content {
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.3s ease-out;
}

#dbfi-sim-locatif .loc-accordion.is-open .loc-accordion-content {
	max-height: 2000px;
}

#dbfi-sim-locatif .loc-accordion-body {
	padding: 20px;
}

/* Etait .detail-grid : grid 2 colonnes -> flexbox. */
#dbfi-sim-locatif .loc-details {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
}

#dbfi-sim-locatif .loc-detail {
	flex: 1 1 calc(50% - 8px);
	min-width: 0;
	background: #f8fafc;
	padding: 16px;
	border-radius: 10px;
	border-left: 4px solid #b3bc00;
}

#dbfi-sim-locatif .loc-detail-label {
	font-size: 12px;
	color: #64748b;
	font-weight: 600;
	margin-bottom: 6px;
}

#dbfi-sim-locatif .loc-detail-value {
	font-size: 18px;
	font-weight: 700;
	color: #1e293b;
}

/* Tableau annuel. */
#dbfi-sim-locatif .loc-table-wrap {
	background: #ffffff;
	border-radius: 16px;
	border: 2px solid #e2e8f0;
	overflow: hidden;
}

#dbfi-sim-locatif .loc-table-scroll {
	overflow-x: auto;
	overflow-y: auto;
	max-height: 500px;
}

#dbfi-sim-locatif table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
	margin: 0;
}

#dbfi-sim-locatif thead {
	background: #ffffff;
	position: sticky;
	top: 0;
	z-index: 10;
}

#dbfi-sim-locatif th {
	padding: 14px 10px;
	text-align: right;
	font-weight: 700;
	color: #b3bc00;
	white-space: nowrap;
	background: #ffffff;
	border: none;
}

#dbfi-sim-locatif th:first-child {
	text-align: center;
}

#dbfi-sim-locatif td {
	padding: 12px 10px;
	text-align: right;
	border-bottom: 1px solid #e2e8f0;
	white-space: nowrap;
}

#dbfi-sim-locatif td:first-child {
	text-align: center;
	font-weight: 700;
	color: #b3bc00;
}

#dbfi-sim-locatif tbody tr:hover {
	background: #f8fafc;
}

#dbfi-sim-locatif td.loc-pos {
	color: #10b981;
	font-weight: 600;
}

#dbfi-sim-locatif td.loc-neg {
	color: #ef4444;
	font-weight: 600;
}

/* Tablette : la colonne de parametres passe au-dessus des resultats. */
@media (max-width: 1200px) {
	#dbfi-sim-locatif .loc-layout {
		flex-direction: column;
	}

	#dbfi-sim-locatif .loc-sidebar {
		flex: 1 1 auto;
		border-right: none;
		border-bottom: 2px solid #e2e8f0;
		max-height: none;
	}

	#dbfi-sim-locatif .loc-results {
		flex: 1 1 auto;
		max-height: none;
	}

	#dbfi-sim-locatif .loc-summary-item {
		flex: 1 1 calc(50% - 8px);
	}
}

/* Mobile. */
@media (max-width: 820px) {
	#dbfi-sim-locatif {
		padding: 20px 12px;
	}

	#dbfi-sim-locatif .loc-container {
		border-radius: 16px;
		box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
	}

	#dbfi-sim-locatif .loc-sidebar,
	#dbfi-sim-locatif .loc-results {
		padding: 20px;
	}

	#dbfi-sim-locatif .loc-section-title {
		font-size: 20px;
	}

	#dbfi-sim-locatif .loc-kpi {
		flex: 1 1 100%;
	}

	#dbfi-sim-locatif .loc-kpi-value {
		font-size: 26px;
	}

	#dbfi-sim-locatif .loc-summary-item {
		flex: 1 1 100%;
	}

	#dbfi-sim-locatif .loc-detail {
		flex: 1 1 100%;
	}
}
