/* Administration des tableaux de bord OPAC */
/* La couleur d'accent est publiee par le script a partir des boutons du theme courant
   (valeur ci-dessous = repli sans script) ; les variantes en sont derivees. */
#opacdashboard {
	--opacdashboard-accent: #df115c;
	--opacdashboard-accent-soft: color-mix(in srgb, var(--opacdashboard-accent) 7%, #fff);
	--opacdashboard-accent-border: color-mix(in srgb, var(--opacdashboard-accent) 40%, #fff);
}

.opacdashboard-space-between {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.opacdashboard-radio-group {
	border: 0;
	padding: 0;
	margin: 0;
}

.opacdashboard-radio-group > .etiquette {
	display: block;
}

.opacdashboard-radio-group label {
	margin-right: 1rem;
}

.opacdashboard-status {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 10px;
	font-size: 90%;
}

.opacdashboard-status-0 {
	background: #fef3c7;
	color: #92400e;
}

.opacdashboard-status-1 {
	background: #dcfce7;
	color: #166534;
}

/* Graphiques et tableaux de valeurs des widgets */
.opacdashboard-chart {
	position: relative;
}

.opacdashboard-chart-canvas {
	position: relative;
	width: 100%;
}

/* Conteneur interne de vue-chartjs : sans hauteur, chart.js reduit le canevas sous la hauteur prevue */
.opacdashboard-chart-canvas > div {
	position: relative;
	height: 100%;
}

.opacdashboard-chart-empty {
	margin: 1rem 0;
	color: #666;
}

.opacdashboard-table-wrapper {
	overflow: auto;
	max-height: 320px;
}

.opacdashboard-table {
	width: 100%;
	font-size: 90%;
}

.opacdashboard-table th,
.opacdashboard-table td {
	padding: 4px 7px;
	white-space: nowrap;
}

/* Constructeur de widgets */
.opacdashboard-builder-tabs {
	display: flex;
	gap: 4px;
	border-bottom: 1px solid #ddd;
	margin-bottom: 1rem;
}

.opacdashboard-builder-tab {
	background: none;
	border: 0;
	border-bottom: 2px solid transparent;
	padding: 8px 14px;
	cursor: pointer;
	font: inherit;
}

.opacdashboard-builder-tab.active {
	border-bottom-color: var(--opacdashboard-accent);
	color: var(--opacdashboard-accent);
	font-weight: bold;
}

.opacdashboard-builder-tab:disabled {
	opacity: 0.4;
	cursor: default;
}

.opacdashboard-cards {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 6px 0;
}

.opacdashboard-card {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 3px;
	min-width: 160px;
	padding: 12px 14px;
	border: 2px solid #ddd;
	border-radius: 8px;
	background: #fff;
	cursor: pointer;
	font: inherit;
	text-align: left;
}

.opacdashboard-card[aria-pressed="true"] {
	border-color: var(--opacdashboard-accent);
	background: var(--opacdashboard-accent-soft);
}

.opacdashboard-card:disabled {
	opacity: 0.5;
	cursor: default;
}

.opacdashboard-formats .opacdashboard-card {
	min-width: 90px;
	align-items: center;
}

.opacdashboard-help {
	display: block;
	font-size: 90%;
	color: #666;
}

/* Detail de la procedure choisie (commentaire, parametres, colonnes, SQL), sous la liste */
.opacdashboard-proc-detail {
	margin-bottom: 14px;
	padding: 10px 14px;
	border: 2px solid var(--opacdashboard-accent-border);
	border-radius: 8px;
	background: #fff;
}

/* Lignes du detail rapprochees (les themes donnent de grandes marges aux paragraphes) */
.opacdashboard-proc-detail p {
	margin: 2px 0;
}

.opacdashboard-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
	margin: 4px 0 8px;
}

.opacdashboard-chip {
	padding: 4px 10px;
	border: 1px solid #ddd;
	border-radius: 6px;
	background: #fff;
	cursor: pointer;
	font: inherit;
}

.opacdashboard-chip[aria-pressed="true"] {
	border-color: var(--opacdashboard-accent);
	color: var(--opacdashboard-accent);
	font-weight: bold;
}

.opacdashboard-col {
	padding: 2px 7px;
	border-radius: 5px;
	font-size: 85%;
	font-weight: bold;
}

.opacdashboard-col-number {
	background: #eefbf4;
	color: #15803d;
}

.opacdashboard-col-date {
	background: #e8f0fd;
	color: #1d4ed8;
}

.opacdashboard-col-category {
	background: #fef9ee;
	color: #b45309;
}

.opacdashboard-sql {
	max-height: 200px;
	overflow: auto;
	padding: 9px;
	border-radius: 6px;
	background: #0f172a;
	color: #fca5a5;
	font-size: 85%;
}

.opacdashboard-pivot {
	padding: 10px 14px;
	border: 1px solid #ddd;
	border-radius: 8px;
	background: #fafafa;
}

.opacdashboard-pivot-line {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 4px 0;
}

.opacdashboard-config-grid {
	display: grid;
	grid-template-columns: minmax(160px, 1fr) 2fr;
	gap: 14px;
}

.opacdashboard-rmc {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.opacdashboard-rmc-button {
	cursor: pointer;
	font-size: 1.2em;
	padding: 0 4px;
	border: 0;
	background: none;
	color: inherit;
}

/* Icones seules : les themes ajoutent une ombre interieure a tous les boutons (.admin button) */
#opacdashboard .opacdashboard-rmc-button {
	box-shadow: none;
}

.opacdashboard-sort-button {
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	cursor: pointer;
}

.opacdashboard-rmc-button:focus-visible,
.opacdashboard-sort-button:focus-visible {
	outline: 2px solid var(--opacdashboard-accent);
	outline-offset: 2px;
}

/* Editeur de mise en page */
.opacdashboard-section {
	border: 1px solid #ddd;
	border-radius: 6px;
	background: #fff;
	margin-bottom: 12px;
}

.opacdashboard-section-header {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 6px 10px;
	border-bottom: 1px solid #ddd;
	background: #fafafa;
}

.opacdashboard-section-title {
	flex: 1;
	min-width: 0;
}

.opacdashboard-section-name {
	flex: 1;
	min-width: 0;
	padding: 3px 7px;
	border: 1.5px solid transparent;
	border-radius: 4px;
	background: none;
	color: #374151;
	font: inherit;
	font-weight: bold;
	text-align: left;
	cursor: text;
}

.opacdashboard-section-name .fa {
	margin-left: 6px;
	color: #9ca3af;
	font-size: 85%;
	visibility: hidden;
}

.opacdashboard-section-name:hover .fa,
.opacdashboard-section-name:focus .fa {
	visibility: visible;
}

.opacdashboard-section-name:hover {
	border-color: #d1d5db;
	background: #fff;
}

.opacdashboard-section-empty {
	padding: 16px;
	text-align: center;
}

.opacdashboard-section-tools,
.opacdashboard-row-tools,
.opacdashboard-widget-tools {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.opacdashboard-row-block {
	padding: 6px 10px;
	border-bottom: 1px solid #eee;
	background: #fafafa;
}

.opacdashboard-row-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 4px;
	margin-bottom: 4px;
}

.opacdashboard-row.drop-accepted {
	outline: 2px dashed var(--opacdashboard-accent);
	outline-offset: -2px;
	background-color: var(--opacdashboard-accent-soft);
}

.opacdashboard-row.drop-refused {
	outline: 2px dashed #ef4444;
	outline-offset: -2px;
	background-color: #fff5f5;
}

/* Fantome du widget glisse : copie figee du widget, semi-transparente, a l'endroit ou il sera depose */
.opacdashboard-drop-ghost {
	display: flex;
	grid-column: var(--opacdashboard-start, 1) / span var(--opacdashboard-cols, 4);
	box-sizing: border-box;
	overflow: hidden;
	border-radius: 6px;
	outline: 2px dashed var(--opacdashboard-accent);
	outline-offset: -2px;
	pointer-events: none;
}

.opacdashboard-drop-ghost > .opacdashboard-widget {
	flex: 1 1 auto;
	width: 100%;
	margin: 0;
	opacity: 0.55;
}

.opacdashboard-drop-message {
	position: absolute;
	top: 8px;
	right: 8px;
	padding: 4px 10px;
	border-radius: 999px;
	background: #ef4444;
	color: #fff;
	font-size: 85%;
	pointer-events: none;
}

/* Widget en cours de glisser : retire du flux, le fantome montre sa destination */
.opacdashboard-widget.dragged {
	display: none;
}

/* Pastilles : largeur en colonnes pendant le redimensionnement d'un widget, hauteur pendant celui d'une ligne */
.opacdashboard-cols-badge,
.opacdashboard-height-badge {
	position: absolute;
	top: 6px;
	right: 14px;
	z-index: 5;
	padding: 2px 8px;
	border-radius: 999px;
	background: var(--opacdashboard-accent);
	color: #fff;
	font-size: 11px;
	font-weight: bold;
	pointer-events: none;
}

.opacdashboard-row-handle {
	position: relative;
	height: 10px;
	margin: 2px 0 0;
	cursor: row-resize;
}

.opacdashboard-row-handle::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 3px;
	width: 48px;
	height: 4px;
	margin-left: -24px;
	border-radius: 2px;
	background: #d1d5db;
	transition: background 0.15s;
}

.opacdashboard-row-handle:hover::after {
	background: var(--opacdashboard-accent);
}

.opacdashboard-row-handle .opacdashboard-height-badge {
	top: -26px;
	right: 0;
}

.opacdashboard-grip {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 2px 4px;
	color: #9ca3af;
	cursor: grab;
}

/* L'icone Font Awesome garde sa hauteur de ligne propre : on la neutralise pour un centrage exact */
.opacdashboard-grip .fa {
	line-height: 1;
}

.opacdashboard-grip:hover {
	color: var(--opacdashboard-accent);
}

.opacdashboard-grip:active {
	cursor: grabbing;
}

.opacdashboard-resizer {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	width: 8px;
	cursor: col-resize;
	border-right: 3px solid transparent;
}

.opacdashboard-resizer:hover {
	border-right-color: var(--opacdashboard-accent);
}

/* Grille de 12 colonnes : chaque element se place par sa colonne de depart (comptee de 1) et sa largeur */
.opacdashboard-row {
	--opacdashboard-widget-gap: 8px;
	position: relative;
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	align-items: stretch;
	gap: var(--opacdashboard-widget-gap);
	height: var(--opacdashboard-row-height, 200px);
	padding: 4px;
	box-sizing: border-box;
}

/* Reperes des 12 colonnes, affiches pendant un redimensionnement ou un glisser */
.opacdashboard-row.guides {
	background-image: repeating-linear-gradient(to right, transparent 0, transparent calc(100% / 12 - 1px), var(--opacdashboard-accent-border) calc(100% / 12 - 1px), var(--opacdashboard-accent-border) calc(100% / 12));
}

.opacdashboard-widget {
	position: relative;
	display: flex;
	flex-direction: column;
	/* Colonne de depart et largeur posees par le composant (variables CSS) */
	grid-column: var(--opacdashboard-start, 1) / span var(--opacdashboard-cols, 4);
	min-width: 0;
	overflow: hidden;
	border: 1px solid #ddd;
	border-radius: 6px;
	background: #fff;
}

.opacdashboard-widget-header {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 4px 8px;
	border-bottom: 1px solid #eee;
	background: #fafafa;
}

.opacdashboard-widget-name {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* En-tete compact (moins de 3 colonnes) : une seule rangee, poignee, nom tronque et le
   menu d'actions (qui contient toutes les commandes) ; les autres boutons sont masques */
.opacdashboard-widget.compact .opacdashboard-widget-tools > .opacdashboard-icon-button {
	display: none;
}

.opacdashboard-widget-body {
	flex: 1 1 auto;
	min-height: 0;
	padding: 6px 8px;
	overflow: auto;
}

.opacdashboard-icon-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border: 1px solid transparent;
	border-radius: 4px;
	background: transparent;
	color: #6b7280;
	cursor: pointer;
}

.opacdashboard-icon-button:hover:not(:disabled),
.opacdashboard-icon-button[aria-expanded="true"] {
	border-color: #d1d5db;
	background: #fff;
	color: #374151;
}

.opacdashboard-icon-button.danger:hover:not(:disabled) {
	border-color: #fca5a5;
	color: #ef4444;
}

.opacdashboard-icon-button:disabled {
	opacity: 0.35;
	cursor: default;
}

.opacdashboard-menu-wrapper {
	position: relative;
}

.opacdashboard-menu {
	/* Position fixe calculee par le composant (top/left) : jamais rognee par un widget a debordement masque */
	position: fixed;
	z-index: 1000;
	min-width: 210px;
	margin: 0;
	padding: 0;
	list-style: none;
	overflow: hidden;
	border: 1px solid #ddd;
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.13);
}

/* Selecteur renforce : le theme pure met un padding a tous les li du contenu */
#opacdashboard .opacdashboard-menu li {
	margin: 0;
	padding: 0;
	list-style: none;
}

#opacdashboard .opacdashboard-menu li.opacdashboard-menu-title {
	padding: 7px 14px 6px;
	border-bottom: 1px solid #ddd;
	font-size: 10px;
	font-weight: bold;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #9ca3af;
}

.opacdashboard-menu button {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 9px 16px;
	border: 0;
	background: none;
	color: #333;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.opacdashboard-menu button .fa {
	color: #6b7280;
}

.opacdashboard-menu button:hover:not(:disabled) {
	background: #f5f5f5;
}

.opacdashboard-menu button.danger,
.opacdashboard-menu button.danger .fa {
	color: #ef4444;
}

.opacdashboard-menu button.danger:hover:not(:disabled) {
	background: #fff5f5;
}

.opacdashboard-menu button:disabled,
.opacdashboard-menu button:disabled .fa {
	color: #ccc;
	cursor: default;
}

/* Formulaire : en-tete, panneaux, libelles de bloc */
.opacdashboard-form {
	padding: 16px 20px;
	background: #f3f4f6;
}

.opacdashboard-form-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 14px;
}

.opacdashboard-form-header h3 {
	margin: 0;
}

.opacdashboard-form-actions {
	display: flex;
	gap: 8px;
}

.opacdashboard-form-footer {
	margin-top: 16px;
}

.opacdashboard-panel {
	padding: 16px 20px;
	border: 1px solid #ddd;
	border-radius: 6px;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
	margin-bottom: 20px;
}

.opacdashboard-label {
	display: block;
	margin: 12px 0 8px;
	font-size: 11px;
	font-weight: bold;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #6b7280;
}

.opacdashboard-panel > .opacdashboard-label:first-child {
	margin-top: 0;
}

.opacdashboard-field {
	margin: 10px 0;
}

.opacdashboard-field .etiquette {
	display: block;
	margin-bottom: 5px;
}

/* Zones d'ajout en pointilles */
button.opacdashboard-add {
	color: var(--opacdashboard-accent);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	width: 100%;
	box-sizing: border-box;
	border: 1px dashed var(--opacdashboard-accent-border);
	background: var(--opacdashboard-accent-soft);
	cursor: pointer;
	font: inherit;
	font-weight: bold;
	transition: background 0.2s, border-color 0.2s;
}

button.opacdashboard-add:hover {
	background: color-mix(in srgb, var(--opacdashboard-accent) 12%, #fff);
	border-color: var(--opacdashboard-accent);
}

.opacdashboard-add small {
	font-weight: normal;
	color: #9ca3af;
}

button.opacdashboard-add-section,
button.opacdashboard-add-row {
	flex-direction: row;
	gap: 8px;
}

.opacdashboard-add-section {
	padding: 22px 0;
	border-radius: 6px;
	margin-bottom: 16px;
	font-size: 110%;
}

.opacdashboard-add-row {
	padding: 12px 0;
	border-width: 2px 0 0;
	border-radius: 0 0 6px 6px;
}

.opacdashboard-add-widget {
	min-width: 0;
	min-height: 120px;
	margin: 0;
	border-radius: 6px;
}

/* Zone d'ajout : colonne de depart (comptee de 1) et largeur en colonnes libres */
.opacdashboard-start-1 { grid-column-start: 1; }
.opacdashboard-start-2 { grid-column-start: 2; }
.opacdashboard-start-3 { grid-column-start: 3; }
.opacdashboard-start-4 { grid-column-start: 4; }
.opacdashboard-start-5 { grid-column-start: 5; }
.opacdashboard-start-6 { grid-column-start: 6; }
.opacdashboard-start-7 { grid-column-start: 7; }
.opacdashboard-start-8 { grid-column-start: 8; }
.opacdashboard-start-9 { grid-column-start: 9; }
.opacdashboard-start-10 { grid-column-start: 10; }
.opacdashboard-start-11 { grid-column-start: 11; }
.opacdashboard-start-12 { grid-column-start: 12; }
.opacdashboard-add-cols-1 { grid-column-end: span 1; }
.opacdashboard-add-cols-2 { grid-column-end: span 2; }
.opacdashboard-add-cols-3 { grid-column-end: span 3; }
.opacdashboard-add-cols-4 { grid-column-end: span 4; }
.opacdashboard-add-cols-5 { grid-column-end: span 5; }
.opacdashboard-add-cols-6 { grid-column-end: span 6; }
.opacdashboard-add-cols-7 { grid-column-end: span 7; }
.opacdashboard-add-cols-8 { grid-column-end: span 8; }
.opacdashboard-add-cols-9 { grid-column-end: span 9; }
.opacdashboard-add-cols-10 { grid-column-end: span 10; }
.opacdashboard-add-cols-11 { grid-column-end: span 11; }
.opacdashboard-add-cols-12 { grid-column-end: span 12; }

/* Zone etroite (1 ou 2 colonnes) : icone seule */
.opacdashboard-add-widget.narrow span,
.opacdashboard-add-widget.narrow small {
	display: none;
}

.opacdashboard-row-toolbar .opacdashboard-label {
	margin: 0;
}

.opacdashboard-separator {
	width: 1px;
	height: 16px;
	margin: 0 4px;
	background: #ddd;
}

/* Constructeur : cartes, badges, slots */
.opacdashboard-builder {
	padding: 16px;
	border-radius: 8px;
	background: #f3f4f6;
}

.opacdashboard-builder .opacdashboard-cards {
	margin: 6px 0 14px;
}

.opacdashboard-cards-2 {
	display: grid;
	grid-template-columns: 1fr 1fr;
}

.opacdashboard-cards-2 .opacdashboard-card {
	min-width: 0;
}

.opacdashboard-card-source {
	flex-direction: row;
	align-items: center;
	gap: 12px;
	width: 100%;
}

.opacdashboard-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 8px;
	background: #f3f4f6;
	color: #6b7280;
	font-weight: bold;
	font-size: 12px;
}

.opacdashboard-card[aria-pressed="true"] .opacdashboard-badge {
	background: var(--opacdashboard-accent);
	color: #fff;
}

.opacdashboard-link,
.opacdashboard-slot-label {
	color: var(--opacdashboard-accent);
}

.opacdashboard-link {
	padding: 4px 0;
	border: 0;
	background: none;
	font: inherit;
	font-size: 90%;
	font-weight: bold;
	cursor: pointer;
}

/* Import : titre de la liste et lien vers la page des modeles sur une ligne */
.opacdashboard-model-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

/* Bouton d'etape du constructeur : pleine largeur, espace au-dessus (selecteur assez precis pour
   passer devant les regles input.bouton des themes) */
/* Configuration des widgets : champs au style PMB, etires sur toute la largeur disponible
   (mise en page seulement) ; les lignes du tableau croise gardent leurs champs cote a cote */
.opacdashboard-builder select,
.opacdashboard-builder input[type="text"],
.opacdashboard-builder input[type="number"],
.opacdashboard-builder input[type="date"] {
	width: 100%;
	box-sizing: border-box;
	/* Marge laterale des themes : ferait deborder un champ a 100 % */
	margin-left: 0;
	margin-right: 0;
}

/* Informations generales du tableau : nom et type d'affectation sur toute la largeur */
#opacdashboard-name,
#opacdashboard-assignment-type {
	width: 100%;
	box-sizing: border-box;
	margin-left: 0;
	margin-right: 0;
}

.opacdashboard-builder .opacdashboard-pivot select,
.opacdashboard-builder .opacdashboard-pivot input[type="text"],
.opacdashboard-builder .opacdashboard-pivot input[type="number"],
.opacdashboard-builder .opacdashboard-pivot input[type="date"] {
	width: auto;
}

.opacdashboard-builder input.bouton.opacdashboard-wide {
	width: 100%;
	margin: 16px 0 4px;
}

.opacdashboard-slots {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.opacdashboard-slot {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 12px;
	border: 1.5px solid #e5e7eb;
	border-radius: 8px;
	background: #fafafa;
}

.opacdashboard-slot.filled {
	border-color: var(--opacdashboard-accent-border);
	background: var(--opacdashboard-accent-soft);
}

.opacdashboard-slot > div {
	flex: 1;
	min-width: 0;
}

.opacdashboard-slot-label {
	display: block;
	margin-bottom: 3px;
	font-size: 11px;
	font-weight: bold;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.opacdashboard-options {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 16px;
}

/* Une case et son libelle ne se compriment pas : la rangee passe a la ligne (formats d'export) */
.opacdashboard-options > label {
	flex: 0 0 auto;
}

.opacdashboard-color {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 4px 0;
}

.opacdashboard-color input[type="color"] {
	width: 32px;
	height: 32px;
	padding: 2px;
	border: 2px solid #ddd;
	border-radius: 5px;
}

.opacdashboard-preview {
	padding: 12px;
	border: 1px solid #ddd;
	border-radius: 9px;
	background: #fff;
}

/* Apercu du widget liste : pleine largeur sous les parametres, actualise a la demande */
.opacdashboard-list-preview-block {
	margin: 14px 0;
}

/* Constructeur de liste : sections et grille a deux colonnes, champs pleine largeur */
.opacdashboard-list-group {
	margin: 0 0 20px;
	padding: 0;
	border: 0;
	min-width: 0;
}

.opacdashboard-list-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px 20px;
}

.opacdashboard-list-grid .opacdashboard-field {
	margin: 0;
}

.opacdashboard-list-grid .etiquette {
	display: block;
	margin-bottom: 4px;
}

.opacdashboard-list-grid-full {
	grid-column: 1 / -1;
}

.opacdashboard-list-source-box {
	margin-top: 8px;
}

.opacdashboard-list-preview-bar .opacdashboard-label {
	flex: 1;
	margin: 0;
}

@media (max-width: 600px) {
	.opacdashboard-list-grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

.opacdashboard-list-preview-bar {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 6px;
}

.opacdashboard-list-preview-stale {
	font-style: italic;
}

.opacdashboard-list-preview-body {
	max-height: 360px;
	overflow: auto;
}

.opacdashboard-pivot-block {
	margin-bottom: 10px;
}

/* Les boutons internes du module ne prennent pas l'habillage generique des boutons du theme */
#opacdashboard .opacdashboard-section-name,
#opacdashboard .opacdashboard-icon-button,
#opacdashboard .opacdashboard-card,
#opacdashboard .opacdashboard-chip,
#opacdashboard .opacdashboard-builder-tab,
#opacdashboard .opacdashboard-menu button,
#opacdashboard .opacdashboard-link,
#opacdashboard button.opacdashboard-add {
	margin: 0;
	box-shadow: none;
}

/* Colonnes triables de la liste (ex-style inline deplace ici) */
#opacdashboard th.opacdashboard-sortable {
	cursor: pointer;
}

/* Affectation d'un tableau de bord dans les informations generales */
#opacdashboard .opacdashboard-assignment-body {
	margin-top: 10px;
}
#opacdashboard .opacdashboard-assignment-test {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 8px;
}
#opacdashboard .opacdashboard-assignment-count {
	font-weight: bold;
	color: var(--opacdashboard-accent);
}
#opacdashboard .opacdashboard-assignment-info {
	margin: 6px 0 0;
	color: #6b7280;
	font-style: italic;
}

/* Liste : total et pagination (composant commun paginator), page active a la couleur du module */
#opacdashboard .opacdashboard-list-results {
	margin: 0.5em 0;
}

#opacdashboard .pagination {
	display: flex;
	justify-content: center;
	align-items: center;
}

#opacdashboard .pagination button.bouton-page.active {
	background-color: var(--opacdashboard-accent);
}

/* Ligne de la liste : toute la ligne ouvre l'edition */
#opacdashboard-list tbody tr.opacdashboard-row-link {
	cursor: pointer;
}

#opacdashboard-list tbody tr.opacdashboard-row-link:hover {
	background-color: var(--opacdashboard-accent-soft);
}

/* Colonne des actions alignee a droite (la classe generique .right est flottante dans certains themes) */
#opacdashboard-list .opacdashboard-table-right {
	text-align: right;
}

/* Nom et affectation : une valeur sans espace (equation de recherche) se coupe au lieu d'elargir
   le tableau et de pousser les actions hors de l'ecran ; les actions restent sur une ligne */
#opacdashboard-list table {
	width: 100%;
	table-layout: fixed;
}

/* Case "tout cocher" et icone de liste cote a cote */
#opacdashboard-list th:first-child {
	width: 70px;
	white-space: nowrap;
}

#opacdashboard-list th:nth-child(4) {
	width: 110px;
}

#opacdashboard-list th:last-child {
	width: 340px;
}

#opacdashboard-list td {
	overflow-wrap: anywhere;
}

/* Fenetre "Voir les lecteurs" de l'affectation */
#opacdashboard .opacdashboard-emprs-search {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

#opacdashboard .opacdashboard-emprs-search .etiquette {
	flex-basis: 100%;
}

/* Effectif et date du dernier calcul sous le libelle de l'affectation, sur une ligne courte */
#opacdashboard-list .opacdashboard-list-assignment-meta {
	display: block;
	margin-top: 2px;
	font-size: 0.85em;
	color: #6b7280;
	white-space: nowrap;
	overflow-wrap: normal;
}

#opacdashboard-list td.opacdashboard-table-right {
	white-space: nowrap;
}

/* Source procedure : parametres de la procedure choisie */
.opacdashboard-proc-params {
	margin-bottom: 10px;
	padding: 8px 10px;
	border: 1px solid var(--opacdashboard-accent-border);
	border-radius: 6px;
	background: var(--opacdashboard-accent-soft);
}

.opacdashboard-proc-param {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 10px;
	margin-top: 6px;
}

.opacdashboard-proc-param label {
	min-width: 140px;
}

.opacdashboard-proc-param select[multiple] {
	min-height: 90px;
}

/* Recherche dans les procedures */
.opacdashboard-proc-search {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 8px;
}

/* Liste deroulante des procedures, groupees par classement */
.opacdashboard-proc-choice {
	margin-bottom: 8px;
}

.opacdashboard-proc-choice select {
	width: 100%;
}

/* Modale ouverte (classe posee sur <html> par le composant Modal) : le contenu passe au-dessus
   des bandeaux collants des themes (#extra / #navbar en z-index 1000), sinon la modale, qui vit
   dans #contenu (z-index 80 dans le theme pure), reste en partie cachee sous eux */
html.modal-open #conteneur > #contenu {
	z-index: 1100;
}

/* Dialogues Dojo ouverts depuis une modale (recherche multicriteres d'un widget liste ou d'une
   affectation) : Dojo leur donne un z-index de 950 en style en ligne (le theme pure le fige meme en
   !important), sous la modale (1000) et sous #contenu remonte ci-dessus ; leurs menus et bulles
   doivent passer encore au-dessus. Selecteurs plus precis que celui du theme. */
html.modal-open body > div.dijitDialogUnderlayWrapper {
	z-index: 1200 !important;
}

html.modal-open body > div.dijitDialog {
	z-index: 1210 !important;
}

html.modal-open body > div.dijitPopup,
html.modal-open body > div.dijitTooltip {
	z-index: 1220 !important;
}

/* Configuration sans colonne des couleurs (format tableau) : l'apercu prend toute la largeur */
.opacdashboard-config-grid > :only-child {
	grid-column: 1 / -1;
}

/* Liste des modeles de widgets : memes regles que la liste des tableaux (valeurs longues coupees,
   actions sur une ligne, ligne cliquable) */
#opacdashboard-models table {
	width: 100%;
	table-layout: fixed;
}

#opacdashboard-models th:first-child {
	width: 70px;
	white-space: nowrap;
}

/* Colonnes en proportions : le nom ne prend pas toute la largeur sur un grand ecran */
#opacdashboard-models th:nth-child(2) {
	width: 25%;
}

#opacdashboard-models th:nth-child(3),
#opacdashboard-models th:nth-child(4) {
	width: 19%;
}

#opacdashboard-models th:last-child {
	width: 340px;
	min-width: 340px;
}

#opacdashboard-models td {
	overflow-wrap: anywhere;
}

#opacdashboard-models .opacdashboard-table-right {
	text-align: right;
}

#opacdashboard-models td.opacdashboard-table-right {
	white-space: nowrap;
}

#opacdashboard-models tbody tr.opacdashboard-row-link {
	cursor: pointer;
}

#opacdashboard-models tbody tr.opacdashboard-row-link:hover {
	background-color: var(--opacdashboard-accent-soft);
}

/* Widget lie a un modele : pastille a cote du nom */
.opacdashboard-model-badge {
	flex: none;
	color: var(--opacdashboard-accent);
}

/* Import d'un modele : lier ou copier */
.opacdashboard-import-mode {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 10px 0;
	padding: 0;
	border: 0;
}

/* Radio aligne sur le titre du choix (le libelle tient sur deux lignes : titre puis aide) */
.opacdashboard-import-choice {
	display: flex;
	align-items: flex-start;
	gap: 6px;
}

.opacdashboard-import-choice input[type="radio"] {
	margin-top: 0.6em;
}

.opacdashboard-import-choice label strong {
	margin-right: 6px;
}

/* Widget statistique : menu d'export en haut a droite du widget, plein ecran en bas a droite */
#opacdashboard .opacdashboard-stat-menu {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 2;
}

#opacdashboard .opacdashboard-stat-footer {
	display: flex;
	justify-content: flex-end;
	height: 32px;
	align-items: flex-end;
}

/* Modale plein ecran (deplacee dans #opacdashboard a l'ouverture) */
#opacdashboard .opacdashboard-stat-modal {
	position: fixed;
	inset: 0;
	z-index: 1300;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(17, 24, 39, 0.45);
}

#opacdashboard .opacdashboard-stat-modal-box {
	box-sizing: border-box;
	width: min(1000px, 100%);
	max-height: calc(100vh - 32px);
	overflow: auto;
	padding: 20px 28px 24px;
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

#opacdashboard .opacdashboard-stat-modal-header {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 12px;
}

#opacdashboard .opacdashboard-stat-modal-title {
	flex: 1;
	margin: 0;
	font-size: 1.1rem;
	font-weight: normal;
}

/* Apercu du constructeur : reference des boutons d'export et de plein ecran */
.opacdashboard-preview {
	position: relative;
}

/* Aide sous le titre "Mise en page" : collee au titre, icone d'information devant le texte */
.opacdashboard-layout-notice {
	display: flex;
	align-items: baseline;
	gap: 6px;
	margin: -4px 0 12px;
}

/* Paginateur de PMB dans l'apercu d'un widget liste */
.opacdashboard-preview-pagination {
	margin: 8px 0 0;
}
