/* ==========================================================================
   Deyxia — système de design (commun au site, à l'espace client et à la console)
   ========================================================================== */

@font-face {
	font-family: "Inter";
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2-variations"),
		url("../fonts/inter-latin-wght-normal.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
	/* Couleurs */
	--bg: #ffffff;
	--bg-alt: #f8fafc;
	--bg-subtle: #f1f5f9;
	--text: #0f172a;
	--text-2: #334155;
	--muted: #64748b;
	--border: #e2e8f0;
	--border-strong: #cbd5e1;
	--accent: #4f46e5;
	--accent-hover: #4338ca;
	--accent-strong: #3730a3;
	--accent-soft: #eef2ff;
	--accent-softer: #f5f7ff;
	--accent-ring: rgba(79, 70, 229, 0.28);
	--success: #047857;
	--success-soft: #ecfdf5;
	--warning: #b45309;
	--warning-soft: #fffbeb;
	--danger: #b91c1c;
	--danger-soft: #fef2f2;
	--ink: #0b1120;

	/* Formes */
	--radius-sm: 6px;
	--radius: 10px;
	--radius-lg: 14px;
	--radius-xl: 20px;
	--shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
	--shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
	--shadow: 0 6px 16px -4px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
	--shadow-lg: 0 28px 56px -16px rgba(15, 23, 42, 0.16), 0 10px 20px -10px rgba(15, 23, 42, 0.08);

	/* Mise en page */
	--container: 1240px;
	--gutter: 20px;
	--header-h: 64px;
	--section-y: 72px;

	/* Typographie */
	--font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	--fs-h1: clamp(2.5rem, 1.6rem + 3.6vw, 4.25rem);
	--fs-h2: clamp(2rem, 1.45rem + 2.2vw, 3rem);
	--fs-h3: clamp(1.5rem, 1.3rem + 0.8vw, 1.875rem);
	--fs-h4: clamp(1.25rem, 1.2rem + 0.2vw, 1.375rem);
	--fs-lead: clamp(1.125rem, 1.05rem + 0.3vw, 1.25rem);
	--fs-body: 1rem;
	--fs-small: 0.875rem;
	--fs-xs: 0.8125rem;

	/* Mouvement */
	--ease: cubic-bezier(0.2, 0.7, 0.2, 1);
	--dur: 200ms;

	/* Surfaces et contrastes (redéfinis en mode sombre) */
	color-scheme: light;
	--surface: #ffffff;
	--on-accent: #ffffff;
	--accent-solid: #4f46e5;
	--accent-solid-hover: #4338ca;
	--inverse-hover: #1e293b;
	--header-bg: rgba(255, 255, 255, 0.86);
	--accent-border: #c7d2fe;
	--success-border: #a7f3d0;
	--warning-border: #fde68a;
	--danger-border: #fecaca;
	--skeleton-hi: #e9eef5;
	--grid-line: rgba(15, 23, 42, 0.045);
	--ring-soft: rgba(241, 245, 249, 0.7);
	--drop-bg: rgba(245, 247, 255, 0.96);
}

/* --------------------------------------------------------------------------
   Mode sombre : réglage de l'appareil, ou choix mémorisé (bouton soleil / lune,
   <html data-theme="dark|light">). Les deux blocs doivent rester identiques.
   -------------------------------------------------------------------------- */

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		color-scheme: dark;
		--bg: #0b1020;
		--bg-alt: #0f152a;
		--bg-subtle: #161d36;
		--surface: #121935;
		--text: #e8ebf7;
		--text-2: #c3c9de;
		--muted: #97a0bd;
		--border: #232b4d;
		--border-strong: #333d66;
		--accent: #9ba3ff;
		--accent-hover: #b8beff;
		--accent-strong: #c7cbff;
		--accent-soft: rgba(99, 102, 241, 0.18);
		--accent-softer: rgba(99, 102, 241, 0.09);
		--accent-ring: rgba(129, 140, 248, 0.4);
		--accent-solid: #5b54f0;
		--accent-solid-hover: #6c66ff;
		--success: #34d399;
		--success-soft: rgba(16, 185, 129, 0.14);
		--warning: #fbbf24;
		--warning-soft: rgba(245, 158, 11, 0.14);
		--danger: #f87171;
		--danger-soft: rgba(239, 68, 68, 0.14);
		--ink: #060912;
		--inverse-hover: #cbd5e1;
		--header-bg: rgba(11, 16, 32, 0.84);
		--accent-border: rgba(129, 140, 248, 0.4);
		--success-border: rgba(52, 211, 153, 0.35);
		--warning-border: rgba(251, 191, 36, 0.35);
		--danger-border: rgba(248, 113, 113, 0.4);
		--skeleton-hi: #1f2747;
		--grid-line: rgba(148, 163, 184, 0.07);
		--ring-soft: rgba(255, 255, 255, 0.04);
		--drop-bg: rgba(18, 25, 53, 0.96);
		--shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
		--shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.45), 0 1px 2px rgba(0, 0, 0, 0.3);
		--shadow: 0 6px 16px -4px rgba(0, 0, 0, 0.5), 0 2px 4px -2px rgba(0, 0, 0, 0.35);
		--shadow-lg: 0 28px 56px -16px rgba(0, 0, 0, 0.6), 0 10px 20px -10px rgba(0, 0, 0, 0.4);
	}
}

:root[data-theme="dark"] {
	color-scheme: dark;
	--bg: #0b1020;
	--bg-alt: #0f152a;
	--bg-subtle: #161d36;
	--surface: #121935;
	--text: #e8ebf7;
	--text-2: #c3c9de;
	--muted: #97a0bd;
	--border: #232b4d;
	--border-strong: #333d66;
	--accent: #9ba3ff;
	--accent-hover: #b8beff;
	--accent-strong: #c7cbff;
	--accent-soft: rgba(99, 102, 241, 0.18);
	--accent-softer: rgba(99, 102, 241, 0.09);
	--accent-ring: rgba(129, 140, 248, 0.4);
	--accent-solid: #5b54f0;
	--accent-solid-hover: #6c66ff;
	--success: #34d399;
	--success-soft: rgba(16, 185, 129, 0.14);
	--warning: #fbbf24;
	--warning-soft: rgba(245, 158, 11, 0.14);
	--danger: #f87171;
	--danger-soft: rgba(239, 68, 68, 0.14);
	--ink: #060912;
	--inverse-hover: #cbd5e1;
	--header-bg: rgba(11, 16, 32, 0.84);
	--accent-border: rgba(129, 140, 248, 0.4);
	--success-border: rgba(52, 211, 153, 0.35);
	--warning-border: rgba(251, 191, 36, 0.35);
	--danger-border: rgba(248, 113, 113, 0.4);
	--skeleton-hi: #1f2747;
	--grid-line: rgba(148, 163, 184, 0.07);
	--ring-soft: rgba(255, 255, 255, 0.04);
	--drop-bg: rgba(18, 25, 53, 0.96);
	--shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
	--shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.45), 0 1px 2px rgba(0, 0, 0, 0.3);
	--shadow: 0 6px 16px -4px rgba(0, 0, 0, 0.5), 0 2px 4px -2px rgba(0, 0, 0, 0.35);
	--shadow-lg: 0 28px 56px -16px rgba(0, 0, 0, 0.6), 0 10px 20px -10px rgba(0, 0, 0, 0.4);
}

/* Transition douce au changement de mode (bouton). */
html.theme-switching,
html.theme-switching *,
html.theme-switching *::before,
html.theme-switching *::after {
	transition: background-color 200ms var(--ease), border-color 200ms var(--ease), color 200ms var(--ease), fill 200ms var(--ease) !important;
}

@media (min-width: 768px) {
	:root {
		--gutter: 32px;
		--section-y: 104px;
		--fs-body: 1.0625rem;
	}
}

/* --------------------------------------------------------------------------
   Remise à zéro
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: var(--fs-body);
	line-height: 1.6;
	font-feature-settings: "cv11", "ss01";
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

img,
svg,
video {
	max-width: 100%;
	height: auto;
}

svg {
	flex-shrink: 0;
}

p {
	text-wrap: pretty;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
ul,
ol,
figure,
blockquote,
dl,
dd {
	margin: 0;
}

:where(ul[class], ol[class], nav ul, nav ol) {
	list-style: none;
	padding: 0;
	margin: 0;
}

a {
	color: var(--accent);
	text-decoration: none;
	text-underline-offset: 3px;
}

a:hover {
	color: var(--accent-hover);
}

button,
input,
select,
textarea {
	font: inherit;
	color: inherit;
}

button {
	cursor: pointer;
}

table {
	border-collapse: collapse;
	width: 100%;
}

hr {
	border: 0;
	border-top: 1px solid var(--border);
	margin: 32px 0;
}

::selection {
	background: var(--accent-soft);
	color: var(--accent-strong);
}

:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
	border-radius: 4px;
}

[hidden] {
	display: none !important;
}

/* --------------------------------------------------------------------------
   Typographie
   -------------------------------------------------------------------------- */

h1,
.h1 {
	font-size: var(--fs-h1);
	line-height: 1.05;
	font-weight: 650;
	letter-spacing: -0.035em;
}

h2,
.h2 {
	font-size: var(--fs-h2);
	line-height: 1.1;
	font-weight: 600;
	letter-spacing: -0.028em;
}

h3,
.h3 {
	font-size: var(--fs-h3);
	line-height: 1.2;
	font-weight: 600;
	letter-spacing: -0.02em;
}

h4,
.h4 {
	font-size: var(--fs-h4);
	line-height: 1.3;
	font-weight: 600;
	letter-spacing: -0.012em;
}

h5,
.h5 {
	font-size: 1.0625rem;
	line-height: 1.4;
	font-weight: 600;
}

.lead {
	text-wrap: pretty;
	font-size: var(--fs-lead);
	line-height: 1.6;
	color: var(--muted);
}

.muted {
	color: var(--muted);
}

.small {
	font-size: var(--fs-small);
	line-height: 1.5;
}

.xs {
	font-size: var(--fs-xs);
	line-height: 1.5;
}

.eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: var(--fs-xs);
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--accent);
}

.text-balance {
	text-wrap: balance;
}

.tabular {
	font-variant-numeric: tabular-nums;
}

.sr-only,
.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: absolute;
	left: 16px;
	top: -100px;
	z-index: 1000;
	padding: 10px 16px;
	background: var(--text);
	color: var(--bg);
	border-radius: var(--radius);
	font-weight: 600;
}

.skip-link:focus {
	top: 12px;
	color: var(--on-accent);
}

/* --------------------------------------------------------------------------
   Mise en page
   -------------------------------------------------------------------------- */

.container {
	width: 100%;
	max-width: calc(var(--container) + 2 * var(--gutter));
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.container--narrow {
	max-width: calc(760px + 2 * var(--gutter));
}

.container--medium {
	max-width: calc(1040px + 2 * var(--gutter));
}

.stack > * + * {
	margin-top: var(--stack, 16px);
}

.cluster {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--gap, 12px);
}

.grid {
	display: grid;
	gap: var(--gap, 20px);
}

@media (min-width: 640px) {
	.grid-2 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 768px) {
	.grid-3 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	.grid-4 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 1024px) {
	.grid-3 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
	.grid-4 {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

/* --------------------------------------------------------------------------
   Boutons
   -------------------------------------------------------------------------- */

.btn {
	--btn-h: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: var(--btn-h);
	padding: 0 18px;
	border: 1px solid transparent;
	border-radius: var(--radius);
	background: transparent;
	color: var(--text);
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: -0.005em;
	white-space: nowrap;
	text-decoration: none;
	transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform 150ms var(--ease);
	-webkit-tap-highlight-color: transparent;
}

.btn:active {
	transform: translateY(1px);
}

.btn .icon {
	width: 18px;
	height: 18px;
}

.btn--primary {
	background: var(--accent-solid);
	color: var(--on-accent);
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.btn--primary:hover {
	background: var(--accent-solid-hover);
	color: var(--on-accent);
}

.btn--secondary {
	background: var(--surface);
	border-color: var(--border);
	color: var(--text);
	box-shadow: var(--shadow-xs);
}

.btn--secondary:hover {
	border-color: var(--border-strong);
	background: var(--bg-alt);
	color: var(--text);
}

.btn--dark {
	background: var(--text);
	color: var(--bg);
}

.btn--dark:hover {
	background: var(--inverse-hover);
	color: var(--on-accent);
}

.btn--ghost {
	color: var(--text-2);
}

.btn--ghost:hover {
	background: var(--bg-subtle);
	color: var(--text);
}

.btn--danger {
	background: var(--surface);
	border-color: var(--danger-border);
	color: var(--danger);
}

.btn--danger:hover {
	background: var(--danger-soft);
	color: var(--danger);
}

.btn--sm {
	--btn-h: 36px;
	padding: 0 12px;
	font-size: 0.875rem;
	border-radius: 8px;
}

.btn--xs {
	--btn-h: 30px;
	padding: 0 10px;
	font-size: 0.8125rem;
	border-radius: 7px;
}

.btn--lg {
	--btn-h: 50px;
	padding: 0 22px;
	font-size: 1rem;
}

.btn--block {
	width: 100%;
}

.btn--icon {
	padding: 0;
	width: var(--btn-h);
}

.btn[disabled],
.btn[aria-disabled="true"] {
	opacity: 0.55;
	cursor: not-allowed;
	pointer-events: none;
}

.btn.is-loading {
	position: relative;
	color: transparent !important;
	pointer-events: none;
}

.btn.is-loading::after {
	content: "";
	position: absolute;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	border: 2px solid currentColor;
	border-color: rgba(255, 255, 255, 0.45);
	border-top-color: var(--on-accent);
	animation: dx-spin 0.7s linear infinite;
}

.btn--secondary.is-loading::after,
.btn--ghost.is-loading::after {
	border-color: var(--border);
	border-top-color: var(--accent);
}

.link-arrow {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-weight: 600;
	font-size: 0.9375rem;
}

.link-arrow .icon {
	width: 16px;
	height: 16px;
	transition: transform var(--dur) var(--ease);
}

.link-arrow:hover .icon {
	transform: translateX(3px);
}

/* --------------------------------------------------------------------------
   Badges, statuts, puces
   -------------------------------------------------------------------------- */

.badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 24px;
	padding: 0 9px;
	border-radius: 999px;
	background: var(--bg-subtle);
	color: var(--text-2);
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
}

.badge .icon {
	width: 13px;
	height: 13px;
}

.badge--accent {
	background: var(--accent-soft);
	color: var(--accent-hover);
}

.badge--success {
	background: var(--success-soft);
	color: var(--success);
}

.badge--warning {
	background: var(--warning-soft);
	color: var(--warning);
}

.badge--danger {
	background: var(--danger-soft);
	color: var(--danger);
}

.badge--outline {
	background: var(--surface);
	border: 1px solid var(--border);
}

.badge--demo {
	background: var(--surface);
	border: 1px dashed var(--border-strong);
	color: var(--muted);
}

.dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: currentColor;
	flex-shrink: 0;
}

.status {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-size: 0.8125rem;
	font-weight: 600;
}

.status--active {
	color: var(--success);
}

.status--paused {
	color: var(--warning);
}

.status--error {
	color: var(--danger);
}

.status--neutral {
	color: var(--muted);
}

.status--active .dot {
	box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.15);
}

.chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 36px;
	padding: 0 14px;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: var(--surface);
	color: var(--text-2);
	font-size: 0.875rem;
	font-weight: 500;
	transition: all var(--dur) var(--ease);
}

.chip:hover {
	border-color: var(--border-strong);
	color: var(--text);
}

.chip[aria-pressed="true"],
.chip.is-active,
.chip[aria-current="page"] {
	background: var(--text);
	border-color: var(--text);
	color: var(--bg);
}

/* --------------------------------------------------------------------------
   Cartes
   -------------------------------------------------------------------------- */

.card {
	position: relative;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	padding: 24px;
	box-shadow: var(--shadow-xs);
}

.card--flat {
	box-shadow: none;
}

.card--muted {
	background: var(--bg-alt);
}

.card--hover {
	transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.card--hover:hover {
	border-color: var(--border-strong);
	box-shadow: var(--shadow);
	transform: translateY(-2px);
}

.card__link::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
}

.icon-tile {
	display: inline-grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border-radius: 10px;
	background: var(--accent-soft);
	color: var(--accent);
	flex-shrink: 0;
}

.icon-tile .icon {
	width: 20px;
	height: 20px;
}

.icon-tile--neutral {
	background: var(--bg-subtle);
	color: var(--text-2);
}

.icon-tile--outline {
	background: var(--surface);
	border: 1px solid var(--border);
	color: var(--text);
	box-shadow: var(--shadow-xs);
}

.check-list {
	display: grid;
	gap: 10px;
}

.check-list li {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	color: var(--text-2);
}

.check-list .icon {
	width: 18px;
	height: 18px;
	margin-top: 3px;
	color: var(--accent);
}

.check-list .is-off {
	color: var(--muted);
}

.check-list .is-off .icon {
	color: var(--border-strong);
}

/* --------------------------------------------------------------------------
   Formulaires
   -------------------------------------------------------------------------- */

.form-grid {
	display: grid;
	gap: 18px;
}

@media (min-width: 640px) {
	.form-grid--2 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	.form-grid .span-2 {
		grid-column: 1 / -1;
	}
}

.field {
	display: grid;
	gap: 6px;
	align-content: start;
}

.field__label {
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--text);
}

.field__label .optional {
	font-weight: 400;
	color: var(--muted);
}

.field__hint {
	font-size: var(--fs-xs);
	color: var(--muted);
}

.field__error {
	display: none;
	align-items: center;
	gap: 6px;
	font-size: var(--fs-xs);
	font-weight: 500;
	color: var(--danger);
}

.field.has-error .field__error {
	display: flex;
}

.field__error .icon {
	width: 14px;
	height: 14px;
}

.input,
.select,
.textarea {
	width: 100%;
	min-height: 44px;
	padding: 10px 12px;
	border: 1px solid var(--border-strong);
	border-radius: var(--radius);
	background: var(--surface);
	color: var(--text);
	font-size: 1rem;
	line-height: 1.4;
	box-shadow: var(--shadow-xs);
	transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.input::placeholder,
.textarea::placeholder {
	color: #94a3b8;
}

.input:hover,
.select:hover,
.textarea:hover {
	border-color: #94a3b8;
}

.input:focus,
.select:focus,
.textarea:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px var(--accent-ring);
}

.field.has-error .input,
.field.has-error .select,
.field.has-error .textarea {
	border-color: var(--danger);
}

.field.has-error .input:focus,
.field.has-error .select:focus,
.field.has-error .textarea:focus {
	box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.2);
}

.textarea {
	min-height: 120px;
	resize: vertical;
}

.select {
	appearance: none;
	padding-right: 36px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
}

.input-group {
	position: relative;
	display: flex;
	align-items: center;
}

.input-group > .icon {
	position: absolute;
	left: 12px;
	width: 18px;
	height: 18px;
	color: var(--muted);
	pointer-events: none;
}

.input-group > .input {
	padding-left: 40px;
}

.input-group__action {
	position: absolute;
	right: 4px;
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--muted);
}

.input-group__action:hover {
	background: var(--bg-subtle);
	color: var(--text);
}

.checkbox {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 0.9375rem;
	color: var(--text-2);
	cursor: pointer;
}

.checkbox input {
	width: 18px;
	height: 18px;
	margin: 2px 0 0;
	accent-color: var(--accent);
	flex-shrink: 0;
}

.choice-grid {
	display: grid;
	gap: 10px;
}

@media (min-width: 560px) {
	.choice-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.choice {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
	cursor: pointer;
	transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.choice:hover {
	border-color: var(--border-strong);
}

.choice input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.choice__box {
	display: grid;
	place-items: center;
	width: 18px;
	height: 18px;
	border: 1.5px solid var(--border-strong);
	border-radius: 5px;
	background: var(--surface);
	flex-shrink: 0;
	transition: all var(--dur) var(--ease);
}

.choice input[type="radio"] + .choice__box {
	border-radius: 50%;
}

.choice__box .icon {
	width: 12px;
	height: 12px;
	color: var(--on-accent);
	opacity: 0;
	stroke-width: 3;
}

.choice__text {
	display: grid;
	gap: 2px;
	font-size: 0.9375rem;
	font-weight: 500;
	line-height: 1.3;
}

.choice__text small {
	font-size: var(--fs-xs);
	font-weight: 400;
	color: var(--muted);
}

.choice:has(input:checked) {
	border-color: var(--accent);
	background: var(--accent-softer);
	box-shadow: 0 0 0 1px var(--accent);
}

.choice input:checked + .choice__box {
	border-color: var(--accent);
	background: var(--accent-solid);
}

.choice input:checked + .choice__box .icon {
	opacity: 1;
}

.choice input:focus-visible + .choice__box {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

.hp-field {
	position: absolute !important;
	left: -10000px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* --------------------------------------------------------------------------
   Alertes, états vides, chargement
   -------------------------------------------------------------------------- */

.alert {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	padding: 14px 16px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--bg-alt);
	color: var(--text-2);
	font-size: 0.9375rem;
	line-height: 1.5;
}

.alert .icon {
	width: 20px;
	height: 20px;
	margin-top: 1px;
}

.alert strong {
	color: var(--text);
}

.alert--info {
	border-color: var(--accent-border);
	background: var(--accent-softer);
}

.alert--info .icon {
	color: var(--accent);
}

.alert--success {
	border-color: var(--success-border);
	background: var(--success-soft);
}

.alert--success .icon {
	color: var(--success);
}

.alert--warning {
	border-color: var(--warning-border);
	background: var(--warning-soft);
}

.alert--warning .icon {
	color: var(--warning);
}

.alert--error {
	border-color: var(--danger-border);
	background: var(--danger-soft);
}

.alert--error .icon {
	color: var(--danger);
}

.empty-state {
	display: grid;
	justify-items: center;
	gap: 10px;
	padding: 40px 24px;
	text-align: center;
	border: 1px dashed var(--border-strong);
	border-radius: var(--radius-lg);
	background: var(--bg-alt);
}

.empty-state .icon-tile {
	margin-bottom: 4px;
}

.empty-state p {
	max-width: 420px;
	color: var(--muted);
	font-size: 0.9375rem;
}

.spinner {
	display: inline-block;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	border: 2px solid var(--border);
	border-top-color: var(--accent);
	animation: dx-spin 0.7s linear infinite;
	flex-shrink: 0;
}

.skeleton {
	border-radius: 6px;
	background: linear-gradient(90deg, var(--bg-subtle) 25%, var(--skeleton-hi) 37%, var(--bg-subtle) 63%);
	background-size: 400% 100%;
	animation: dx-shimmer 1.4s ease infinite;
}

@keyframes dx-spin {
	to {
		transform: rotate(360deg);
	}
}

@keyframes dx-shimmer {
	0% {
		background-position: 100% 50%;
	}
	100% {
		background-position: 0 50%;
	}
}

/* --------------------------------------------------------------------------
   Tableaux
   -------------------------------------------------------------------------- */

.table-wrap {
	width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	background: var(--surface);
}

.table {
	min-width: 560px;
	font-size: 0.9375rem;
}

.table th,
.table td {
	padding: 12px 16px;
	text-align: left;
	border-bottom: 1px solid var(--border);
	vertical-align: middle;
}

.table thead th {
	background: var(--bg-alt);
	color: var(--muted);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	white-space: nowrap;
}

.table tbody tr:last-child td,
.table tbody tr:last-child th {
	border-bottom: 0;
}

.table tbody tr:hover {
	background: var(--accent-softer);
}

.table .num {
	text-align: right;
	font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   Onglets
   -------------------------------------------------------------------------- */

.tabs {
	display: flex;
	gap: 4px;
	padding: 4px;
	border-radius: 12px;
	background: var(--bg-subtle);
	overflow-x: auto;
	scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
	display: none;
}

.tab {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 36px;
	padding: 0 14px;
	border: 0;
	border-radius: 9px;
	background: transparent;
	color: var(--muted);
	font-size: 0.875rem;
	font-weight: 600;
	white-space: nowrap;
	transition: all var(--dur) var(--ease);
}

.tab:hover {
	color: var(--text);
}

.tab[aria-selected="true"] {
	background: var(--surface);
	color: var(--text);
	box-shadow: var(--shadow-sm);
}

.tab .icon {
	width: 16px;
	height: 16px;
}

/* --------------------------------------------------------------------------
   Fenêtres modales (<dialog>)
   -------------------------------------------------------------------------- */

.modal {
	width: min(760px, calc(100% - 32px));
	max-height: calc(100dvh - 48px);
	padding: 0;
	border: 1px solid var(--border);
	border-radius: var(--radius-xl);
	background: var(--surface);
	color: var(--text);
	box-shadow: var(--shadow-lg);
	overflow: hidden;
}

.modal[open] {
	display: flex;
	flex-direction: column;
	animation: dx-modal-in 220ms var(--ease);
}

.modal::backdrop {
	background: rgba(15, 23, 42, 0.42);
	backdrop-filter: blur(2px);
}

.modal__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	padding: 20px 24px;
	border-bottom: 1px solid var(--border);
}

.modal__body {
	padding: 24px;
	overflow-y: auto;
}

.modal__foot {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 10px;
	padding: 16px 24px;
	border-top: 1px solid var(--border);
	background: var(--bg-alt);
}

@keyframes dx-modal-in {
	from {
		opacity: 0;
		transform: translateY(8px) scale(0.985);
	}
}

/* --------------------------------------------------------------------------
   Rapport (fenêtres « Voir le rapport » et résultats d'agents)
   -------------------------------------------------------------------------- */

.report {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 20px;
}

.report__metrics {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 12px;
}

.report__metric {
	padding: 14px 16px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--bg-alt);
}

.report__metric strong {
	display: block;
	font-size: 1.5rem;
	line-height: 1.2;
	letter-spacing: -0.02em;
	font-variant-numeric: tabular-nums;
}

.report__metric span {
	font-size: var(--fs-xs);
	color: var(--muted);
}

.report h3 {
	font-size: 1rem;
	letter-spacing: 0;
	margin-bottom: 8px;
}

.report ol,
.report ul:not([class]) {
	margin: 0;
	padding-left: 20px;
	display: grid;
	gap: 6px;
	color: var(--text-2);
}

.report .table {
	min-width: 520px;
	font-size: 0.875rem;
}

/* --------------------------------------------------------------------------
   Apparition au défilement (seulement avec JavaScript, sans réduction des animations)
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
	.js .reveal {
		opacity: 0;
		transform: translateY(14px);
		transition: opacity 600ms var(--ease), transform 600ms var(--ease);
		transition-delay: var(--delay, 0ms);
	}
	.js .reveal.is-visible {
		opacity: 1;
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* --------------------------------------------------------------------------
   Marque
   -------------------------------------------------------------------------- */

.brand {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: var(--text);
}

.brand__mark {
	display: block;
	width: 30px;
	height: 30px;
	flex-shrink: 0;
}

.brand__word {
	display: block;
	width: auto;
	height: 15px;
}

/* --------------------------------------------------------------------------
   Préférences : langue (FR | EN) et mode clair / sombre
   -------------------------------------------------------------------------- */

.lang-switch {
	display: inline-flex;
	align-items: center;
	padding: 2px;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: var(--surface);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	line-height: 1;
}

.lang-switch__item {
	display: inline-grid;
	place-items: center;
	min-width: 32px;
	height: 28px;
	padding: 0 8px;
	border-radius: 999px;
	color: var(--muted);
	text-decoration: none;
}

a.lang-switch__item:hover {
	color: var(--text);
	background: var(--bg-subtle);
}

.lang-switch__item.is-current {
	background: var(--text);
	color: var(--bg);
}

.theme-toggle {
	display: inline-grid;
	place-items: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: var(--surface);
	color: var(--text);
	cursor: pointer;
	transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.theme-toggle:hover {
	border-color: var(--border-strong);
	background: var(--bg-subtle);
}

.theme-toggle svg {
	grid-area: 1 / 1;
	transition: transform 300ms var(--ease), opacity 200ms var(--ease);
}

/* Soleil en mode sombre (pour revenir au clair), lune en mode clair. */
.theme-toggle__sun {
	opacity: 0;
	transform: rotate(-90deg) scale(0.6);
}

:root[data-theme="dark"] .theme-toggle__sun {
	opacity: 1;
	transform: none;
}

:root[data-theme="dark"] .theme-toggle__moon {
	opacity: 0;
	transform: rotate(90deg) scale(0.6);
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .theme-toggle__sun {
		opacity: 1;
		transform: none;
	}

	:root:not([data-theme="light"]) .theme-toggle__moon {
		opacity: 0;
		transform: rotate(90deg) scale(0.6);
	}
}

.brand__img {
	display: block;
	max-height: 32px;
	width: auto;
}

/* --------------------------------------------------------------------------
   Avatars et tuiles d'intégration (communs)
   -------------------------------------------------------------------------- */

.avatar {
	display: inline-grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: var(--accent-soft);
	color: var(--accent-hover);
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	flex-shrink: 0;
}

.avatar--sm {
	width: 28px;
	height: 28px;
	font-size: 0.6875rem;
}

.avatar--sq {
	border-radius: 8px;
}

.int-logo {
	display: inline-grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border: 1px solid var(--border);
	border-radius: 10px;
	background: var(--surface);
	color: var(--text);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: -0.01em;
	box-shadow: var(--shadow-xs);
	flex-shrink: 0;
}

.int-logo--long {
	font-size: 0.625rem;
	letter-spacing: -0.02em;
}

.int-logo--sm {
	width: 26px;
	height: 26px;
	border-radius: 7px;
	font-size: 0.625rem;
}

.int-cloud {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
}

@media (min-width: 560px) {
	.int-cloud {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.int-tile {
	display: grid;
	gap: 10px;
	align-content: start;
	padding: 12px;
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	background: var(--surface);
	transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.int-tile:hover {
	border-color: var(--border-strong);
	box-shadow: var(--shadow-sm);
}

.int-tile__head {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
}

.int-tile__name {
	display: grid;
	min-width: 0;
	flex: 1;
}

.int-tile__name strong {
	font-size: 0.9375rem;
	line-height: 1.3;
}

.int-tile__name span {
	color: var(--muted);
	font-size: 0.75rem;
}

.int-tile--detail {
	padding: 20px;
	gap: 14px;
}

.int-tile--detail p {
	color: var(--muted);
	font-size: 0.9375rem;
}

.int-tile__foot {
	margin-top: auto;
	padding-top: 12px;
	border-top: 1px solid var(--border);
}

/* Typographie 2.1 : les titres ne débordent plus de l'écran. */
h1,
h2,
h3 {
	overflow-wrap: break-word;
	text-wrap: balance;
}
