/* Tableau de bord mobi-base (modules admin et souscripteur), js/tableau-de-bord.js. 03/12/2026. */
.tdb { padding: 14px 16px 24px; box-sizing: border-box; }
/* La largeur utile est celle du tableau, pas celle de l'écran : le panneau de
   menu ouvert lui retire 295 px. D'où des requêtes de conteneur. */
.tdb { container-type: inline-size; container-name: tdb; }
/* Tuile : conteneur en largeur et en hauteur (la grille lui donne sa hauteur). */
.tdb .k-tilelayout-item-body { container-type: size; container-name: tdb-tuile; }
.tdb-entete { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.tdb-titre { margin: 0; font-size: 20px; font-weight: 600; }
.tdb-sous-titre { font-size: 13px; opacity: .7; }
.tdb-outils { display: flex; gap: 6px; align-items: center; min-width: 0; max-width: 100%; }
/* Bornée à la place disponible : Kendo range alors les boutons en trop dans son
   menu de débordement, au lieu de les couper. */
.tdb-outils > .k-toolbar { flex: 0 1 auto; min-width: 0; max-width: 100%; }
.tdb-tuiles.k-tilelayout { background: transparent; padding: 0; }
.tdb .k-tilelayout-item { border-radius: 8px; overflow: hidden; }
.tdb .k-tilelayout-item-header { padding: 6px 10px; }
.tdb-entete-tuile { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; }
.tdb-titre-tuile { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tdb-actions { display: inline-flex; gap: 2px; opacity: .65; }
.tdb-actions:hover { opacity: 1; }
.tdb .k-tilelayout-item-body { padding: 8px 10px 10px; min-height: 0; }
.tdb-corps { height: 100%; min-height: 0; }
.tdb-corps.tdb-flex { display: flex; flex-direction: column; gap: 6px; }
/* Base nulle : un graphe (400 px de haut par défaut chez Kendo) remplit la tuile
   sans l'agrandir quand les rangées suivent leur contenu (une colonne). */
.tdb-graphe, .tdb-grille { flex: 1 1 0; min-height: 0; }
.tdb-grille.k-grid { font-size: 12.5px; }
.tdb-chargement, .tdb-vide-tuile, .tdb-erreur, .tdb-vide { font-size: 13px; opacity: .7; padding: 6px 2px; }
.tdb-erreur { color: #b42318; opacity: 1; }
.tdb-note { font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tdb-chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; height: 100%; align-content: center; align-content: safe center; overflow: auto; }
.tdb-chiffre { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 6px; background: rgba(127, 127, 127, .07);
	border-left: 3px solid var(--charte-primaire, #1f78b4); text-decoration: none; color: inherit; }
a.tdb-chiffre:hover { background: rgba(127, 127, 127, .14); }
.tdb-chiffre[data-ton="alerte"] { border-left-color: #d97706; }
.tdb-chiffre[data-ton="positif"] { border-left-color: #16a34a; }
.tdb-valeur { font-size: 26px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tdb-libelle { font-size: 12px; opacity: .75; text-wrap: balance; }
.tdb-raccourcis { display: flex; flex-wrap: wrap; gap: 4px; align-content: flex-start; height: 100%; overflow: auto; }
.tdb-raccourci { justify-content: flex-start; }
.tdb-alerte { color: #b45309; font-weight: 600; }
.tdb-jauge { display: inline-block; width: 70px; height: 8px; border-radius: 4px; background: rgba(127, 127, 127, .2); vertical-align: middle; overflow: hidden; }
.tdb-jauge > span { display: block; height: 100%; background: var(--charte-primaire, #1f78b4); }
.tdb-jauge > span.tdb-plein { background: #d97706; }
/* Tableau étroit (mobile, tablette, panneau de menu ouvert) : une colonne, la
   tuile prend la hauteur de son contenu, les graphes gardent leur hauteur
   minimale. La requête d'écran sert de repli sans @container. */
@container tdb (max-width: 900px) {
	.tdb .k-tilelayout { grid-template-columns: 1fr !important; grid-auto-rows: minmax(170px, auto) !important; }
	.tdb .k-tilelayout-item { grid-column: auto / span 1 !important; }
	.tdb .k-tilelayout-item-body { overflow: visible; container-type: inline-size; }
	.tdb .tdb-chiffres { height: auto; overflow: visible; }
}
@supports not (container-type: inline-size) {
	@media (max-width: 900px) {
		.tdb .k-tilelayout { grid-template-columns: 1fr !important; grid-auto-rows: minmax(170px, auto) !important; }
		.tdb .k-tilelayout-item { grid-column: auto / span 1 !important; }
		.tdb .k-tilelayout-item-body { overflow: visible; container-type: inline-size; }
		.tdb .tdb-chiffres { height: auto; overflow: visible; }
	}
}
/* Chiffres selon la place réelle de la tuile. Avant : une quatrième valeur
   passait sur un second rang et sortait de la tuile (1024 px, ou 1366 px avec
   le panneau de menu ouvert). */
/* Tuile étroite : chiffres compacts, deux par rang. */
@container tdb-tuile (max-width: 330px) {
	.tdb-chiffres { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
	.tdb-chiffre { padding: 5px 8px; min-width: 0; }
	.tdb-valeur { font-size: 20px; }
	.tdb-libelle { font-size: 11px; line-height: 1.2; }
}
@container tdb-tuile (max-width: 190px) {
	.tdb-chiffres { grid-template-columns: minmax(0, 1fr); }
}
/* Tuile d'un seul rang de haut, large : tous les chiffres sur une ligne, à parts égales. */
@container tdb-tuile (max-height: 135px) and (min-width: 331px) {
	.tdb-chiffres { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(84px, 1fr); gap: 8px; }
	.tdb-chiffre { min-width: 0; padding: 8px 7px; }
	.tdb-libelle { font-size: 11.5px; overflow-wrap: break-word; }
}
/* Tuile d'un seul rang de haut, étroite : deux lignes serrées, libellé sur une ligne. */
@container tdb-tuile (max-height: 135px) and (max-width: 330px) {
	.tdb-chiffres { grid-template-columns: none; grid-template-rows: repeat(2, minmax(0, 1fr)); grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); align-content: stretch; }
	.tdb-chiffre { padding: 3px 8px; justify-content: center; }
	.tdb-libelle { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
/* Banque de widgets (03/12/2026). */
.tdb-bandeau .tdb-info { margin: 0 0 12px; font-size: 13px; }
.tdb-periode { font-weight: 400; opacity: .6; font-size: 12px; }
.tdb-edition .k-tilelayout-item { outline: 2px dashed rgba(127, 127, 127, .35); outline-offset: -2px; }
.tdb-edition .k-tilelayout-item-header { cursor: move; }
.tdb-edition .tdb-actions { opacity: 1; }
.tdb-kpi { display: flex; flex-direction: column; justify-content: center; height: 100%; gap: 2px; }
.tdb-kpi-valeur { font-size: 34px; font-weight: 600; line-height: 1.05; font-variant-numeric: tabular-nums; }
.tdb-kpi-unite { font-size: 12px; opacity: .7; }
.tdb-kpi-tendance { font-size: 12px; }
.tdb-kpi-tendance[data-sens="bon"] { color: #16a34a; }
.tdb-kpi-tendance[data-sens="mauvais"] { color: #b42318; }
.tdb-kpi-tendance[data-sens="egal"] { opacity: .7; }
.tdb-kpi-seuil { font-size: 11px; opacity: .6; }
.tdb-kpi-alerte .tdb-kpi-valeur { color: #d97706; }
.tdb-texte { font-size: 13px; line-height: 1.45; overflow: auto; height: 100%; white-space: normal; }
.tdb-banque .tdb-aide, .tdb-reglages .tdb-aide { font-size: 12.5px; opacity: .8; }
.tdb-reglages .tdb-aide { margin: 0 0 10px; }
.tdb-puce { margin: 1px 0; }
.tdb-modele .tdb-boutons { display: flex; gap: 8px; margin-top: 12px; }
.tdb-modele .tdb-etat-modele { margin: 8px 0 0; min-height: 1em; }

/* Visuel carte (Kendo Map) : la carte remplit la tuile, legende des groupes en bas. */
.tdb-carte {
	flex: 1 1 auto;
	min-height: 160px;
	border-radius: 4px;
}
.tdb-carte-legende {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 14px;
	padding: 4px 6px 0;
	font-size: 11px;
	color: var(--color-text-muted, #666);
}
.tdb-carte-symbole {
	font-size: 13px;
}
.tdb-carte-rond {
	opacity: .6;
}
.tdb-corps.tdb-flex {
	position: relative;
}
.tdb-carte {
	min-width: 0;
	max-width: 100%;
}
.tdb-carte-info {
	position: absolute;
	z-index: 5;
	padding: 3px 8px;
	border-radius: 4px;
	background: rgba(33, 37, 41, .9);
	color: #fff;
	font-size: 11px;
	pointer-events: none;
	white-space: nowrap;
}

/* Filtres communs, cartes de chiffres, action au clic sur une ligne (proposition bob-boutique-bo, 03/12/2026). */
.tdb-filtres { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 0 0 12px; }
.tdb-filtres .k-datepicker { width: 150px; }
.tdb-filtres .k-dropdownlist { width: 240px; max-width: 100%; }
.tdb-filtres .k-button-group { flex-wrap: wrap; }
.tdb-grille-action tbody tr { cursor: pointer; }
.tdb .tdb-droite, .tdb .k-grid td.tdb-droite, .tdb .k-grid th.tdb-droite { text-align: right; }
.tdb-chiffres.tdb-chiffres-cartes { grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 12px; align-content: stretch; }
.tdb-chiffres-cartes .tdb-chiffre { justify-content: center; gap: 3px; padding: 8px 14px; border-radius: 8px; border-left-width: 4px; }
.tdb-chiffres-cartes .tdb-libelle { order: -1; text-transform: uppercase; letter-spacing: .04em; font-size: 11px; }
.tdb-chiffres-cartes .tdb-valeur { font-size: 26px; white-space: nowrap; }
.tdb-kpi-note { font-size: 12px; opacity: .7; }
.tdb-kpi.tdb-kpi-accent { border-left: 4px solid transparent; padding-left: 12px; }
.tdb-kpi-valeur { white-space: nowrap; }
/* Petite largeur : barre d'outils bornee plus haut (.tdb-outils), le debordement Kendo prend le relais. */
.tdb-grille.k-grid td { padding-block: 5px; }
/* Petite largeur : une colonne, hauteur selon le contenu -> voir @container tdb (max-width: 900px) plus haut. */

.tdb-tuiles.k-tilelayout { padding: 0 !important; }
