/* ============================================================
   utilities.css — generic Tailwind-style utility class library,
   no external dependency, reusable across pages. Nothing app-
   specific lives here (see app.css for that).
   ============================================================ */

*, *::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-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\.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-full { height: 100%; }
.max-w-4xl { max-width: 56rem; }
.max-w-\[90vw\] { max-width: 90vw; }

/* ---- Spacing ---- */
.p-1\.5 { padding: 0.375rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.px-0 { padding-left: 0; padding-right: 0; }
.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-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.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; }
.pl-4 { padding-inline-start: 1rem; }
.pt-2 { padding-top: 0.5rem; }
.pt-3 { padding-top: 0.75rem; }
.m-0 { margin: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.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; }
.mx-auto { margin-left: auto; margin-right: auto; }
.gap-1 { gap: 0.25rem; }
.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; }

/* ---- Typography ---- */
.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; }
.text-left { text-align: start; }
.text-center { text-align: center; }
.leading-tight { line-height: 1.25; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whitespace-nowrap { white-space: nowrap; }

/* ---- Text colors ---- */
.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-red-600 { color: #dc2626; }

/* ---- Background colors ---- */
.bg-white { background-color: #ffffff; }
.bg-gray-50 { background-color: #f9fafb; }
.bg-blue-50 { background-color: #eff6ff; }
.bg-emerald-50 { background-color: #ecfdf5; }
.bg-slate-50 { background-color: #f8fafc; }
.bg-indigo-500 { background-color: #6366f1; }
.bg-blue-500 { background-color: #3b82f6; }
.bg-emerald-500 { background-color: #10b981; }
.bg-slate-500 { background-color: #64748b; }
.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); }

/* ---- Borders ---- */
.border { border: 1px solid #e5e7eb; }
.border-2 { border-width: 2px; border-style: solid; border-color: #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; }

/* ---- Shadows ---- */
.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); }

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

/* ---- Transitions ---- */
.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; }
.transition-all { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.duration-200 { transition-duration: 200ms; }
.duration-300 { transition-duration: 300ms; }

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

/* ---- RTL directional icons ---- */
[dir="rtl"] .chevron, [dir="rtl"] .chevron-dir { transform: scaleX(-1); }
[dir="rtl"] .chevron.rotate-90 { transform: rotate(90deg); }

/* ---- 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-700:hover { color: #374151; }
.hover\:text-gray-800:hover { color: #1f2937; }
.hover\:text-red-600:hover { color: #dc2626; }
.hover\:text-white:hover { color: #ffffff; }

/* ---- Dynamic (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-slate-500 { --ring-color: #64748b; }

/* ---- 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; }
}
