/* ============================================================================
   Eusebe 2 — surcouche visuelle par-dessus Color Admin (thème Material).
   Objectif : un écran agréable pour des personnes connectées toute la journée —
   fond doux, cartes en relief léger, hiérarchie typographique nette, transitions discrètes.
   ============================================================================ */

:root {
	--e2-fond: #f3f5f8;
	--e2-carte: #ffffff;
	--e2-texte: #1f2933;
	--e2-texte-doux: #6b7785;
	--e2-bord: rgba(15, 23, 42, .06);
	--e2-ombre: 0 1px 2px rgba(15, 23, 42, .04), 0 6px 20px rgba(15, 23, 42, .06);
	--e2-ombre-forte: 0 2px 4px rgba(15, 23, 42, .06), 0 14px 34px rgba(15, 23, 42, .12);
	--e2-rayon: 10px;
	--e2-accent: var(--bs-app-theme, #455a64);
	--e2-hausse: #0f9d76;
	--e2-baisse: #e5484d;
}

/* ---------- Fond et typographie ---------- */
body { background: var(--e2-fond); color: var(--e2-texte); -webkit-font-smoothing: antialiased; }
.app-content { background: var(--e2-fond); }
.page-header { font-weight: 300; letter-spacing: -.02em; color: var(--e2-texte); }
.page-header small { color: var(--e2-texte-doux); font-weight: 400; letter-spacing: 0; }
h4, .h4 { font-weight: 500; letter-spacing: -.01em; }

/* ---------- Cartes : relief léger, coins doux ---------- */
.app-content .card {
	border: 1px solid var(--e2-bord) !important;
	border-radius: var(--e2-rayon);
	box-shadow: var(--e2-ombre);
	background: var(--e2-carte);
	overflow: hidden;
	transition: box-shadow .2s ease, transform .2s ease;
}
.app-content .card > .card-header {
	background: transparent;
	border-bottom: 1px solid var(--e2-bord);
	padding: 14px 18px;
	font-size: 14px;
}
.app-content .card > .card-body { padding: 18px; }
.app-content .card .list-group-item { border-color: var(--e2-bord); }
a.card:hover, .app-content .card.tuile:hover { box-shadow: var(--e2-ombre-forte); transform: translateY(-2px); }

/* ---------- Indicateurs de l'accueil ---------- */
.indicateur { position: relative; }
.indicateur::before {
	content: ''; position: absolute; inset: 0 0 auto 0; height: 3px;
	background: linear-gradient(90deg, var(--e2-accent), rgba(var(--bs-app-theme-rgb, 69, 90, 100), .25));
}
.indicateur .indicateur-valeur { font-size: 34px; font-weight: 600; letter-spacing: -.03em; }
.indicateur .indicateur-detail { margin-top: 2px; }
.indicateur .indicateur-tendance.hausse { background: rgba(15, 157, 118, .12); color: var(--e2-hausse); }
.indicateur .indicateur-tendance.baisse { background: rgba(229, 72, 77, .12); color: var(--e2-baisse); }
.tuile-icone {
	background: linear-gradient(135deg, rgba(var(--bs-app-theme-rgb, 69, 90, 100), .16), rgba(var(--bs-app-theme-rgb, 69, 90, 100), .06));
	box-shadow: inset 0 0 0 1px rgba(var(--bs-app-theme-rgb, 69, 90, 100), .08);
}

/* ---------- En-tête et menu ---------- */
.app-header { box-shadow: 0 1px 0 rgba(255, 255, 255, .04), 0 6px 18px rgba(15, 23, 42, .18); }
.app-sidebar .menu .menu-header { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; opacity: .55; }
.app-sidebar .menu .menu-item > .menu-link { border-radius: 8px; margin: 1px 10px; transition: background .15s ease; }
.app-sidebar .menu .menu-item.active > .menu-link { background: rgba(255, 255, 255, .08); }
.app-sidebar .menu .menu-submenu .menu-item.active > .menu-link .menu-text { font-weight: 600; }

/* ---------- Tableaux ---------- */
.app-content .table { margin-bottom: 0; }
.app-content .table > thead th {
	font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--e2-texte-doux);
	border-bottom: 1px solid var(--e2-bord); background: rgba(15, 23, 42, .02); white-space: nowrap;
}
.app-content .table td, .app-content .table th { border-color: var(--e2-bord); padding: 10px 12px; vertical-align: middle; }
.app-content .table-hover > tbody > tr:hover > * { background: rgba(var(--bs-app-theme-rgb, 69, 90, 100), .04); }
.chiffre { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.ecart-hausse { color: var(--e2-hausse); font-weight: 600; }
.ecart-baisse { color: var(--e2-baisse); font-weight: 600; }

/* ---------- Petits détails ---------- */
.btn { border-radius: 8px; }
.form-control, .form-select { border-radius: 8px; }
.badge { font-weight: 600; letter-spacing: .02em; }
::selection { background: rgba(var(--bs-app-theme-rgb, 69, 90, 100), .2); }
* { scrollbar-width: thin; scrollbar-color: rgba(15, 23, 42, .25) transparent; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- Pilotage du mois ---------- */
.kpi-jauge { height: 6px; border-radius: 3px; background: rgba(15, 23, 42, .07); overflow: hidden; margin-top: 10px; }
.kpi-jauge > span { display: block; height: 100%; border-radius: 3px; background: var(--e2-accent); transition: width .6s ease; }
.kpi-jauge.atteint > span { background: var(--e2-hausse); }
td .kpi-jauge { margin-top: 0; }
.sparkline { display: block; overflow: visible; }
.sparkline path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.sparkline .sparkline-n { stroke: var(--e2-accent); stroke-width: 2; }
.sparkline .sparkline-n1 { stroke: #b0bec5; stroke-width: 1.2; stroke-dasharray: 3 3; }
.tableau-pilotage .ligne-segment > td {
	font-size: 10px; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; color: var(--e2-texte-doux);
	background: rgba(15, 23, 42, .025); padding-top: 6px; padding-bottom: 6px;
}
.tableau-pilotage tfoot td { font-weight: 700; background: rgba(15, 23, 42, .035); border-top: 2px solid rgba(15, 23, 42, .12); }
body.pilotage-calcul .app-content .card { opacity: .55; transition: opacity .2s ease; }
.indicateur-tendance { font-size: 11px; padding: 4px 7px; border-radius: 6px; }
.indicateur-tendance.hausse { background: rgba(15, 157, 118, .12); color: var(--e2-hausse); }
.indicateur-tendance.baisse { background: rgba(229, 72, 77, .12); color: var(--e2-baisse); }

/* ---------- Assistant (modale de chat) ---------- */
.assistant { border: 0; border-radius: 14px; overflow: hidden; box-shadow: 0 24px 60px rgba(15, 23, 42, .28); }
.assistant .modal-header { border-bottom: 1px solid var(--e2-bord); padding: 16px 20px; }
.assistant .modal-body { background: var(--e2-fond); min-height: 360px; max-height: 62vh; padding: 20px; }
.assistant .modal-footer { border-top: 1px solid var(--e2-bord); padding: 14px 20px; background: var(--e2-carte); }
.assistant-avatar { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px;
	color: #fff; background: linear-gradient(135deg, #263238, #546e7a); box-shadow: 0 4px 12px rgba(38, 50, 56, .35); }
.assistant-accueil { padding: 24px 4px; }
.assistant-accueil .btn { border-radius: 999px; }
.assistant-message { max-width: 88%; margin-bottom: 14px; padding: 11px 15px; border-radius: 14px; font-size: 13.5px; line-height: 1.55; }
.assistant-message p { margin-bottom: .5rem; }
.assistant-message p:last-child, .assistant-message ul:last-child, .assistant-message ol:last-child { margin-bottom: 0; }
.assistant-message ul, .assistant-message ol { padding-left: 1.2rem; margin-bottom: .5rem; }
.assistant-message .table { font-size: 12.5px; margin: 6px 0; background: transparent; }
.assistant-message .table td, .assistant-message .table th { padding: 5px 8px; }
.assistant-question { margin-left: auto; background: #263238; color: #fff; border-bottom-right-radius: 4px; }
.assistant-reponse { background: var(--e2-carte); box-shadow: var(--e2-ombre); border-bottom-left-radius: 4px; }
.assistant-etat { color: var(--e2-texte-doux); font-size: 12px; display: flex; align-items: center; gap: 8px; }
.assistant-etat + div:empty { display: none; }
.assistant-points { display: inline-flex; gap: 3px; }
.assistant-points i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .3; animation: assistant-point 1.2s infinite ease-in-out; }
.assistant-points i:nth-child(2) { animation-delay: .2s; }
.assistant-points i:nth-child(3) { animation-delay: .4s; }
@keyframes assistant-point { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.assistant textarea { resize: none; border-radius: 10px; min-height: 42px; }
.assistant [data-assistant="envoyer"] { height: 42px; width: 46px; justify-content: center; border-radius: 10px; font-size: 18px; }
.assistant-image { display: inline-block; margin: 6px 0; }
.assistant-image img { max-width: 220px; max-height: 320px; border-radius: 8px; box-shadow: var(--e2-ombre-forte); transition: transform .2s ease; }
.assistant-image:hover img { transform: scale(1.02); }
.assistant-lien { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; margin: 2px 0; border-radius: 999px; text-decoration: none;
	background: rgba(38, 50, 56, .07); color: var(--e2-texte); font-weight: 500; }
.assistant-lien:hover { background: rgba(38, 50, 56, .14); color: var(--e2-texte); }
.assistant-lien-hote { font-size: 11px; color: var(--e2-texte-doux); font-weight: 400; }
.assistant-reecouter { border: 0; background: none; color: var(--e2-texte-doux); font-size: 11.5px; padding: 6px 0 0; display: inline-flex; align-items: center; gap: 4px; }
.assistant-reecouter:hover { color: var(--e2-texte); }
.assistant-bouton-voix { color: var(--e2-texte-doux); font-size: 19px; border-radius: 10px; }
.assistant-bouton-voix.actif { color: #fff; background: #263238; }
.assistant-micro { height: 42px; width: 46px; border-radius: 10px; font-size: 19px; display: inline-flex; align-items: center; justify-content: center; }
.assistant-micro.ecoute { background: var(--e2-baisse); border-color: var(--e2-baisse); color: #fff; animation: assistant-micro 1.2s infinite; }
@keyframes assistant-micro { 0% { box-shadow: 0 0 0 0 rgba(229, 72, 77, .5); } 70% { box-shadow: 0 0 0 10px rgba(229, 72, 77, 0); } 100% { box-shadow: 0 0 0 0 rgba(229, 72, 77, 0); } }
