:root {
    --font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    /* Modern color system */
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-500: #3b82f6;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;
    /* Glass morphism */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.18);
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.08);
    --shadow-elevation: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.dark {
    --bg: #030712;
    --surface: #0f172a;
    --text: #ffffff;
    --muted: #e2e8f0;
    --glass-bg: rgba(15, 23, 42, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-elevation: 0 20px 40px rgba(0, 0, 0, 0.6);
}

* {
    box-sizing: border-box;
}

svg {
    display: inline-block;
    vertical-align: middle;
}

svg[fill="none"] {
    fill: none;
}

svg[stroke=\"currentColor\"] {
    stroke: currentColor;
}

[stroke-linecap=\"round\"] { stroke-linecap: round; }
[stroke-linejoin=\"round\"] { stroke-linejoin: round; }
[stroke-width=\"2\"] { stroke-width: 2; }
[viewBox] { overflow: visible; }

/* Utility fallbacks for environments that can't load Tailwind CDN
   These keep the UI usable (correct icon sizes) if Tailwind fails to load. */
.w-5 { width: 1.25rem !important; }
.h-5 { height: 1.25rem !important; }
.w-4 { width: 1rem !important; }
.h-4 { height: 1rem !important; }
.w-8 { width: 2rem !important; }
.h-8 { height: 2rem !important; }
.w-10 { width: 2.5rem !important; }
.h-10 { height: 2.5rem !important; }
.w-52 { width: 13rem !important; }

@media (min-width: 640px) {
    .sm\:w-56 { width: 14rem !important; }
}
.w-48 { width: 12rem !important; }
.w-52 { width: 13rem !important; }
.w-64 { width: 16rem !important; }
.h-screen { height: 100vh !important; }
.text-xs { font-size: 0.75rem !important; }
.text-sm { font-size: 0.875rem !important; }
.text-base { font-size: 1rem !important; }
.text-lg { font-size: 1.125rem !important; }
.text-xl { font-size: 1.25rem !important; }
.text-2xl { font-size: 1.5rem !important; }
.text-3xl { font-size: 1.875rem !important; }
.text-4xl { font-size: 2.25rem !important; }
.font-medium { font-weight: 500 !important; }
.font-semibold { font-weight: 600 !important; }
.font-bold { font-weight: 700 !important; }
.capitalize { text-transform: capitalize !important; }
.truncate { overflow: hidden !important; text-overflow: ellipsis !important; white-space: nowrap !important; }
.min-w-0 { min-width: 0 !important; }
.rounded { border-radius: 0.25rem !important; }
.rounded-lg { border-radius: 0.5rem !important; }
.rounded-xl { border-radius: 0.75rem !important; }
.rounded-2xl { border-radius: 1rem !important; }
.rounded-full { border-radius: 9999px !important; }
.block { display: block !important; }
.inline-block { display: inline-block !important; }
.flex { display: flex !important; }
.grid { display: grid !important; }
.inline-flex { display: inline-flex !important; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)) !important; }
.flex-1 { flex: 1 1 0% !important; }
.flex-shrink-0 { flex-shrink: 0 !important; }
.items-center { align-items: center !important; }
.justify-center { justify-content:center !important; }
.justify-between { justify-content: space-between !important; }
.gap-3 { gap: 0.75rem !important; }
.gap-6 { gap: 1.5rem !important; }
.p-1 { padding: 0.25rem !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 0.75rem !important; }
.p-4 { padding: 1rem !important; }
.p-6 { padding: 1.5rem !important; }
.p-8 { padding: 2rem !important; }
.px-3 { padding-left: 0.75rem !important; padding-right: 0.75rem !important; }
.px-4 { padding-left: 1rem !important; padding-right: 1rem !important; }
.py-2 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
.py-3 { padding-top: 0.75rem !important; padding-bottom: 0.75rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-4 { margin-bottom: 1rem !important; }
.mb-8 { margin-bottom: 2rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.max-w-7xl { max-width: 80rem !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }
.overflow-hidden { overflow: hidden !important; }
.overflow-y-auto { overflow-y: auto !important; }
.relative { position: relative !important; }
.absolute { position: absolute !important; }
.top-full { top: 100% !important; }
.left-0 { left: 0 !important; }
.right-0 { right: 0 !important; }
.z-50 { z-index: 50 !important; }
.space-y-1 > * + * { margin-top: 0.25rem !important; }
.space-y-2 > * + * { margin-top: 0.5rem !important; }
.space-y-4 > * + * { margin-top: 1rem !important; }
.border { border-width: 1px !important; border-style: solid !important; }
.border-b { border-bottom-width: 1px !important; border-bottom-style: solid !important; }
.border-r { border-right-width: 1px !important; border-right-style: solid !important; }
.border-t { border-top-width: 1px !important; border-top-style: solid !important; }
.border-gray-200 { border-color: #e5e7eb !important; }
.border-gray-300 { border-color: #d1d5db !important; }
.shadow-sm { box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05) !important; }
.shadow-lg { box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1) !important; }
.shadow-xl { box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1) !important; }
.shadow-2xl { box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25) !important; }
.transition-colors { transition-property: color, background-color, border-color !important; transition-duration: 200ms !important; }
.transition-shadow { transition-property: box-shadow !important; transition-duration: 300ms !important; }
.cursor-pointer { cursor: pointer !important; }
.bg-white { background-color: #ffffff !important; }
.text-white { color: #ffffff !important; }
.text-gray-900 { color: #111827 !important; }
.dark\:text-white { color: #ffffff !important; }
.dark\:bg-gray-800 { background-color: #1f2937 !important; }
.bg-clip-text { background-clip: text !important; -webkit-background-clip: text !important; -webkit-text-fill-color: transparent !important; }
.text-transparent { color: transparent !important; }
.hidden { display: none !important; }

/* Primary brand fallbacks to keep white text readable even if Tailwind CDN fails */
.bg-blue-500 { background-color: #3b82f6 !important; }
.bg-blue-600 { background-color: #2563eb !important; }
.bg-blue-700 { background-color: #1d4ed8 !important; }
.bg-purple-600 { background-color: #8b5cf6 !important; }
.bg-purple-700 { background-color: #7c3aed !important; }
.bg-gradient-to-br { background-image: linear-gradient(135deg, var(--tw-gradient-from, #3b82f6), var(--tw-gradient-to, #8b5cf6)) !important; }
.bg-gradient-to-r { background-image: linear-gradient(90deg, var(--tw-gradient-from, #3b82f6), var(--tw-gradient-to, #8b5cf6)) !important; }
.from-blue-500 { --tw-gradient-from: #3b82f6 !important; }
.to-purple-600 { --tw-gradient-to: #8b5cf6 !important; }
.hover\:bg-blue-700:hover { background-color: #1d4ed8 !important; }

/* Color fallbacks (common Tailwind utilities) */
.text-gray-50 { color: #f9fafb !important; }
.text-gray-100 { color: #f3f4f6 !important; }
.text-gray-200 { color: #e5e7eb !important; }
.text-gray-300 { color: #d1d5db !important; }
.text-gray-400 { color: #9ca3af !important; }
.text-gray-500 { color: #6b7280 !important; }
.text-gray-600 { color: #4b5563 !important; }
.text-gray-700 { color: #374151 !important; }
.text-gray-800 { color: #1f2937 !important; }
.text-gray-900 { color: #111827 !important; }

.bg-gray-50 { background-color: #f9fafb !important; }
.bg-gray-100 { background-color: #f3f4f6 !important; }
.bg-gray-200 { background-color: #e5e7eb !important; }
.bg-gray-300 { background-color: #d1d5db !important; }
.bg-gray-700 { background-color: #374151 !important; }
.bg-gray-800 { background-color: #1f2937 !important; }
.bg-gray-900 { background-color: #111827 !important; }

/* Blue color utilities */
.text-blue-50 { color: #eff6ff !important; }
.text-blue-100 { color: #dbeafe !important; }
.text-blue-200 { color: #bfdbfe !important; }
.text-blue-800 { color: #1e40af !important; }
.text-blue-900 { color: #1e3a8a !important; }
.bg-blue-50 { background-color: #eff6ff !important; }
.bg-blue-100 { background-color: #dbeafe !important; }
.bg-blue-200 { background-color: #bfdbfe !important; }
.border-blue-200 { border-color: #bfdbfe !important; }
.border-blue-800 { border-color: #1e40af !important; }

/* Accent colors for KPI cards */
.bg-amber-100 { background-color: #fed7aa !important; }
.text-amber-600 { color: #d97706 !important; }
.dark\:bg-amber-900\/30 { background-color: rgba(120, 53, 15, 0.3) !important; }
.dark\:text-amber-400 { color: #fbbf24 !important; }

.bg-green-100 { background-color: #d1fae5 !important; }
.text-green-600 { color: #16a34a !important; }
.dark\:bg-green-900\/30 { background-color: rgba(20, 83, 45, 0.3) !important; }
.dark\:text-green-400 { color: #4ade80 !important; }

.bg-purple-100 { background-color: #e9d5ff !important; }
.text-purple-600 { color: #9333ea !important; }
.dark\:bg-purple-900\/30 { background-color: rgba(88, 28, 135, 0.3) !important; }
.dark\:text-purple-400 { color: #d8b4fe !important; }

/* Dark mode variant fallbacks (escaped colon for CSS) */
.dark\:text-gray-100 { color: #f3f4f6 !important; }
.dark\:text-gray-200 { color: #e5e7eb !important; }
.dark\:text-gray-300 { color: #d1d5db !important; }
.dark\:text-gray-400 { color: #9ca3af !important; }
.dark\:text-gray-500 { color: #6b7280 !important; }
.dark\:text-gray-600 { color: #4b5563 !important; }
.dark\:text-gray-700 { color: #374151 !important; }
.dark\:text-gray-800 { color: #1f2937 !important; }
.dark\:text-gray-900 { color: #111827 !important; }
.dark\:bg-gray-900 { background-color: #111827 !important; }
.dark\:bg-gray-800 { background-color: #1f2937 !important; }
.dark\:bg-gray-700 { background-color: #374151 !important; }
.dark\:bg-gray-600 { background-color: #4b5563 !important; }
.dark\:border-gray-700 { border-color: #374151 !important; }
.dark\:border-gray-600 { border-color: #4b5563 !important; }

/* Blue dark mode variants */
.dark\:text-blue-100 { color: #dbeafe !important; }
.dark\:text-blue-200 { color: #bfdbfe !important; }
.dark\:bg-blue-900 { background-color: #1e3a8a !important; }
.dark\:border-blue-800 { border-color: #1e40af !important; }

/* Body-scoped dark mode (when body.dark is applied) */
body.dark .text-gray-100,
body.dark .dark\:text-gray-100 { color: #f3f4f6 !important; }
body.dark .text-gray-200,
body.dark .dark\:text-gray-200 { color: #e5e7eb !important; }
body.dark .text-gray-300,
body.dark .dark\:text-gray-300 { color: #d1d5db !important; }
body.dark .text-gray-400,
body.dark .dark\:text-gray-400 { color: #9ca3af !important; }
body.dark .text-gray-500,
body.dark .dark\:text-gray-500 { color: #6b7280 !important; }
body.dark .text-gray-600,
body.dark .dark\:text-gray-600 { color: #4b5563 !important; }
body.dark .text-gray-700,
body.dark .dark\:text-gray-700 { color: #374151 !important; }
body.dark .text-gray-800,
body.dark .dark\:text-gray-800 { color: #1f2937 !important; }
body.dark .text-gray-900,
body.dark .dark\:text-gray-900 { color: #111827 !important; }
body.dark .text-white,
body.dark .dark\:text-white { color: #ffffff !important; }
body.dark .bg-gray-900,
body.dark .dark\:bg-gray-900 { background-color: #111827 !important; }
body.dark .bg-gray-800,
body.dark .dark\:bg-gray-800 { background-color: #1f2937 !important; }
body.dark .bg-gray-700,
body.dark .dark\:bg-gray-700 { background-color: #374151 !important; }
body.dark .bg-gray-600,
body.dark .dark\:bg-gray-600 { background-color: #4b5563 !important; }
body.dark .bg-white,
body.dark .dark\:bg-white { background-color: #1f2937 !important; }
body.dark .border-gray-700,
body.dark .dark\:border-gray-700 { border-color: #374151 !important; }
body.dark .border-gray-600,
body.dark .dark\:border-gray-600 { border-color: #4b5563 !important; }
body.dark .border-gray-200,
body.dark .dark\:border-gray-200 { border-color: #4b5563 !important; }

/* Blue body.dark scoped */
body.dark .text-blue-100,
body.dark .dark\:text-blue-100 { color: #dbeafe !important; }
body.dark .text-blue-200,
body.dark .dark\:text-blue-200 { color: #bfdbfe !important; }
body.dark .bg-blue-900,
body.dark .dark\:bg-blue-900 { background-color: #1e3a8a !important; }
body.dark .dark\:bg-blue-900\/20 { background-color: rgba(30, 58, 138, 0.2) !important; }
body.dark .border-blue-800,
body.dark .dark\:border-blue-800 { border-color: #1e40af !important; }

/* Light mode explicit overrides (default body without .dark) */
body:not(.dark) .text-gray-900 { color: #111827 !important; }
body:not(.dark) .text-gray-800 { color: #1f2937 !important; }
body:not(.dark) .text-gray-700 { color: #374151 !important; }
body:not(.dark) .text-gray-600 { color: #4b5563 !important; }
body:not(.dark) .text-gray-500 { color: #6b7280 !important; }
body:not(.dark) .text-gray-400 { color: #9ca3af !important; }
body:not(.dark) .bg-white { background-color: #ffffff !important; }
body:not(.dark) .bg-gray-50 { background-color: #f9fafb !important; }
body:not(.dark) .bg-gray-100 { background-color: #f3f4f6 !important; }
body:not(.dark) .bg-gray-800 { background-color: #1f2937 !important; }

/* Blue light mode overrides */
body:not(.dark) .text-blue-800 { color: #1e40af !important; }
body:not(.dark) .text-blue-900 { color: #1e3a8a !important; }
body:not(.dark) .bg-blue-50 { background-color: #eff6ff !important; }
body:not(.dark) .border-blue-200 { border-color: #bfdbfe !important; }
body:not(.dark) .bg-gray-900 { background-color: #111827 !important; }

/* Accent colors often used for status pills */
.bg-blue-50 { background-color: #eff6ff !important; }
.text-blue-600 { color: #2563eb !important; }
.dark\:text-blue-400 { color: #60a5fa !important; }
.bg-green-100 { background-color: #d1fae5 !important; }
.text-green-800 { color: #065f46 !important; }
.dark\:text-green-300 { color: #6ee7b7 !important; }
.bg-purple-100 { background-color: #ede9fe !important; }
.text-purple-800 { color: #5b21b6 !important; }
.dark\:text-purple-300 { color: #c4b5fd !important; }
.bg-red-50 { background-color: #fef2f2 !important; }
.text-red-600 { color: #dc2626 !important; }
.dark\:text-red-400 { color: #f87171 !important; }

/* Pill style fallback (if Tailwind missing) */
.pill { display:inline-block; padding:0.25rem 0.625rem; font-size:0.625rem; line-height:1; border-radius:9999px; font-weight:500; letter-spacing:0.5px; text-transform:uppercase; }
.pill.pending { background:#0d4a6e; color:#fff; }
.pill.fulfilled { background:#065f46; color:#fff; }
.pill.rejected { background:#7f1d1d; color:#fff; }

/* Improve table readability in dark mode without Tailwind */
body.dark table { color:#e5e7eb; }
body.dark table thead { background:#111827; color:#d1d5db; }
body.dark table thead th { color:#9ca3af; text-transform:uppercase; font-size:0.75rem; }
body.dark table tbody tr { background:#1f2937; }
body.dark table tbody tr:hover { background:#374151; }
body.dark table tbody tr:nth-child(even) { background:#243047; }
body.dark table td, body.dark table th { border-color:#374151; padding:0.75rem 1rem; }

/* Light mode table styles */
body:not(.dark) table { color:#111827; }
body:not(.dark) table thead { background:#f9fafb; color:#374151; }
body:not(.dark) table thead th { color:#6b7280; text-transform:uppercase; font-size:0.75rem; }
body:not(.dark) table tbody tr { background:#ffffff; }
body:not(.dark) table tbody tr:hover { background:#f9fafb; }
body:not(.dark) table tbody tr:nth-child(even) { background:#f9fafb; }
body:not(.dark) table td, body:not(.dark) table th { border-color:#e5e7eb; padding:0.75rem 1rem; }


body {
    margin: 0;
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.modal-open {
    overflow: hidden;
}

/* Modern Glass Morphism Utility */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
}

/* Modern Shadow System */
.shadow-soft {
    box-shadow: var(--shadow-soft);
}

.shadow-elevation {
    box-shadow: var(--shadow-elevation);
}

/* Modern Ring Focus */
.ring-modern {
    outline: none;
    ring: 2px;
    ring-color: rgba(59, 130, 246, 0.5);
    ring-offset: 2px;
}

/* Smooth Transitions */
.transition-modern {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.transition-bounce {
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Login page styles */
.auth-body {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 1rem;
}

/* Sidebar collapse */
.layout[data-nav-state="collapsed"] aside {
    width: 0 !important;
    min-width: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
    border: none !important;
}

/* Role-based visibility */
body:not([data-role="requester"]) .only-requester {
    display: none;
}

body:not([data-role="it_manager"]):not([data-role="general_manager"]) .only-manager {
    display: none;
}

body:not([data-role="it_manager"]) .only-it-manager {
    display: none;
}

body:not([data-role="general_manager"]) .only-general-manager {
    display: none;
}

body:not([data-role="it_manager"]):not([data-role="general_manager"]) .only-it-gm {
    display: none;
}

/* Small Compact Biscuit Cards with Modern Design */
.inventory-biscuit {
    padding: 1rem;
    border-radius: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.inventory-biscuit:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px) scale(1.02);
}

body.dark .inventory-biscuit:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.inventory-summary-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.75rem;
    scroll-behavior: smooth;
}

.inventory-summary-row::-webkit-scrollbar {
    height: 8px;
}

.inventory-summary-row::-webkit-scrollbar-track {
    background: rgba(148, 163, 184, 0.1);
    border-radius: 999px;
}

.inventory-summary-row::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border-radius: 999px;
}

.inventory-summary-row::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, #2563eb, #7c3aed);
}

/* Modern Form Controls and Buttons */
input,
select,
textarea {
    font-family: var(--font);
    border-radius: 0.75rem;
    border: 2px solid rgba(148, 163, 184, 0.2);
    background: rgba(255, 255, 255, 0.95);
    color: var(--text);
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

body.dark input,
body.dark select,
body.dark textarea {
    border-color: rgba(148, 163, 184, 0.15);
    background: rgba(15, 23, 42, 0.8);
    color: #f8fafc;
}

input:hover,
select:hover,
textarea:hover {
    border-color: rgba(59, 130, 246, 0.3);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.8);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15), 0 4px 12px rgba(59, 130, 246, 0.1);
    background: rgba(255, 255, 255, 1);
    transform: translateY(-1px);
}

body.dark input:focus,
body.dark select:focus,
body.dark textarea:focus {
    background: rgba(15, 23, 42, 0.95);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2), 0 4px 12px rgba(0, 0, 0, 0.3);
}

input::placeholder,
textarea::placeholder {
    color: rgba(100, 116, 139, 0.6);
}

/* Modern Button Styles */
button {
    font-family: var(--font);
    border-radius: 0.75rem;
    border: none;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

button:active {
    transform: translateY(0);
}

button:focus-visible {
    outline: 2px solid rgba(59, 130, 246, 0.8);
    outline-offset: 2px;
}

/* Primary Button with Gradient */
button.btn-primary,
.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

button.btn-primary:hover,
.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

/* Modern Button Ripple Effect */
button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:active::before {
    width: 300px;
    height: 300px;
}

/* Modern Table Styles */
.modern-table {
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 0.75rem;
    overflow: hidden;
}

.modern-table thead tr th {
    position: sticky;
    top: 0;
    z-index: 10;
    font-weight: 700;
    letter-spacing: 0.05em;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    padding: 1rem 1.5rem;
}

body.dark .modern-table thead tr th {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
}

.modern-table tbody tr {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
}

.modern-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.05) 0%, transparent 100%);
    transform: scale(1.005);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

body.dark .modern-table tbody tr {
    border-bottom-color: rgba(71, 85, 105, 0.5);
}

body.dark .modern-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.12) 0%, transparent 100%);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.modern-table tbody td {
    padding: 1rem 1.5rem;
    vertical-align: middle;
}

/* Modern Card Hover Effect */
.card-modern {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.card-modern:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
    border-color: rgba(59, 130, 246, 0.3);
}

body.dark .card-modern {
    border-color: rgba(71, 85, 105, 0.8);
}

body.dark .card-modern:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    border-color: rgba(59, 130, 246, 0.4);
}

/* Purchases section readability in light mode */
body:not(.dark) #purchases {
    color: #111827;
}

body:not(.dark) #purchaseTable th,
body:not(.dark) #purchaseTable td,
body:not(.dark) #purchaseForm label span,
body:not(.dark) #purchaseForm input,
body:not(.dark) #purchaseForm textarea,
body:not(.dark) #purchaseMessage {
    color: #111827;
}

body:not(.dark) #purchases .text-gray-500,
body:not(.dark) #purchases .text-gray-600,
body:not(.dark) #purchases .dark\:text-gray-400,
body:not(.dark) #purchases .dark\:text-gray-300 {
    color: #6b7280;
}

body:not(.dark) #purchases .text-gray-700 {
    color: #374151;
}

/* CRITICAL FIX: Perfect Input field visibility for both light and dark modes */
input,
select,
textarea {
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Mode Inputs - Dark text on white/light background */
body:not(.dark) input,
body:not(.dark) select,
body:not(.dark) textarea {
    color: #1f2937 !important;
    background-color: rgba(255, 255, 255, 0.95) !important;
    border-color: rgba(203, 213, 225, 0.8);
}

body:not(.dark) input::placeholder,
body:not(.dark) select::placeholder,
body:not(.dark) textarea::placeholder {
    color: #94a3b8 !important;
    opacity: 0.7;
}

body:not(.dark) input:focus,
body:not(.dark) select:focus,
body:not(.dark) textarea:focus {
    color: #0f172a !important;
    background-color: #ffffff !important;
    border-color: #3b82f6;
}

/* Dark Mode Inputs - Light text on dark background */
body.dark input,
body.dark select,
body.dark textarea {
    color: #f1f5f9 !important;
    background-color: rgba(30, 41, 59, 0.85) !important;
    border-color: rgba(71, 85, 105, 0.6);
}

body.dark input::placeholder,
body.dark select::placeholder,
body.dark textarea::placeholder {
    color: #64748b !important;
    opacity: 0.8;
}

body.dark input:focus,
body.dark select:focus,
body.dark textarea:focus {
    color: #ffffff !important;
    background-color: rgba(30, 41, 59, 0.95) !important;
    border-color: #60a5fa;
}

/* Autofill fix - Light mode */
body:not(.dark) input:-webkit-autofill,
body:not(.dark) input:-webkit-autofill:hover,
body:not(.dark) input:-webkit-autofill:focus,
body:not(.dark) textarea:-webkit-autofill,
body:not(.dark) textarea:-webkit-autofill:hover,
body:not(.dark) textarea:-webkit-autofill:focus,
body:not(.dark) select:-webkit-autofill,
body:not(.dark) select:-webkit-autofill:hover,
body:not(.dark) select:-webkit-autofill:focus {
    -webkit-text-fill-color: #1f2937 !important;
    -webkit-box-shadow: 0 0 0px 1000px #ffffff inset !important;
    box-shadow: 0 0 0px 1000px #ffffff inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Autofill fix - Dark mode */
body.dark input:-webkit-autofill,
body.dark input:-webkit-autofill:hover,
body.dark input:-webkit-autofill:focus,
body.dark textarea:-webkit-autofill,
body.dark textarea:-webkit-autofill:hover,
body.dark textarea:-webkit-autofill:focus,
body.dark select:-webkit-autofill,
body.dark select:-webkit-autofill:hover,
body.dark select:-webkit-autofill:focus {
    -webkit-text-fill-color: #f1f5f9 !important;
    -webkit-box-shadow: 0 0 0px 1000px rgba(30, 41, 59, 0.85) inset !important;
    box-shadow: 0 0 0px 1000px rgba(30, 41, 59, 0.85) inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Disabled inputs - both modes */
body:not(.dark) input:disabled,
body:not(.dark) select:disabled,
body:not(.dark) textarea:disabled {
    color: #94a3b8 !important;
    background-color: #f1f5f9 !important;
    cursor: not-allowed;
    opacity: 0.6;
}

body.dark input:disabled,
body.dark select:disabled,
body.dark textarea:disabled {
    color: #64748b !important;
    background-color: rgba(30, 41, 59, 0.5) !important;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Usage audit highlighting */
.high-usage {
    background: rgba(248, 113, 113, 0.15) !important;
}

.high-usage td:nth-child(4) {
    font-weight: 600;
    color: #ef4444;
}

/* Status pills with modern design */
.pill {
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    letter-spacing: 0.025em;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.pill:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.pill.pending { 
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.2), rgba(14, 165, 233, 0.1)); 
    color: #0ea5e9;
    border: 1px solid rgba(14, 165, 233, 0.3);
}

.pill.fulfilled { 
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.1)); 
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.pill.approved {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.1));
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.pill.rejected { 
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.2), rgba(248, 113, 113, 0.1)); 
    color: #ef4444;
    border: 1px solid rgba(248, 113, 113, 0.3);
}

body.dark .pill.pending {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.25), rgba(14, 165, 233, 0.15));
    color: #38bdf8;
}

body.dark .pill.fulfilled,
body.dark .pill.approved {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(16, 185, 129, 0.15));
    color: #34d399;
}

body.dark .pill.rejected {
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.25), rgba(248, 113, 113, 0.15));
    color: #fca5a5;
}

/* History list */
.history-list {
    margin: 0;
    padding-left: 1rem;
    font-size: 0.85rem;
}

/* Modal with modern glassmorphism */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    backdrop-filter: blur(8px) saturate(150%);
    -webkit-backdrop-filter: blur(8px) saturate(150%);
    z-index: 50;
    animation: fadeIn 0.2s ease-out;
}

.modal[aria-hidden="true"] {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Profile menu */
#profileMenu {
    width: 12rem !important;
    max-width: 12rem !important;
}

#profileMenu button[type="submit"],
#profileMenu button[type="button"] {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0.625rem 1rem !important;
    justify-content: flex-start !important;
    min-height: auto !important;
    font-weight: 500 !important;
    transform: none !important;
    white-space: nowrap !important;
}

#profileMenu button:hover {
    transform: none !important;
}

/* Light mode profile menu - ensure text is dark */
body:not(.dark) #profileMenu button[type="button"],
body:not(.dark) #profileMenu button[type="submit"] {
    color: #374151 !important;
}

body:not(.dark) #profileMenu button[type="submit"] {
    color: #dc2626 !important;
}

/* Dark mode profile menu - ensure text is light */
body.dark #profileMenu button[type="button"] {
    color: #d1d5db !important;
}

body.dark #profileMenu button[type="submit"] {
    color: #f87171 !important;
}

/* Sidebar navigation link colors */
body:not(.dark) .nav-link {
    color: #374151 !important;
}

body.dark .nav-link {
    color: #d1d5db !important;
}

body:not(.dark) .nav-link:hover {
    background-color: #f3f4f6 !important;
    color: #1f2937 !important;
}

body.dark .nav-link:hover {
    background-color: #374151 !important;
    color: #ffffff !important;
}

/* Active nav link */
body:not(.dark) .nav-link.active,
body:not(.dark) .nav-link.bg-blue-50 {
    background-color: #eff6ff !important;
    color: #2563eb !important;
}

body.dark .nav-link.active,
body.dark .nav-link.bg-blue-50 {
    background-color: rgba(59, 130, 246, 0.15) !important;
    color: #60a5fa !important;
}

/* General hover utilities */
.hover\:bg-gray-100:hover { background-color: #f3f4f6 !important; }
.hover\:bg-gray-200:hover { background-color: #e5e7eb !important; }
body.dark .hover\:bg-gray-700:hover,
body.dark .dark\:hover\:bg-gray-700:hover { background-color: #374151 !important; }
body.dark .hover\:bg-gray-800:hover,
body.dark .dark\:hover\:bg-gray-800:hover { background-color: #1f2937 !important; }

/* Critical nav link layout */
aside nav a.nav-link,
aside nav .nav-link {
    display: flex;
    align-items: center !important;
    gap: 0.75rem !important;
    padding: 0.75rem 1rem !important;
    border-radius: 0.5rem !important;
    cursor: pointer !important;
    transition: background-color 0.2s, color 0.2s !important;
}

/* Light mode nav link colors */
body:not(.dark) aside nav a.nav-link,
body:not(.dark) aside nav .nav-link {
    color: #374151 !important;
    background-color: transparent !important;
}

/* Ensure light-mode nav icons/text maintain contrast */
body:not(.dark) aside nav {
    color: #1f2937 !important;
}

body:not(.dark) aside nav .nav-link span,
body:not(.dark) aside nav .nav-link svg {
    color: inherit !important;
    opacity: 1 !important;
}

body:not(.dark) aside nav .nav-link svg path,
body:not(.dark) aside nav .nav-link svg circle,
body:not(.dark) aside nav .nav-link svg line {
    stroke: currentColor !important;
}

body:not(.dark) aside nav a.nav-link:hover,
body:not(.dark) aside nav .nav-link:hover {
    background-color: #f3f4f6 !important;
    color: #1f2937 !important;
}

/* Dark mode nav link colors */
body.dark aside nav a.nav-link,
body.dark aside nav .nav-link {
    color: #d1d5db !important;
    background-color: transparent !important;
}

body.dark aside nav a.nav-link:hover,
body.dark aside nav .nav-link:hover {
    background-color: #374151 !important;
    color: #ffffff !important;
}

/* Ensure SVG icons in nav are visible */
aside nav a.nav-link svg,
aside nav .nav-link svg {
    width: 1.25rem !important;
    height: 1.25rem !important;
    flex-shrink: 0 !important;
}

/* Ensure span text in nav is visible */
aside nav a.nav-link span,
aside nav .nav-link span {
    display: inline !important;
    color: inherit !important;
}

/* Modern Badge Styles */
.badge-modern {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.badge-modern:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Modern Gradient Backgrounds */
.bg-gradient-modern-blue {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 50%, #1d4ed8 100%);
}

.bg-gradient-modern-purple {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 50%, #6d28d9 100%);
}

.bg-gradient-modern-sunset {
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 50%, #dc2626 100%);
}

.bg-gradient-modern-ocean {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 50%, #0e7490 100%);
}

/* Modern Icon Container */
.icon-container-modern {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.05));
    border: 1px solid rgba(59, 130, 246, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.icon-container-modern:hover {
    transform: rotate(5deg) scale(1.1);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0.1));
    box-shadow: 0 8px 16px rgba(59, 130, 246, 0.2);
}

/* Skeleton Loading Animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.skeleton {
    animation: shimmer 2s infinite;
    background: linear-gradient(
        to right,
        rgba(226, 232, 240, 0.2) 0%,
        rgba(226, 232, 240, 0.4) 50%,
        rgba(226, 232, 240, 0.2) 100%
    );
    background-size: 1000px 100%;
}

body.dark .skeleton {
    background: linear-gradient(
        to right,
        rgba(51, 65, 85, 0.2) 0%,
        rgba(51, 65, 85, 0.4) 50%,
        rgba(51, 65, 85, 0.2) 100%
    );
}

/* Floating Animation for KPI Cards */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-float:nth-child(2) {
    animation-delay: 0.2s;
}

.animate-float:nth-child(3) {
    animation-delay: 0.4s;
}

.animate-float:nth-child(4) {
    animation-delay: 0.6s;
}

.animate-float:nth-child(5) {
    animation-delay: 0.8s;
}

/* Modern Scrollbar for all containers */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(59, 130, 246, 0.5) rgba(226, 232, 240, 0.3);
}

*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-track {
    background: rgba(226, 232, 240, 0.3);
    border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #3b82f6, #8b5cf6);
    border-radius: 999px;
    transition: background 0.2s;
}

*::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #2563eb, #7c3aed);
}

body.dark *::-webkit-scrollbar-track {
    background: rgba(51, 65, 85, 0.5);
}

/* Smooth Page Transitions */
.page-transition {
    animation: pageEnter 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modern Text Gradients */
.text-gradient-blue {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-sunset {
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Pulsing Notification Dot */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ========================================
   MODERN 2024/2025 UI ENHANCEMENTS
   ======================================== */

/* Improved Card Shadows and Depth */
.card-modern {
    position: relative;
}

.card-modern::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s;
}

.card-modern:hover::before {
    opacity: 1;
}

/* Enhanced Button States */
button,
.btn {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

button:focus-visible,
.btn:focus-visible {
    outline: 2px solid rgba(59, 130, 246, 0.5);
    outline-offset: 2px;
}

button:disabled,
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Modern Selection Styles */
::selection {
    background-color: rgba(59, 130, 246, 0.3);
    color: inherit;
}

body.dark ::selection {
    background-color: rgba(96, 165, 250, 0.3);
}

/* Enhanced Focus Rings */
*:focus-visible {
    outline: 2px solid rgba(59, 130, 246, 0.6);
    outline-offset: 2px;
    border-radius: 0.25rem;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible {
    outline-offset: 0;
}

/* Better Table Responsiveness */
@media (max-width: 768px) {
    .modern-table {
        font-size: 0.85rem;
    }
    
    .modern-table thead {
        display: none;
    }
    
    .modern-table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid rgba(226, 232, 240, 0.5);
        border-radius: 0.75rem;
        padding: 1rem;
    }
    
    body.dark .modern-table tbody tr {
        border-color: rgba(71, 85, 105, 0.5);
    }
    
    .modern-table tbody td {
        display: block;
        text-align: right;
        padding: 0.5rem;
        position: relative;
        border-bottom: none;
    }
    
    .modern-table tbody td::before {
        content: attr(data-label);
        float: left;
        font-weight: 600;
        color: #6b7280;
    }
    
    body.dark .modern-table tbody td::before {
        color: #9ca3af;
    }
}

/* Enhanced Status Pills */
.pill {
    position: relative;
}

.pill::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0.5rem;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    transform: translateY(-50%);
}

.pill.pending::before {
    background-color: #0ea5e9;
    box-shadow: 0 0 8px rgba(14, 165, 233, 0.5);
}

.pill.fulfilled::before,
.pill.approved::before {
    background-color: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.pill.rejected::before {
    background-color: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

/* Improved Loading States */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 50%;
    border-top-color: #3b82f6;
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    to { transform: rotate(360deg); }
}

/* Better Modal Animations */
.modal {
    animation: modalFadeIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-content {
    animation: modalSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(8px);
    }
}

@keyframes modalSlideUp {
    from {
        transform: translateY(30px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Enhanced Tooltips */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 0.5rem 0.75rem;
    background-color: rgba(15, 23, 42, 0.95);
    color: white;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 0.5rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 100;
}

[data-tooltip]::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: rgba(15, 23, 42, 0.95);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
}

[data-tooltip]:hover::before {
    transform: translateX(-50%) translateY(-4px);
}

/* Improved Form Validation States */
input.error,
select.error,
textarea.error {
    border-color: #ef4444 !important;
    background-color: rgba(254, 202, 202, 0.1) !important;
}

input.success,
select.success,
textarea.success {
    border-color: #10b981 !important;
    background-color: rgba(209, 250, 229, 0.1) !important;
}

body.dark input.error,
body.dark select.error,
body.dark textarea.error {
    background-color: rgba(185, 28, 28, 0.1) !important;
}

body.dark input.success,
body.dark select.success,
body.dark textarea.success {
    background-color: rgba(5, 150, 105, 0.1) !important;
}

/* Better Empty States */
.empty-state {
    padding: 4rem 2rem;
    text-align: center;
    color: #94a3b8;
}

.empty-state svg {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    opacity: 0.5;
}

body.dark .empty-state {
    color: #64748b;
}

/* Enhanced Grid Layouts */
.responsive-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

@media (max-width: 640px) {
    .responsive-grid {
        grid-template-columns: 1fr;
    }
}

/* Improved Notification Styles */
.notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    max-width: 400px;
    padding: 1rem 1.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-elevation);
    border: 1px solid var(--glass-border);
    transform: translateX(calc(100% + 2rem));
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    border-left: 4px solid #10b981;
}

.notification.error {
    border-left: 4px solid #ef4444;
}

.notification.info {
    border-left: 4px solid #3b82f6;
}

.notification.warning {
    border-left: 4px solid #f59e0b;
}

/* Better Skeleton Loaders */
.skeleton-text {
    height: 1rem;
    background: linear-gradient(90deg, 
        rgba(226, 232, 240, 0.3) 25%, 
        rgba(226, 232, 240, 0.5) 50%, 
        rgba(226, 232, 240, 0.3) 75%
    );
    background-size: 200% 100%;
    border-radius: 0.25rem;
    animation: shimmer 1.5s ease-in-out infinite;
}

body.dark .skeleton-text {
    background: linear-gradient(90deg, 
        rgba(51, 65, 85, 0.3) 25%, 
        rgba(51, 65, 85, 0.5) 50%, 
        rgba(51, 65, 85, 0.3) 75%
    );
}

/* Enhanced Dropdown Menus */
.dropdown-menu {
    transform-origin: top right;
    animation: dropdownSlide 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Better Badge Animations */
.badge-pulse {
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(59, 130, 246, 0);
    }
}

/* Improved Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Better Print Styles */
@media print {
    body {
        background: white !important;
        color: black !important;
    }
    
    .no-print,
    aside,
    button,
    .btn {
        display: none !important;
    }
    
    .glass {
        background: white !important;
        border: 1px solid #e5e7eb !important;
    }
    
    .modern-table tbody tr {
        page-break-inside: avoid;
    }
}

/* Enhanced Hover Effects for Interactive Elements */
.interactive {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.interactive:hover {
    transform: translateY(-2px);
}

.interactive:active {
    transform: translateY(0);
}

/* Better Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

@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;
    }
}

/* Enhanced Glass Effect for Modern Look */
.glass-intense {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(40px) saturate(200%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);
}

body.dark .glass-intense {
    background: rgba(15, 23, 42, 0.9);
}

/* Improved Page Header Styles */
.page-header {
    position: relative;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

.page-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, transparent);
}

/* Better Divider Styles */
.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.3), transparent);
    margin: 2rem 0;
}

body.dark .divider {
    background: linear-gradient(90deg, transparent, rgba(71, 85, 105, 0.5), transparent);
}

/* Ensure Request page text visibility in light mode */
body:not(.dark) #requests table tbody td {
    color: #1f2937 !important;
}

body:not(.dark) #requests .text-sm,
body:not(.dark) #requests label span,
body:not(.dark) #requestMessage {
    color: #374151 !important;
}

/* Ensure Request page text visibility in dark mode */
body.dark #requests table tbody td {
    color: #e5e7eb !important;
}

body.dark #requests .text-sm,
body.dark #requests label span,
body.dark #requestMessage {
    color: #d1d5db !important;
}
