/*
 * Local UI fallback for offline or blocked CDN environments.
 * Provides a practical subset of the utility classes used by the app.
 */

:root {
    --umu-red: #b91c1c;
    --umu-red-dark: #991b1b;
    --umu-gray-50: #f9fafb;
    --umu-gray-100: #f3f4f6;
    --umu-gray-200: #e5e7eb;
    --umu-gray-300: #d1d5db;
    --umu-gray-500: #6b7280;
    --umu-gray-600: #4b5563;
    --umu-gray-700: #374151;
    --umu-gray-800: #1f2937;
    --umu-gray-900: #111827;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--umu-gray-800);
    background: var(--umu-gray-100);
}

body {
    line-height: 1.5;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

button, input, select, textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.brand-logo-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #ffffff, #fde8e8);
    padding: 0.25rem;
    border-radius: 0.8rem 1.2rem 0.9rem 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.75);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
    transform: rotate(-4deg);
}

.brand-logo-badge img {
    transform: rotate(4deg);
}

.sidebar-transition {
    transition: all 0.2s ease;
}

.app-toast-enter {
    animation: appToastSlideIn 220ms ease-out;
}

@keyframes appToastSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

[x-cloak] { display: none !important; }

.no-print { }

@media print {
    .no-print { display: none !important; }
    body { background: #fff !important; }
    .print-card { box-shadow: none !important; border: 1px solid #ddd !important; }
}

.hidden { display: none !important; }
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.table { display: table; }
.w-full { width: 100%; }
.w-auto { width: auto; }
.w-10 { width: 2.5rem; }
.w-16 { width: 4rem; }
.w-48 { width: 12rem; }
.w-64 { width: 16rem; }
.w-80 { width: 20rem; }
.h-10 { height: 2.5rem; }
.h-16 { height: 4rem; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }
.min-w-0 { min-width: 0; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-7xl { max-width: 80rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

.sticky { position: sticky; }
.fixed { position: fixed; }
.relative { position: relative; }
.absolute { position: absolute; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.top-0 { top: 0; }
.top-5 { top: 1.25rem; }
.right-0 { right: 0; }
.right-5 { right: 1.25rem; }
.left-0 { left: 0; }
.left-1 { left: 0.25rem; }
.z-50 { z-index: 50; }
.z-\[70\] { z-index: 70; }
.z-\[80\] { z-index: 80; }

.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.flex-1 { flex: 1 1 0%; }
.flex-shrink-0 { flex-shrink: 0; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }
.gap-6 { gap: 1.5rem; }

.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }
.select-none { user-select: none; }
.text-left { text-align: left; }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.uppercase { text-transform: uppercase; }
.italic { font-style: italic; }
.leading-none { line-height: 1; }
.whitespace-nowrap { white-space: nowrap; }
.break-words { overflow-wrap: break-word; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-full { border-radius: 9999px; }

.border { border: 1px solid var(--umu-gray-200); }
.border-2 { border-width: 2px; border-style: solid; }
.border-t-4 { border-top: 4px solid var(--umu-red); }
.border-l-4 { border-left: 4px solid var(--umu-red); }
.border-b { border-bottom: 1px solid var(--umu-gray-200); }
.border-gray-100 { border-color: #f3f4f6; }
.border-gray-200 { border-color: #e5e7eb; }
.border-gray-300 { border-color: #d1d5db; }
.border-red-200 { border-color: #fecaca; }
.border-red-700 { border-color: var(--umu-red); }
.border-yellow-200 { border-color: #fde68a; }
.border-amber-200 { border-color: #fde68a; }
.border-green-200 { border-color: #bbf7d0; }

.bg-white { background: #fff; }
.bg-gray-50 { background: var(--umu-gray-50); }
.bg-gray-100 { background: var(--umu-gray-100); }
.bg-gray-200 { background: var(--umu-gray-200); }
.bg-gray-800 { background: var(--umu-gray-800); }
.bg-red-50 { background: #fef2f2; }
.bg-red-100 { background: #fee2e2; }
.bg-red-600 { background: #dc2626; }
.bg-red-700 { background: var(--umu-red); }
.bg-red-800 { background: var(--umu-red-dark); }
.bg-yellow-50 { background: #fffbeb; }
.bg-amber-50 { background: #fffbeb; }
.bg-amber-100 { background: #fef3c7; }
.bg-amber-400 { background: #fbbf24; }
.bg-green-50 { background: #f0fdf4; }
.bg-green-100 { background: #dcfce7; }
.bg-green-600 { background: #16a34a; }
.bg-green-700 { background: #15803d; }
.bg-emerald-100 { background: #d1fae5; }
.bg-sky-100 { background: #e0f2fe; }
.bg-purple-50 { background: #faf5ff; }
.bg-indigo-600 { background: #4f46e5; }

.text-white { color: #fff; }
.text-gray-300 { color: #d1d5db; }
.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: var(--umu-gray-500); }
.text-gray-600 { color: var(--umu-gray-600); }
.text-gray-700 { color: var(--umu-gray-700); }
.text-gray-800 { color: var(--umu-gray-800); }
.text-gray-900 { color: var(--umu-gray-900); }
.text-red-600 { color: #dc2626; }
.text-red-700 { color: var(--umu-red); }
.text-red-800 { color: var(--umu-red-dark); }
.text-red-900 { color: #7f1d1d; }
.text-yellow-100 { color: #fef9c3; }
.text-yellow-600 { color: #ca8a04; }
.text-yellow-700 { color: #a16207; }
.text-yellow-800 { color: #854d0e; }
.text-green-600 { color: #16a34a; }
.text-green-700 { color: #15803d; }
.text-green-800 { color: #166534; }
.text-green-900 { color: #14532d; }
.text-amber-600 { color: #d97706; }
.text-amber-700 { color: #b45309; }
.text-amber-800 { color: #92400e; }
.text-amber-900 { color: #78350f; }
.text-sky-700 { color: #0369a1; }
.text-purple-600 { color: #9333ea; }
.text-indigo-600 { color: #4f46e5; }

.shadow { box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.shadow-sm { box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.shadow-md { box-shadow: 0 4px 10px rgba(0,0,0,.12); }
.shadow-lg { box-shadow: 0 10px 20px rgba(0,0,0,.14); }
.shadow-xl { box-shadow: 0 20px 40px rgba(0,0,0,.18); }
.shadow-2xl { box-shadow: 0 25px 50px rgba(0,0,0,.22); }

.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.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; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-5 { padding-top: 1.25rem; padding-bottom: 1.25rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.pt-1 { padding-top: 0.25rem; }
.pt-2 { padding-top: 0.5rem; }
.pb-1 { padding-bottom: 0.25rem; }
.pb-2 { padding-bottom: 0.5rem; }
.pb-3 { padding-bottom: 0.75rem; }
.pl-2 { padding-left: 0.5rem; }
.pl-4 { padding-left: 1rem; }
.pl-5 { padding-left: 1.25rem; }
.pr-3 { padding-right: 0.75rem; }
.pr-4 { padding-right: 1rem; }

.m-0 { margin: 0; }
.m-1 { margin: 0.25rem; }
.m-2 { margin: 0.5rem; }
.m-3 { margin: 0.75rem; }
.m-4 { margin: 1rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-0 { margin-top: 0; }
.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; }
.mr-1 { margin-right: 0.25rem; }
.mr-2 { margin-right: 0.5rem; }
.mr-3 { margin-right: 0.75rem; }
.mr-4 { margin-right: 1rem; }
.ml-1 { margin-left: 0.25rem; }
.ml-2 { margin-left: 0.5rem; }
.ml-3 { margin-left: 0.75rem; }
.ml-4 { margin-left: 1rem; }

.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.text-6xl { font-size: 3.75rem; }
.text-9xl { font-size: 8rem; }

.ring-1 { box-shadow: 0 0 0 1px rgba(0,0,0,.06); }
.ring-amber-100 { box-shadow: 0 0 0 1px #fef3c7; }
.ring-emerald-100 { box-shadow: 0 0 0 1px #d1fae5; }
.ring-rose-100 { box-shadow: 0 0 0 1px #ffe4e6; }
.ring-sky-100 { box-shadow: 0 0 0 1px #e0f2fe; }

.border-collapse { border-collapse: collapse; }

.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }

@media (min-width: 640px) {
    .sm\:flex-row { flex-direction: row; }
    .sm\:items-center { align-items: center; }
    .sm\:justify-between { justify-content: space-between; }
    .sm\:w-auto { width: auto; }
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
    .md\:block { display: block; }
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .md\:flex-row { flex-direction: row; }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1280px) {
    .xl\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .xl\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .xl\:col-span-1 { grid-column: span 1 / span 1; }
    .xl\:col-span-2 { grid-column: span 2 / span 2; }
}

.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

.hover\:bg-gray-50:hover { background: var(--umu-gray-50); }
.hover\:bg-gray-100:hover { background: var(--umu-gray-100); }
.hover\:bg-gray-200:hover { background: var(--umu-gray-200); }
.hover\:bg-gray-700:hover { background: var(--umu-gray-700); }
.hover\:bg-gray-800:hover { background: var(--umu-gray-800); }
.hover\:bg-red-50:hover { background: #fef2f2; }
.hover\:bg-red-700:hover { background: var(--umu-red); }
.hover\:bg-red-800:hover { background: var(--umu-red-dark); }
.hover\:bg-green-700:hover { background: #15803d; }
.hover\:text-red-700:hover { color: var(--umu-red); }
.hover\:text-red-800:hover { color: var(--umu-red-dark); }
.hover\:text-gray-600:hover { color: var(--umu-gray-600); }
.hover\:text-gray-700:hover { color: var(--umu-gray-700); }
.hover\:text-gray-800:hover { color: var(--umu-gray-800); }

.transition { transition: all .2s ease; }
.transition-colors { transition: color .2s ease, background-color .2s ease, border-color .2s ease; }
.duration-200 { transition-duration: .2s; }
.animate-in { animation: appToastSlideIn 220ms ease-out; }

.bg-opacity-40 { background-color: rgba(0, 0, 0, 0.4); }
.bg-opacity-50 { background-color: rgba(0, 0, 0, 0.5); }

.focus\:outline-none:focus { outline: none; }
.focus\:ring-2:focus { box-shadow: 0 0 0 2px rgba(185, 28, 28, 0.2); }
.focus\:ring-red-700:focus { box-shadow: 0 0 0 2px rgba(185, 28, 28, 0.35); }

.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }

.opacity-90 { opacity: .9; }
.opacity-0 { opacity: 0; }

.min-w-\[18px\] { min-width: 18px; }
.top-16 { top: 4rem; }
.w-\[18px\] { width: 18px; }
.h-\[18px\] { height: 18px; }
.w-\[92vw\] { width: 92vw; }
.max-w-\[92vw\] { max-width: 92vw; }
.w-\[1\.5rem\] { width: 1.5rem; }

table {
    border-collapse: collapse;
    width: 100%;
}

th, td {
    border-color: #e5e7eb;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--umu-gray-300);
    border-radius: 0.5rem;
    padding: 0.6rem 0.75rem;
    background: #fff;
    color: var(--umu-gray-800);
}

input:disabled, select:disabled, textarea:disabled {
    background: #f9fafb;
    color: #9ca3af;
}

button, .btn, a.btn {
    border: 0;
}

.text-decoration-none { text-decoration: none; }
