/* Copyright (C) 2026 WebMay - Sylvain Ghysens */

.eisenhower-badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 12px;
	font-size: 0.85em;
	color: #fff;
	margin-right: 6px;
}

#eisenhower-summary {
	display: flex !important;
	flex-wrap: wrap !important;
	column-gap: 8px !important;
	row-gap: 7px !important;
	align-items: center;
}

#eisenhower-summary .eisenhower-badge {
	margin: 0 !important;
}

.eisenhower-q1.eisenhower-badge, .eisenhower-quadrant.eisenhower-q1 .eisenhower-quadrant-header { background-color: #c9302c; }
.eisenhower-q2.eisenhower-badge, .eisenhower-quadrant.eisenhower-q2 .eisenhower-quadrant-header { background-color: #337ab7; }
.eisenhower-q3.eisenhower-badge, .eisenhower-quadrant.eisenhower-q3 .eisenhower-quadrant-header { background-color: #ec971f; }
.eisenhower-q4.eisenhower-badge, .eisenhower-quadrant.eisenhower-q4 .eisenhower-quadrant-header { background-color: #777; }

.eisenhower-matrix {
	display: grid !important;
	grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
	gap: 12px !important;
	width: 100% !important;
	margin-top: 10px;
	box-sizing: border-box;
}

/* Neutralise les largeurs et flottants imposés par certains thèmes Dolibarr. */
.eisenhower-matrix > .eisenhower-quadrant {
	float: none !important;
	width: auto !important;
	max-width: none !important;
	min-width: 0 !important;
	box-sizing: border-box;
}

/* Tablette étroite : 2 colonnes. Le seuil volontairement bas évite qu'un
 * écran Full HD avec zoom Windows/Dolibarr soit considéré comme une tablette. */
@media screen and (max-width: 800px) {
	.eisenhower-matrix {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}
}

/* Mobile : 1 colonne. */
@media screen and (max-width: 600px) {
	.eisenhower-matrix {
		grid-template-columns: minmax(0, 1fr) !important;
	}
}

.eisenhower-quadrant {
	border: 1px solid #ddd;
	border-radius: 6px;
	overflow: hidden;
	background: #fff;
	display: flex;
	flex-direction: column;
	min-height: 220px;
}

.eisenhower-quadrant-header {
	color: #fff;
	padding: 8px 12px;
	font-weight: 600;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.eisenhower-quadrant-count {
	background: rgba(255, 255, 255, 0.25);
	border-radius: 10px;
	padding: 1px 8px;
	font-size: 0.85em;
}

.eisenhower-quadrant-body {
	padding: 10px;
	flex: 1;
	min-height: 160px;
}

.eisenhower-quadrant-body.eisenhower-dragover {
	background-color: #f0f7ff;
	outline: 2px dashed #337ab7;
	outline-offset: -4px;
}

.eisenhower-task-card {
	background: #f9f9f9;
	border: 1px solid #e5e5e5;
	border-radius: 4px;
	padding: 8px 10px;
	margin-bottom: 8px;
	cursor: grab;
}

.eisenhower-task-card:active {
	cursor: grabbing;
}

.eisenhower-task-card.eisenhower-dragging {
	opacity: 0.4;
}

.eisenhower-task-title {
	font-weight: 600;
}

.eisenhower-task-project, .eisenhower-task-due {
	font-size: 0.85em;
}

.eisenhower-task-actions {
	margin-top: 4px;
	text-align: right;
}

.eisenhower-empty {
	font-style: italic;
	text-align: center;
	padding: 20px 0;
}

.eisenhower-kpis{display:grid;grid-template-columns:repeat(4,minmax(150px,1fr));gap:14px;margin:16px 0}.eisenhower-kpi{padding:16px;border-radius:8px;background:var(--colorbacklineimpair,#fff);box-shadow:0 1px 4px #0002}.eisenhower-kpi strong,.eisenhower-kpi span{display:block}.eisenhower-kpi span{font-size:2em;font-weight:700}.eisenhower-bar{height:8px;background:#ddd;border-radius:6px;overflow:hidden}.eisenhower-bar i{display:block;height:100%;background:currentColor}.eisenhower-load{padding:3px 8px;border-radius:10px}.eisenhower-load.ok{background:#d8f3dc}.eisenhower-load.warning{background:#fff3bf}.eisenhower-load.critical{background:#ffc9c9}@media(max-width:800px){.eisenhower-kpis{grid-template-columns:1fr 1fr}}

/* Task list columns added by Eisenhower 2.0.11 */
.eisenhower-col-urgent,
.eisenhower-col-important { width: 82px; min-width: 82px; }
.eisenhower-check { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 4px; font-weight: 700; }
.eisenhower-check-yes { background: #d9f2e3; color: #16834b; }
.eisenhower-check-no { background: #f0f0f0; color: #8a8a8a; }


/* Colored urgency/importance badges on matrix task cards (2.0.21) */
.eisenhower-task-criteria {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 7px;
}

.eisenhower-criterion-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 10px;
	color: #fff;
	font-size: 0.78em;
	font-weight: 600;
	line-height: 1.4;
}

.eisenhower-criterion-urgent { background-color: #ec971f; }
.eisenhower-criterion-important { background-color: #337ab7; }


/* Matrix compact single-row layout (2.0.27) */
.eisenhower-task-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	font-size: 0.85em;
}
.eisenhower-task-project { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eisenhower-task-responsible { margin-left: auto; text-align: right; white-space: nowrap; font-weight: 600; }
.eisenhower-task-actions:empty { display: none; }

/* Improve vertical spacing when summary badges wrap on narrow screens (2.0.29) */
#eisenhower-summary {
	display: flex;
	flex-wrap: wrap;
	column-gap: 6px;
	row-gap: 8px;
	align-items: center;
}
#eisenhower-summary .eisenhower-badge { margin-right: 0; }

/* SortableJS drag & drop (2.1.0) */
.eisenhower-task-card { position: relative; transition: box-shadow .18s ease, transform .18s ease, opacity .18s ease; }
.eisenhower-task-card:hover { box-shadow: 0 3px 10px rgba(0,0,0,.12); }
.eisenhower-drag-handle {
	position: absolute;
	top: 5px;
	right: 7px;
	padding: 1px 4px;
	font-weight: 700;
	letter-spacing: -2px;
	color: #777;
	cursor: grab;
	user-select: none;
	touch-action: none;
}
.eisenhower-drag-handle:active { cursor: grabbing; }
.eisenhower-task-title { padding-right: 25px; }
.eisenhower-sortable-ghost { opacity: .25 !important; border: 2px dashed #337ab7 !important; background: #eef6ff !important; }
.eisenhower-sortable-chosen { box-shadow: 0 8px 20px rgba(0,0,0,.22) !important; transform: rotate(.4deg); }
.eisenhower-sortable-drag { opacity: .95 !important; }
.eisenhower-is-dragging .eisenhower-quadrant-body { min-height: 185px; transition: background-color .15s ease, outline-color .15s ease; }
.eisenhower-is-dragging .eisenhower-quadrant-body:hover { background: #f0f7ff; outline: 2px dashed #337ab7; outline-offset: -4px; }
.eisenhower-saving { opacity: .6; pointer-events: none; }
.eisenhower-toast {
	position: fixed;
	right: 22px;
	bottom: 22px;
	z-index: 10050;
	max-width: 360px;
	padding: 11px 16px;
	border-radius: 6px;
	color: #fff;
	font-weight: 600;
	box-shadow: 0 5px 18px rgba(0,0,0,.22);
	opacity: 0;
	transform: translateY(12px);
	pointer-events: none;
	transition: opacity .18s ease, transform .18s ease;
}
.eisenhower-toast.is-visible { opacity: 1; transform: translateY(0); }
.eisenhower-toast-success { background: #2f855a; }
.eisenhower-toast-error { background: #c53030; }
@media (max-width: 600px) {
	.eisenhower-toast { left: 12px; right: 12px; bottom: 12px; max-width: none; }
	.eisenhower-drag-handle { padding: 5px 7px; top: 2px; right: 3px; }
}

/* Matrix productivity tools (2.2.0) */
#eisenhower-search, #eisenhower-user-filter { vertical-align: middle; min-height: 30px; }
.eisenhower-task-overdue { border-left: 4px solid #c9302c; background: #fff6f6; }
.eisenhower-task-today { border-left: 4px solid #ec971f; background: #fffaf1; }
.eisenhower-task-week { border-left: 4px solid #337ab7; }
.eisenhower-task-overdue .eisenhower-task-due { color: #b52b27; font-weight: 700; }
.eisenhower-task-today .eisenhower-task-due { color: #b66d0d; font-weight: 700; }
@media (max-width: 800px) {
  #eisenhower-search, #eisenhower-user-filter { display: block; width: 100%; margin-top: 8px; box-sizing: border-box; }
}


/* 2.2.1: inline drag handle + title, no stacked heading. */
.eisenhower-task-heading { display:flex; align-items:center; gap:7px; min-width:0; }
.eisenhower-task-heading .eisenhower-task-title { padding-right:0; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.eisenhower-task-heading .eisenhower-drag-handle { position:static; display:inline-flex; flex:0 0 auto; top:auto; right:auto; }
