/* =============================================
   TAILWIND UTILITY FALLBACKS
   Pure CSS fallbacks for tw- prefixed classes.
   Works when Tailwind CDN is blocked by CSP.
   ============================================= */

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

/* ── Flex ── */
.tw-flex-col { flex-direction: column }
.tw-flex-row { flex-direction: row }
.tw-flex-wrap { flex-wrap: wrap }
.tw-flex-1 { flex: 1 1 0% }
.tw-flex-shrink-0 { flex-shrink: 0 }
.tw-items-start { align-items: flex-start }
.tw-items-center { align-items: center }
.tw-items-end { align-items: flex-end }
.tw-justify-center { justify-content: center }
.tw-justify-between { justify-content: space-between }
.tw-justify-end { justify-content: flex-end }

/* ── Grid ── */
.tw-grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)) }
.tw-grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) }
.tw-grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) }
.tw-grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)) }

/* ── Gap ── */
.tw-gap-1 { gap: 0.25rem }
.tw-gap-1\.5 { gap: 0.375rem }
.tw-gap-2 { gap: 0.5rem }
.tw-gap-2\.5 { gap: 0.625rem }
.tw-gap-3 { gap: 0.75rem }
.tw-gap-3\.5 { gap: 0.875rem }
.tw-gap-4 { gap: 1rem }
.tw-gap-5 { gap: 1.25rem }
.tw-gap-6 { gap: 1.5rem }
.tw-gap-8 { gap: 2rem }

/* ── Margin ── */
.tw-m-0 { margin: 0 }
.tw-mx-auto { margin-left: auto; margin-right: auto }
.tw-my-2 { margin-top: 0.5rem; margin-bottom: 0.5rem }
.tw-my-3 { margin-top: 0.75rem; margin-bottom: 0.75rem }
.tw-my-4 { margin-top: 1rem; margin-bottom: 1rem }
.tw-mt-0 { margin-top: 0 }
.tw-mt-0\.5 { margin-top: 0.125rem }
.tw-mt-1 { margin-top: 0.25rem }
.tw-mt-1\.5 { margin-top: 0.375rem }
.tw-mt-2 { margin-top: 0.5rem }
.tw-mt-3 { margin-top: 0.75rem }
.tw-mt-3\.5 { margin-top: 0.875rem }
.tw-mt-4 { margin-top: 1rem }
.tw-mt-5 { margin-top: 1.25rem }
.tw-mt-6 { margin-top: 1.5rem }
.tw-mt-8 { margin-top: 2rem }
.tw-mt-10 { margin-top: 2.5rem }
.tw-mb-0 { margin-bottom: 0 }
.tw-mb-0\.5 { margin-bottom: 0.125rem }
.tw-mb-1 { margin-bottom: 0.25rem }
.tw-mb-1\.5 { margin-bottom: 0.375rem }
.tw-mb-2 { margin-bottom: 0.5rem }
.tw-mb-2\.5 { margin-bottom: 0.625rem }
.tw-mb-3 { margin-bottom: 0.75rem }
.tw-mb-3\.5 { margin-bottom: 0.875rem }
.tw-mb-4 { margin-bottom: 1rem }
.tw-mb-5 { margin-bottom: 1.25rem }
.tw-mb-6 { margin-bottom: 1.5rem }
.tw-mb-7 { margin-bottom: 1.75rem }
.tw-mb-8 { margin-bottom: 2rem }
.tw-ml-1 { margin-left: 0.25rem }
.tw-ml-2 { margin-left: 0.5rem }
.tw-ml-5 { margin-left: 1.25rem }
.tw-mr-1 { margin-right: 0.25rem }
.tw-mr-2 { margin-right: 0.5rem }

/* ── Padding ── */
.tw-p-0 { padding: 0 }
.tw-p-2 { padding: 0.5rem }
.tw-p-3 { padding: 0.75rem }
.tw-p-3\.5 { padding: 0.875rem }
.tw-p-4 { padding: 1rem }
.tw-p-5 { padding: 1.25rem }
.tw-p-6 { padding: 1.5rem }
.tw-px-2 { padding-left: 0.5rem; padding-right: 0.5rem }
.tw-px-3 { padding-left: 0.75rem; padding-right: 0.75rem }
.tw-px-4 { padding-left: 1rem; padding-right: 1rem }
.tw-px-5 { padding-left: 1.25rem; padding-right: 1.25rem }
.tw-px-6 { padding-left: 1.5rem; padding-right: 1.5rem }
.tw-py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem }
.tw-py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem }
.tw-py-2\.5 { padding-top: 0.625rem; padding-bottom: 0.625rem }
.tw-py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem }
.tw-py-4 { padding-top: 1rem; padding-bottom: 1rem }
.tw-pt-2 { padding-top: 0.5rem }
.tw-pt-4 { padding-top: 1rem }
.tw-pb-2 { padding-bottom: 0.5rem }

/* ── Width / Height ── */
.tw-w-3 { width: 0.75rem }
.tw-w-4 { width: 1rem }
.tw-w-5 { width: 1.25rem }
.tw-w-6 { width: 1.5rem }
.tw-w-8 { width: 2rem }
.tw-w-9 { width: 2.25rem }
.tw-w-10 { width: 2.5rem }
.tw-w-11 { width: 2.75rem }
.tw-w-12 { width: 3rem }
.tw-w-16 { width: 4rem }
.tw-w-20 { width: 5rem }
.tw-w-full { width: 100% }
.tw-h-3 { height: 0.75rem }
.tw-h-4 { height: 1rem }
.tw-h-5 { height: 1.25rem }
.tw-h-6 { height: 1.5rem }
.tw-h-8 { height: 2rem }
.tw-h-9 { height: 2.25rem }
.tw-h-10 { height: 2.5rem }
.tw-h-11 { height: 2.75rem }
.tw-h-12 { height: 3rem }
.tw-h-16 { height: 4rem }
.tw-h-20 { height: 5rem }
.tw-h-full { height: 100% }
.tw-min-h-screen { min-height: 100vh }
.tw-max-w-md { max-width: 28rem }
.tw-max-w-lg { max-width: 32rem }
.tw-max-w-xl { max-width: 36rem }

/* ── Typography ── */
.tw-text-\[10px\] { font-size: 10px }
.tw-text-xs { font-size: 0.75rem; line-height: 1rem }
.tw-text-sm { font-size: 0.875rem; line-height: 1.25rem }
.tw-text-base { font-size: 1rem; line-height: 1.5rem }
.tw-text-lg { font-size: 1.125rem; line-height: 1.75rem }
.tw-text-xl { font-size: 1.25rem; line-height: 1.75rem }
.tw-text-2xl { font-size: 1.5rem; line-height: 2rem }
.tw-text-3xl { font-size: 1.875rem; line-height: 2.25rem }
.tw-font-normal { font-weight: 400 }
.tw-font-medium { font-weight: 500 }
.tw-font-semibold { font-weight: 600 }
.tw-font-bold { font-weight: 700 }
.tw-font-extrabold { font-weight: 800 }
.tw-leading-none { line-height: 1 }
.tw-leading-tight { line-height: 1.25 }
.tw-leading-snug { line-height: 1.375 }
.tw-leading-normal { line-height: 1.5 }
.tw-leading-relaxed { line-height: 1.625 }
.tw-leading-loose { line-height: 2 }
.tw-tracking-tight { letter-spacing: -0.025em }
.tw-whitespace-nowrap { white-space: nowrap }
.tw-text-left { text-align: left }
.tw-text-center { text-align: center }
.tw-text-right { text-align: right }
.tw-no-underline { text-decoration-line: none }
.tw-underline { text-decoration-line: underline }
.tw-line-through { text-decoration-line: line-through }
.tw-uppercase { text-transform: uppercase }
.tw-capitalize { text-transform: capitalize }
.tw-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap }

/* ── Colors — Text ── */
.tw-text-white { color: #fff }
.tw-text-black { color: #000 }
.tw-text-slate-400 { color: #94A3B8 }
.tw-text-slate-500 { color: #64748B }
.tw-text-slate-600 { color: #475569 }
.tw-text-slate-700 { color: #334155 }
.tw-text-slate-800 { color: #1E293B }
.tw-text-slate-900 { color: #0F172A }
.tw-text-gray-500 { color: #6B7280 }
.tw-text-gray-600 { color: #4B5563 }
.tw-text-gray-700 { color: #374151 }
.tw-text-blue-600 { color: #2563EB }
.tw-text-blue-700 { color: #1D4ED8 }
.tw-text-blue-800 { color: #1E40AF }
.tw-text-red-500 { color: #EF4444 }
.tw-text-red-600 { color: #DC2626 }
.tw-text-green-600 { color: #16A34A }
.tw-text-green-700 { color: #15803D }
.tw-text-amber-600 { color: #D97706 }
.tw-text-amber-700 { color: #B45309 }

/* ── Colors — Background ── */
.tw-bg-white { background-color: #fff }
.tw-bg-black { background-color: #000 }
.tw-bg-slate-50 { background-color: #F8FAFC }
.tw-bg-slate-100 { background-color: #F1F5F9 }
.tw-bg-slate-200 { background-color: #E2E8F0 }
.tw-bg-blue-50 { background-color: #EFF6FF }
.tw-bg-blue-100 { background-color: #DBEAFE }
.tw-bg-blue-600 { background-color: #2563EB }
.tw-bg-red-50 { background-color: #FEF2F2 }
.tw-bg-green-50 { background-color: #F0FDF4 }
.tw-bg-amber-50 { background-color: #FFFBEB }
.tw-bg-transparent { background-color: transparent }

/* ── Border ── */
.tw-border { border-width: 1px; border-style: solid; border-color: #E2E8F0 }
.tw-border-0 { border-width: 0 }
.tw-border-2 { border-width: 2px; border-style: solid }
.tw-border-t { border-top-width: 1px; border-top-style: solid; border-color: #E2E8F0 }
.tw-border-b { border-bottom-width: 1px; border-bottom-style: solid; border-color: #E2E8F0 }
.tw-border-l { border-left-width: 1px; border-left-style: solid; border-color: #E2E8F0 }
.tw-border-slate-200 { border-color: #E2E8F0 }
.tw-border-slate-300 { border-color: #CBD5E1 }
.tw-border-blue-200 { border-color: #BFDBFE }
.tw-border-transparent { border-color: transparent }

/* ── Border Radius ── */
.tw-rounded { border-radius: 0.25rem }
.tw-rounded-md { border-radius: 0.375rem }
.tw-rounded-lg { border-radius: 0.5rem }
.tw-rounded-xl { border-radius: 0.75rem }
.tw-rounded-2xl { border-radius: 1rem }
.tw-rounded-3xl { border-radius: 1.5rem }
.tw-rounded-full { border-radius: 9999px }

/* ── Shadow ── */
.tw-shadow-sm { box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05) }
.tw-shadow { box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1) }
.tw-shadow-md { box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1) }
.tw-shadow-lg { box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1) }
.tw-shadow-none { box-shadow: none }

/* ── Overflow ── */
.tw-overflow-hidden { overflow: hidden }
.tw-overflow-auto { overflow: auto }
.tw-overflow-x-auto { overflow-x: auto }
.tw-overflow-y-auto { overflow-y: auto }

/* ── Position ── */
.tw-relative { position: relative }
.tw-absolute { position: absolute }
.tw-fixed { position: fixed }
.tw-sticky { position: sticky }
.tw-inset-0 { inset: 0 }
.tw-top-0 { top: 0 }
.tw-right-0 { right: 0 }
.tw-bottom-0 { bottom: 0 }
.tw-left-0 { left: 0 }

/* ── Z-Index ── */
.tw-z-10 { z-index: 10 }
.tw-z-20 { z-index: 20 }
.tw-z-50 { z-index: 50 }

/* ── Misc ── */
.tw-cursor-pointer { cursor: pointer }
.tw-resize-y { resize: vertical }
.tw-align-middle { vertical-align: middle }
.tw-opacity-0 { opacity: 0 }
.tw-opacity-50 { opacity: 0.5 }
.tw-opacity-100 { opacity: 1 }
.tw-transition { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms }
.tw-transition-all { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms }
.tw-duration-200 { transition-duration: 200ms }
.tw-duration-300 { transition-duration: 300ms }
.tw-object-cover { object-fit: cover }
.tw-object-contain { object-fit: contain }
.tw-pointer-events-none { pointer-events: none }
.tw-select-none { user-select: none }
.tw-list-none { list-style-type: none }
.tw-appearance-none { appearance: none }

/* ── Responsive: sm (640px+) ── */
@media (min-width: 640px) {
  .sm\:tw-flex { display: flex }
  .sm\:tw-inline-flex { display: inline-flex }
  .sm\:tw-grid { display: grid }
  .sm\:tw-hidden { display: none }
  .sm\:tw-block { display: block }
  .sm\:tw-flex-row { flex-direction: row }
  .sm\:tw-flex-col { flex-direction: column }
  .sm\:tw-items-center { align-items: center }
  .sm\:tw-justify-between { justify-content: space-between }
  .sm\:tw-grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .sm\:tw-gap-3 { gap: 0.75rem }
  .sm\:tw-gap-3\.5 { gap: 0.875rem }
  .sm\:tw-gap-4 { gap: 1rem }
  .sm\:tw-gap-6 { gap: 1.5rem }
  .sm\:tw-p-4 { padding: 1rem }
  .sm\:tw-p-5 { padding: 1.25rem }
  .sm\:tw-px-5 { padding-left: 1.25rem; padding-right: 1.25rem }
  .sm\:tw-px-6 { padding-left: 1.5rem; padding-right: 1.5rem }
  .sm\:tw-py-2\.5 { padding-top: 0.625rem; padding-bottom: 0.625rem }
  .sm\:tw-my-16 { margin-top: 4rem; margin-bottom: 4rem }
  .sm\:tw-mt-0 { margin-top: 0 }
  .sm\:tw-mb-0 { margin-bottom: 0 }
  .sm\:tw-w-11 { width: 2.75rem }
  .sm\:tw-h-11 { height: 2.75rem }
  .sm\:tw-text-xs { font-size: 0.75rem; line-height: 1rem }
  .sm\:tw-text-sm { font-size: 0.875rem; line-height: 1.25rem }
  .sm\:tw-text-base { font-size: 1rem; line-height: 1.5rem }
  .sm\:tw-text-lg { font-size: 1.125rem; line-height: 1.75rem }
  .sm\:tw-text-xl { font-size: 1.25rem; line-height: 1.75rem }
}

/* ── Responsive: md (768px+) ── */
@media (min-width: 768px) {
  .md\:tw-flex { display: flex }
  .md\:tw-inline-flex { display: inline-flex }
  .md\:tw-grid { display: grid }
  .md\:tw-hidden { display: none }
  .md\:tw-block { display: block }
  .md\:tw-flex-row { flex-direction: row }
  .md\:tw-items-center { align-items: center }
  .md\:tw-grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .md\:tw-grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) }
  .md\:tw-gap-6 { gap: 1.5rem }
  .md\:tw-gap-8 { gap: 2rem }
  .md\:tw-p-6 { padding: 1.5rem }
  .md\:tw-px-6 { padding-left: 1.5rem; padding-right: 1.5rem }
  .md\:tw-text-sm { font-size: 0.875rem; line-height: 1.25rem }
  .md\:tw-text-base { font-size: 1rem; line-height: 1.5rem }
  .md\:tw-text-lg { font-size: 1.125rem; line-height: 1.75rem }
  .md\:tw-text-xl { font-size: 1.25rem; line-height: 1.75rem }
  .md\:tw-text-2xl { font-size: 1.5rem; line-height: 2rem }
  .md\:tw-mt-0 { margin-top: 0 }
  .md\:tw-mb-0 { margin-bottom: 0 }
}

/* ── Responsive: lg (1024px+) ── */
@media (min-width: 1024px) {
  .lg\:tw-flex { display: flex }
  .lg\:tw-grid { display: grid }
  .lg\:tw-hidden { display: none }
  .lg\:tw-block { display: block }
  .lg\:tw-grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) }
  .lg\:tw-grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)) }
  .lg\:tw-gap-8 { gap: 2rem }
  .lg\:tw-p-8 { padding: 2rem }
  .lg\:tw-text-lg { font-size: 1.125rem; line-height: 1.75rem }
}

/* ── Custom responsive helpers (preserved) ── */
.tw-container-responsive { width: 100%; margin-left: auto; margin-right: auto; padding-left: 1rem; padding-right: 1rem }
@media (min-width: 640px) { .tw-container-responsive { max-width: 640px } }
@media (min-width: 768px) { .tw-container-responsive { max-width: 768px } }
@media (min-width: 1024px) { .tw-container-responsive { max-width: 1024px } }
@media (min-width: 1280px) { .tw-container-responsive { max-width: 1280px } }

.tw-grid-responsive-2 { display: grid; grid-template-columns: 1fr; gap: 1rem }
@media (min-width: 640px) { .tw-grid-responsive-2 { grid-template-columns: repeat(2, 1fr) } }

.tw-grid-responsive-3 { display: grid; grid-template-columns: 1fr; gap: 1rem }
@media (min-width: 640px) { .tw-grid-responsive-3 { grid-template-columns: repeat(2, 1fr) } }
@media (min-width: 1024px) { .tw-grid-responsive-3 { grid-template-columns: repeat(3, 1fr) } }

.tw-flex-col-mobile { display: flex; flex-direction: column }
@media (min-width: 768px) { .tw-flex-col-mobile { flex-direction: row } }

.tw-hide-mobile { display: none }
@media (min-width: 768px) { .tw-hide-mobile { display: block } }
.tw-show-mobile { display: block }
@media (min-width: 768px) { .tw-show-mobile { display: none } }

.tw-table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 0.5rem; border: 1px solid #E2E8F0 }
.tw-table-responsive table { min-width: 600px; width: 100% }
@media (min-width: 1024px) { .tw-table-responsive table { min-width: 100% } }

.tw-tap-target { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center }

.tw-overflow-mobile { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin }
.tw-overflow-mobile::-webkit-scrollbar { height: 6px }
.tw-overflow-mobile::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 3px }
.tw-overflow-mobile::-webkit-scrollbar-thumb { background: #888; border-radius: 3px }
.tw-overflow-mobile::-webkit-scrollbar-thumb:hover { background: #555 }

.tw-stack-responsive { display: flex; flex-direction: column; gap: 1rem }
@media (min-width: 768px) { .tw-stack-responsive { flex-direction: row; align-items: center } }

@media print {
  .tw-print-hidden { display: none !important }
  .tw-print-visible { display: block !important }
}
