/* ===== CRM - style Monday ===== */

.crm-nav{
	display: flex;
	gap: 4px;
	margin: 0 0 24px;
	border-bottom: 1px solid #d0d4e4;
	flex-wrap: wrap;
}
.crm-nav__link{
	padding: 10px 16px;
	text-decoration: none;
	color: #323338;
	font-size: 14px;
	border-radius: 6px 6px 0 0;
	border-bottom: 2px solid transparent;
}
.crm-nav__link:hover{ background: #eceff8; }
.crm-nav__link.is-active{
	border-bottom-color: #0073ea;
	color: #0073ea;
	font-weight: 600;
}

.crm-screen{ max-width: 1200px; margin: 0 auto; }

.crm-toolbar{
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 16px;
}
.crm-title{ font-size: 24px; margin: 0; flex: 1; }
.crm-search{
	padding: 8px 12px;
	border: 1px solid #c3c6d4;
	border-radius: 4px;
	font-size: 14px;
	width: 220px;
}

.crm-btn{
	padding: 8px 16px;
	border: 1px solid #c3c6d4;
	border-radius: 4px;
	background: #fff;
	cursor: pointer;
	font-size: 14px;
	transition: background .15s;
}
.crm-btn:hover{ background: #eceff8; }
.crm-btn--primary{ background: #0073ea; border-color: #0073ea; color: #fff; }
.crm-btn--primary:hover{ background: #0060c2; }
.crm-btn--danger{ background: #fff; border-color: #e2445c; color: #e2445c; }
.crm-btn--danger:hover{ background: #fdeef1; }

/* Tableau */
.crm-table-wrap{ overflow-x: auto; }
.crm-table{
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	font-size: 14px;
	background: #fff;
	border: 1px solid #d0d4e4;
	border-radius: 8px;
	overflow: hidden;
}
.crm-table th{
	background: #f5f6f8;
	text-align: left;
	padding: 10px 12px;
	font-weight: 600;
	color: #676879;
	border-bottom: 1px solid #d0d4e4;
	cursor: pointer;
	user-select: none;
	white-space: nowrap;
}
.crm-table th .crm-sort{ opacity: .4; margin-left: 4px; }
.crm-table th.is-sorted .crm-sort{ opacity: 1; color: #0073ea; }
.crm-table td{
	padding: 10px 12px;
	border-bottom: 1px solid #ebedf3;
	color: #323338;
}
.crm-table tbody tr{ cursor: pointer; transition: background .1s; }
.crm-table tbody tr:hover{ background: #eef4fd; }
.crm-table tbody tr:last-child td{ border-bottom: none; }
.crm-empty{ padding: 32px; text-align: center; color: #676879; }

/* Pastilles statut (style Monday) */
.crm-pill{
	display: inline-block;
	padding: 4px 12px;
	border-radius: 4px;
	color: #fff;
	font-size: 13px;
	font-weight: 500;
	min-width: 110px;
	text-align: center;
}
.crm-pill--prospect_froid{ background: #579bfc; }
.crm-pill--prospect{ background: #fdab3d; }
.crm-pill--client{ background: #00c875; }

/* Popup */
.crm-modal-overlay{
	position: fixed;
	inset: 0;
	background: rgba(41, 47, 76, .55);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 99999;
	padding: 20px;
}
.crm-modal{
	background: #fff;
	border-radius: 8px;
	width: 640px;
	max-width: 100%;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: 0 15px 50px rgba(0,0,0,.3);
}
.crm-modal__header{
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 24px;
	border-bottom: 1px solid #ebedf3;
}
.crm-modal__header h2{ margin: 0; font-size: 18px; }
.crm-modal__close{
	background: none;
	border: none;
	font-size: 22px;
	cursor: pointer;
	color: #676879;
	line-height: 1;
}
.crm-modal__body{ padding: 24px; }
.crm-modal__footer{
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 24px;
	border-top: 1px solid #ebedf3;
}
.crm-modal__footer .crm-modal__actions{ display: flex; gap: 8px; margin-left: auto; }

.crm-grid{
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
}
.crm-field{ display: flex; flex-direction: column; gap: 4px; }
.crm-field--full{ grid-column: 1 / -1; }
.crm-field label{ font-size: 13px; color: #676879; }
.crm-field input,
.crm-field select,
.crm-field textarea{
	padding: 8px 10px;
	border: 1px solid #c3c6d4;
	border-radius: 4px;
	font-size: 14px;
	font-family: inherit;
}
.crm-field input:focus,
.crm-field select:focus,
.crm-field textarea:focus{ outline: 2px solid #0073ea; outline-offset: -1px; }

.crm-error{ color: #e2445c; font-size: 13px; margin-top: 8px; display: none; }

@media (max-width: 600px){
	.crm-grid{ grid-template-columns: 1fr; }
	.crm-toolbar{ flex-wrap: wrap; }
}

/* ===== v1.1 ===== */

/* Pastilles leads */
.crm-pill--nouveau{ background: #fdab3d; }
.crm-pill--converti{ background: #00c875; }
.crm-pill--ignore{ background: #c4c4c4; }

/* Repeater contacts (popup société) */
.crm-subcontacts{ margin-top: 24px; border-top: 1px solid #ebedf3; padding-top: 16px; }
.crm-subcontacts h3{ margin: 0 0 12px; font-size: 15px; color: #676879; }
.crm-subcontact-row{
	display: grid;
	grid-template-columns: 1fr 1fr 1.4fr 1fr auto;
	gap: 8px;
	margin-bottom: 8px;
}
.crm-subcontact-row input{
	padding: 8px 10px;
	border: 1px solid #c3c6d4;
	border-radius: 4px;
	font-size: 13px;
}
.crm-subcontact-remove{ padding: 4px 10px; }

/* Détails lead */
.crm-lead-details{ width: 100%; border-collapse: collapse; font-size: 14px; }
.crm-lead-details th{
	text-align: left;
	padding: 6px 12px 6px 0;
	color: #676879;
	font-weight: 600;
	white-space: nowrap;
	vertical-align: top;
	width: 40%;
}
.crm-lead-details td{ padding: 6px 0; color: #323338; }
.crm-lead-details tr{ border-bottom: 1px solid #f0f1f5; }
.crm-lead-linked{ margin-top: 16px; color: #00c875; font-weight: 500; }

/* Select2 dans le popup */
.crm-modal .select2-container{ width: 100% !important; }
.crm-modal .select2-selection--single{
	height: 38px;
	border: 1px solid #c3c6d4;
	border-radius: 4px;
}
.crm-modal .select2-selection__rendered{ line-height: 36px !important; }
.crm-modal .select2-selection__arrow{ height: 36px !important; }

/* Le pac-container Google doit passer au-dessus du popup */
.pac-container{ z-index: 100000 !important; }

@media (max-width: 600px){
	.crm-subcontact-row{ grid-template-columns: 1fr 1fr; }
}
