/* ============================================================
   utilities.css — bibliothèque de classes utilitaires générique
   (façon Tailwind), sans dépendance externe, réutilisable sur
   n'importe quel projet. Ne contient aucun style propre à une
   application particulière (voir app.css pour ceux-ci).
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
button { font: inherit; color: inherit; background: none; border: none; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { display: block; vertical-align: middle; }

/* ---- Display ---- */
.flex { display: flex; }
.grid { display: grid; }
.hidden { display: none; }
.block { display: block; }
.inline-flex { display: inline-flex; }

/* ---- Flex / Grid ---- */
.flex-col { flex-direction: column; }
.flex-1 { flex: 1 1 0%; }
.shrink-0 { flex-shrink: 0; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

/* ---- Position ---- */
.fixed { position: fixed; }
.relative { position: relative; }
.sticky { position: sticky; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.top-0 { top: 0; }
.top-14 { top: 3.25rem; }
.left-0 { inset-inline-start: 0; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }
.z-40 { z-index: 40; }

/* ---- Sizing ---- */
.w-2 { width: 0.5rem; }
.w-3 { width: 0.75rem; }
.w-3\.5 { width: 0.875rem; }
.w-4 { width: 1rem; }
.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.w-8 { width: 2rem; }
.w-10 { width: 2.5rem; }
.w-80 { width: 20rem; }
.w-full { width: 100%; }
.h-2 { height: 0.5rem; }
.h-3 { height: 0.75rem; }
.h-3\.5 { height: 0.875rem; }
.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-8 { height: 2rem; }
.h-9 { height: 2.25rem; }
.h-10 { height: 2.5rem; }
.h-14 { height: 3.25rem; }
.h-full { height: 100%; }
.max-w-4xl { max-width: 56rem; }
.max-w-\[90vw\] { max-width: 90vw; }

/* ---- Spacing : padding / margin / gap ---- */
.p-1 { padding: 0.25rem; }
.p-1\.5 { padding: 0.375rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.px-0 { padding-left: 0; padding-right: 0; }
.px-1 { padding-left: 0.25rem; padding-right: 0.25rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-0 { padding-top: 0; padding-bottom: 0; }
.py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-0\.75 { padding-top: 0.1875rem; padding-bottom: 0.1875rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2\.5 { padding-top: 0.625rem; padding-bottom: 0.625rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.pl-4 { padding-inline-start: 1rem; }
.pt-0\.5 { padding-top: 0.125rem; }
.pb-0\.5 { padding-bottom: 0.125rem; }
.pb-1 { padding-bottom: 0.25rem; }
.pt-\[1px\] { padding-top: 1px; }
.pb-\[1px\] { padding-bottom: 1px; }
.pt-\[3px\] { padding-top: 3px; }
.pb-\[3px\] { padding-bottom: 3px; }
.pt-\[5px\] { padding-top: 5px; }
.pb-\[5px\] { padding-bottom: 5px; }
.mt-\[3px\] { margin-top: 3px; }
.mb-\[3px\] { margin-bottom: 3px; }
.pt-1 { padding-top: 0.25rem; }
.pt-2 { padding-top: 0.5rem; }
.pt-3 { padding-top: 0.75rem; }
.m-0 { margin: 0; }
.mb-0\.5 { margin-bottom: 0.125rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-0\.5 { margin-top: 0.125rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.ml-2 { margin-inline-start: 0.5rem; }
.ml-5 { margin-inline-start: 1.25rem; }
.ml-auto { margin-inline-start: auto; }
.-ml-0\.5 { margin-inline-start: -0.125rem; }
.-ml-1 { margin-inline-start: -0.25rem; }
.-mb-3 { margin-bottom: -0.75rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.gap-1 { gap: 0.25rem; }
.gap-1\.5 { gap: 0.375rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.space-y-0\.5 > * + * { margin-top: 0.125rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }

/* ---- Typographie ---- */
.text-\[10px\] { font-size: 10px; line-height: 1; }
.text-\[9px\] { font-size: 9px; line-height: 1; }
.text-\[8px\] { font-size: 8px; line-height: 1; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.text-left { text-align: start; }
.text-center { text-align: center; }
.leading-tight { line-height: 1.25; }
.tracking-tight { letter-spacing: -0.025em; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whitespace-nowrap { white-space: nowrap; }

/* ---- Couleurs de texte ---- */
.text-white { color: #ffffff; }
.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.text-gray-800 { color: #1f2937; }
.text-slate-200 { color: #e2e8f0; }
.text-slate-400 { color: #94a3b8; }
.text-indigo-500 { color: #6366f1; }
.text-blue-400 { color: #60a5fa; }
.text-amber-400 { color: #fbbf24; }
.text-yellow-400 { color: #facc15; }
.text-yellow-500 { color: #eab308; }
.text-green-500 { color: #22c55e; }
.text-pink-500 { color: #ec4899; }
.text-orange-400 { color: #fb923c; }

/* ---- Couleurs de fond ---- */
.bg-white { background-color: #ffffff; }
.bg-gray-50 { background-color: #f9fafb; }
.bg-blue-50 { background-color: #eff6ff; }
.bg-emerald-50 { background-color: #ecfdf5; }
.bg-amber-50 { background-color: #fffbeb; }
.bg-violet-50 { background-color: #f5f3ff; }
.bg-rose-50 { background-color: #fff1f2; }
.bg-cyan-50 { background-color: #ecfeff; }
.bg-indigo-500 { background-color: #6366f1; }
.bg-slate-500 { background-color: #64748b; }
.bg-blue-500 { background-color: #3b82f6; }
.bg-emerald-500 { background-color: #10b981; }
.bg-amber-500 { background-color: #f59e0b; }
.bg-violet-500 { background-color: #8b5cf6; }
.bg-rose-500 { background-color: #f43f5e; }
.bg-cyan-500 { background-color: #06b6d4; }
.bg-red-100 { background-color: #fee2e2; }
.bg-black\/40 { background-color: rgba(0, 0, 0, 0.4); }
.bg-white\/60 { background-color: rgba(255, 255, 255, 0.6); }

/* ---- Bordures ---- */
.border { border: 1px solid #e5e7eb; }
.border-2 { border-width: 2px; border-style: solid; border-color: #e5e7eb; }
.border-b { border-bottom: 1px solid #e5e7eb; }
.border-b-2 { border-bottom-width: 2px; border-bottom-style: solid; border-bottom-color: #e5e7eb; }
.border-l { border-inline-start: 1px solid #e5e7eb; }
.border-r { border-inline-end: 1px solid #e5e7eb; }
.border-transparent { border-color: transparent; }
.border-gray-200 { border-color: #e5e7eb; }
.border-black\/5 { border-color: rgba(0, 0, 0, 0.05); }
.border-white\/10 { border-color: rgba(255, 255, 255, 0.1); }
.rounded { border-radius: 0.25rem; }
.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }

/* ---- Ombres ---- */
.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1); }
.shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); }

/* ---- Opacité ---- */
.opacity-40 { opacity: 0.4; }
.opacity-50 { opacity: 0.5; }

/* ---- Transitions ---- */
.transition-all { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-colors { transition-property: color, background-color, border-color; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-transform { transition-property: transform; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.duration-150 { transition-duration: 150ms; }
.duration-200 { transition-duration: 200ms; }
.duration-300 { transition-duration: 300ms; }

/* ---- Divers ---- */
.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }
.select-none { user-select: none; }
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }
.rotate-90 { transform: rotate(90deg); }

/* ---- RTL : icônes directionnelles (chevrons) ---- */
[dir="rtl"] .chevron, [dir="rtl"] .chevron-dir, [dir="rtl"] .tree-chevron { transform: scaleX(-1); }
[dir="rtl"] .chevron.rotate-90 { transform: rotate(90deg); }

/* ---- États :hover / :focus ---- */
.focus\:outline-none:focus { outline: none; }
.hover\:bg-black\/5:hover { background-color: rgba(0, 0, 0, 0.05); }
.hover\:bg-gray-100:hover { background-color: #f3f4f6; }
.hover\:bg-red-100:hover { background-color: #fee2e2; }
.hover\:bg-white:hover { background-color: #ffffff; }
.hover\:bg-white\/10:hover { background-color: rgba(255, 255, 255, 0.1); }
.hover\:border-gray-300:hover { border-color: #d1d5db; }
.hover\:text-gray-600:hover { color: #4b5563; }
.hover\:text-gray-700:hover { color: #374151; }
.hover\:text-gray-800:hover { color: #1f2937; }
.hover\:text-red-600:hover { color: #dc2626; }
.hover\:text-white:hover { color: #ffffff; }

/* ---- Utilitaires dynamiques (JS : classList.add/remove) ---- */
.ring-2 { box-shadow: 0 0 0 2px var(--ring-color, #3b82f6); }
.ring-blue-500 { --ring-color: #3b82f6; }
.ring-emerald-500 { --ring-color: #10b981; }
.ring-amber-500 { --ring-color: #f59e0b; }
.ring-violet-500 { --ring-color: #8b5cf6; }
.ring-rose-500 { --ring-color: #f43f5e; }
.ring-cyan-500 { --ring-color: #06b6d4; }

/* ---- Responsive ---- */
@media (min-width: 640px) {
    .sm\:p-6 { padding: 1.5rem; }
}
@media (min-width: 768px) {
    .md\:block { display: block; }
    .md\:flex { display: flex; }
    .md\:hidden { display: none; }
    .md\:ml-\[260px\] { margin-inline-start: 260px; }
}
@media (min-width: 1024px) {
    .lg\:p-8 { padding: 2rem; }
}
