/* MdiFunding Premium CSS — Cockpit Financement MDI */

/* === KPI Cards === */
.mdifunding-kpi-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 16px;
	margin-bottom: 24px;
}
.mdifunding-kpi-card {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: #fff;
	border-radius: 12px;
	padding: 20px;
	text-align: center;
	box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
	transition: transform 0.2s;
}
.mdifunding-kpi-card:hover { transform: translateY(-2px); }
.mdifunding-kpi-card.green { background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); box-shadow: 0 4px 15px rgba(17, 153, 142, 0.3); }
.mdifunding-kpi-card.orange { background: linear-gradient(135deg, #f2994a 0%, #f2c94c 100%); box-shadow: 0 4px 15px rgba(242, 153, 74, 0.3); }
.mdifunding-kpi-card.red { background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%); box-shadow: 0 4px 15px rgba(235, 51, 73, 0.3); }
.mdifunding-kpi-card.blue { background: linear-gradient(135deg, #2193b0 0%, #6dd5ed 100%); box-shadow: 0 4px 15px rgba(33, 147, 176, 0.3); }
.mdifunding-kpi-card.purple { background: linear-gradient(135deg, #8e44ad 0%, #9b59b6 100%); box-shadow: 0 4px 15px rgba(142, 68, 173, 0.3); }
.mdifunding-kpi-card.dark { background: linear-gradient(135deg, #2c3e50 0%, #4ca1af 100%); box-shadow: 0 4px 15px rgba(44, 62, 80, 0.3); }
.mdifunding-kpi-number {
	font-size: 36px;
	font-weight: 800;
	line-height: 1.1;
	margin-bottom: 4px;
}
.mdifunding-kpi-label {
	font-size: 13px;
	opacity: 0.9;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

/* === Badges === */
.mdifunding-badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 12px;
	font-size: 11px;
	font-weight: 600;
	color: #fff;
	white-space: nowrap;
	line-height: 1.4;
}

/* === Progress Bars === */
.mdifunding-progress {
	background: #ecf0f1;
	border-radius: 10px;
	overflow: hidden;
	position: relative;
}
.mdifunding-progress > div {
	transition: width 0.6s ease;
}

/* === Funder Cards Grid === */
.mdifunding-funder-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 20px;
	margin-bottom: 24px;
}
.mdifunding-funder-card {
	background: #fff;
	border: 1px solid #e1e8ed;
	border-radius: 12px;
	padding: 20px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.06);
	transition: box-shadow 0.2s, transform 0.2s;
}
.mdifunding-funder-card:hover {
	box-shadow: 0 6px 20px rgba(0,0,0,0.1);
	transform: translateY(-2px);
}
.mdifunding-funder-card h3 {
	margin: 0 0 8px 0;
	font-size: 16px;
	color: #2c3e50;
}
.mdifunding-funder-card .amount {
	font-size: 14px;
	color: #27ae60;
	font-weight: 600;
	margin-bottom: 12px;
}
.mdifunding-funder-card .stats {
	display: flex;
	justify-content: space-between;
	font-size: 13px;
	color: #7f8c8d;
	margin-bottom: 12px;
}

/* === Alert Block === */
.mdifunding-alert {
	background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
	border: 1px solid #fc8181;
	border-left: 4px solid #e53e3e;
	border-radius: 8px;
	padding: 16px 20px;
	margin-bottom: 20px;
}
.mdifunding-alert h4 {
	color: #c53030;
	margin: 0 0 8px;
	font-size: 15px;
}
.mdifunding-alert ul {
	margin: 0;
	padding-left: 20px;
	color: #742a2a;
}

/* === Info Block === */
.mdifunding-info {
	background: linear-gradient(135deg, #ebf8ff 0%, #bee3f8 100%);
	border: 1px solid #63b3ed;
	border-left: 4px solid #3182ce;
	border-radius: 8px;
	padding: 16px 20px;
	margin-bottom: 20px;
}
.mdifunding-info h4 { color: #2b6cb0; margin: 0 0 8px; }

/* === Document Table === */
.mdifunding-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 20px;
	font-size: 13px;
}
.mdifunding-table thead th {
	background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
	color: #fff;
	padding: 10px 12px;
	text-align: left;
	font-weight: 600;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.3px;
	white-space: nowrap;
}
.mdifunding-table thead th:first-child { border-radius: 8px 0 0 0; }
.mdifunding-table thead th:last-child { border-radius: 0 8px 0 0; }
.mdifunding-table tbody tr { border-bottom: 1px solid #ecf0f1; }
.mdifunding-table tbody tr:nth-child(even) { background: #f8f9fa; }
.mdifunding-table tbody tr:hover { background: #eef2ff; }
.mdifunding-table tbody td { padding: 8px 12px; vertical-align: middle; }
.mdifunding-table tbody td.nowrap { white-space: nowrap; }

/* Priority row highlights */
.mdifunding-table tr.priority-critique { border-left: 3px solid #e74c3c; }
.mdifunding-table tr.priority-haute { border-left: 3px solid #e67e22; }

/* === Section Headers === */
.mdifunding-section {
	margin-bottom: 24px;
}
.mdifunding-section h2 {
	font-size: 18px;
	color: #2c3e50;
	border-bottom: 2px solid #667eea;
	padding-bottom: 8px;
	margin-bottom: 16px;
}

/* === Sync Page === */
.mdifunding-sync-config {
	background: #f8f9fa;
	border: 1px solid #e1e8ed;
	border-radius: 8px;
	padding: 16px;
	margin-bottom: 20px;
	font-family: monospace;
	font-size: 13px;
}
.mdifunding-scan-btn {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: #fff;
	border: none;
	padding: 12px 28px;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: opacity 0.2s;
}
.mdifunding-scan-btn:hover { opacity: 0.9; }
.mdifunding-scan-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* === Filters Bar === */
.mdifunding-filters {
	background: #f8f9fa;
	border: 1px solid #e1e8ed;
	border-radius: 8px;
	padding: 12px 16px;
	margin-bottom: 16px;
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
}
.mdifunding-filters select {
	padding: 6px 12px;
	border: 1px solid #ced4da;
	border-radius: 6px;
	font-size: 13px;
	background: #fff;
}
.mdifunding-filters label {
	font-size: 12px;
	font-weight: 600;
	color: #495057;
	text-transform: uppercase;
}

/* === Quick Actions === */
.mdifunding-quick-action {
	position: relative;
	display: inline-block;
}
.mdifunding-quick-action select {
	padding: 3px 6px;
	border: 1px solid #ced4da;
	border-radius: 4px;
	font-size: 11px;
	background: #fff;
	cursor: pointer;
}

/* === Responsive === */
@media (max-width: 768px) {
	.mdifunding-kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
	.mdifunding-funder-grid { grid-template-columns: 1fr; }
	.mdifunding-filters { flex-direction: column; }
	.mdifunding-table { font-size: 11px; }
	.mdifunding-table thead th, .mdifunding-table tbody td { padding: 6px 8px; }
}

/* === Category Colors === */
.cat-A { border-left-color: #e74c3c; }
.cat-B { border-left-color: #e67e22; }
.cat-C { border-left-color: #f1c40f; }
.cat-D { border-left-color: #2ecc71; }
.cat-E { border-left-color: #3498db; }
.cat-F { border-left-color: #9b59b6; }
.cat-G { border-left-color: #1abc9c; }
.cat-H { border-left-color: #34495e; }
.cat-I { border-left-color: #e91e63; }
.cat-J { border-left-color: #795548; }

/* === V2 Premium Enhancements === */

/* Funder amount display */
.mdifunding-funder-card .amount {
	font-size: 18px;
	color: #27ae60;
	font-weight: 700;
	margin-bottom: 6px;
	letter-spacing: -0.3px;
}

/* Sprint table highlight */
.mdifunding-table tbody tr[style*="opacity"] td { text-decoration: line-through; text-decoration-color: #bbb; }

/* Shortcut buttons */
.mdifunding-section a[style*="border-radius:6px"],
.mdifunding-section a[style*="border-radius:4px"] {
	transition: opacity 0.15s, transform 0.15s;
}
.mdifunding-section a[style*="border-radius:6px"]:hover,
.mdifunding-section a[style*="border-radius:4px"]:hover {
	opacity: 0.85;
	transform: translateY(-1px);
}

/* Funder card header with badge alignment */
.mdifunding-funder-card h3 {
	margin: 0 0 4px 0;
	font-size: 16px;
	font-weight: 700;
	color: #1a202c;
	line-height: 1.3;
}

/* Strategic note italic */
.mdifunding-funder-card [style*="font-style:italic"] {
	line-height: 1.4;
}

/* Sprint badge special */
.mdifunding-badge[style*="background-color:#e74c3c"] {
	animation: none; /* Keep it clean, no pulse */
}

/* Better section title for V2 */
.mdifunding-section h2 {
	font-size: 17px;
	font-weight: 700;
	color: #1a202c;
	border-bottom: 2px solid #667eea;
	padding-bottom: 8px;
	margin-bottom: 16px;
	letter-spacing: -0.2px;
}

/* KPI card grid — V2 compact */
.mdifunding-kpi-card {
	min-height: 80px;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

/* Table row hover enhancement */
.mdifunding-table tbody tr:hover {
	background: #edf2f7;
}

/* Quick filter bar above filters */
div[style*="gap:6px"] a:hover {
	filter: brightness(1.1);
}

/* === Dolibarr Integration === */
.fiche .mdifunding-kpi-grid { margin-top: 10px; }
.tabBar .mdifunding-section { padding: 0 10px; }
