/* MatchplusModern Admin Panel Styles */

/* Import Inter font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap');

/* Base styles */
* {
    font-family: 'Inter', system-ui, sans-serif;
}

/* Custom animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

@keyframes scaleIn {
    from { 
        opacity: 0;
        transform: scale(0.95);
    }
    to { 
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes glow {
    from {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
    }
    to {
        box-shadow: 0 0 40px rgba(59, 130, 246, 0.6);
    }
}

@keyframes pulseBlue {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes gradientXY {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(5deg); }
    75% { transform: rotate(-5deg); }
}

/* Animation classes */
.animate-fade-in { animation: fadeIn 0.5s ease-in-out; }
.animate-slide-up { animation: slideUp 0.3s ease-out; }
.animate-slide-down { animation: slideDown 0.3s ease-out; }
.animate-scale-in { animation: scaleIn 0.2s ease-out; }
.animate-glow { animation: glow 2s ease-in-out infinite alternate; }
.animate-pulse-blue { animation: pulseBlue 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.animate-shimmer { animation: shimmer 2s linear infinite; }
.animate-float { animation: float 3s ease-in-out infinite; }
.animate-bounce-gentle { animation: bounce 2s infinite; }
.animate-wave { animation: wave 2s ease-in-out infinite; }

/* Glass morphism effects */
.glass-morphism {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(71, 85, 105, 0.3);
}

.glass-effect {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.glass-ultra {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

/* Card styles */
.card-dark {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.9));
    border: 1px solid rgba(71, 85, 105, 0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}


.card-elevated {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
    border: 1px solid rgba(148, 163, 184, 0.15);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.card-floating {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.9));
    border: 1px solid rgba(148, 163, 184, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Glow effects */
.neon-glow { box-shadow: 0 0 20px rgba(59, 130, 246, 0.3); }
.neon-glow-strong { box-shadow: 0 0 30px rgba(59, 130, 246, 0.5), 0 0 60px rgba(59, 130, 246, 0.2); }
.glow-green { box-shadow: 0 0 20px rgba(16, 185, 129, 0.3); }
.glow-red { box-shadow: 0 0 20px rgba(239, 68, 68, 0.3); }
.glow-purple { box-shadow: 0 0 20px rgba(139, 92, 246, 0.3); }
.glow-teal { box-shadow: 0 0 20px rgba(6, 182, 212, 0.3); }
.glow-orange { box-shadow: 0 0 20px rgba(249, 115, 22, 0.3); }
.glow-pink { box-shadow: 0 0 20px rgba(236, 72, 153, 0.3); }
.glow-yellow { box-shadow: 0 0 20px rgba(245, 158, 11, 0.3); }

/* Text effects */
.text-glow { text-shadow: 0 0 10px rgba(255, 255, 255, 0.5); }
.text-glow-blue { text-shadow: 0 0 15px rgba(59, 130, 246, 0.8); }
.text-glow-green { text-shadow: 0 0 15px rgba(16, 185, 129, 0.8); }
.text-glow-purple { text-shadow: 0 0 15px rgba(139, 92, 246, 0.8); }

.text-shimmer {
    background: linear-gradient(90deg, #94a3b8, #e2e8f0, #94a3b8);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 2s ease-in-out infinite;
}

/* Scrollbar styles */
.custom-scrollbar::-webkit-scrollbar { width: 6px; }
.custom-scrollbar::-webkit-scrollbar-track { 
    background: rgba(30, 41, 59, 0.5); 
    border-radius: 3px; 
}
.custom-scrollbar::-webkit-scrollbar-thumb { 
    background: linear-gradient(45deg, #3b82f6, #8b5cf6);
    border-radius: 3px; 
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover { 
    background: linear-gradient(45deg, #2563eb, #7c3aed);
}

/* Button hover effects */
.btn-hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.btn-hover-glow:hover {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.6);
}

.btn-hover-scale:hover {
    transform: scale(1.05);
}

/* Form focus effects */
.form-focus {
    transition: all 0.2s ease;
}

.form-focus:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Loading effects */
.skeleton {
    background: linear-gradient(90deg, rgba(30, 41, 59, 0.8) 25%, rgba(51, 65, 85, 0.8) 50%, rgba(30, 41, 59, 0.8) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.loading-spinner {
    border: 3px solid rgba(59, 130, 246, 0.3);
    border-radius: 50%;
    border-top: 3px solid #3b82f6;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Progress bars */
.progress-bar {
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    background-size: 200% 100%;
    animation: gradientXY 2s ease infinite;
}

/* Gradient borders */
.gradient-border {
    position: relative;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.9));
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 2px;
    background: linear-gradient(45deg, #3b82f6, #8b5cf6, #06b6d4);
    border-radius: inherit;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: xor;
    -webkit-mask-composite: xor;
}

.gradient-border-animated {
    position: relative;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.9));
}

.gradient-border-animated::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 2px;
    background: linear-gradient(45deg, #3b82f6, #8b5cf6, #06b6d4, #10b981, #f97316, #3b82f6);
    background-size: 300% 300%;
    border-radius: inherit;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: xor;
    -webkit-mask-composite: xor;
    animation: gradientXY 4s ease infinite;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: #374151;
    border-radius: 12px;
    transition: background 0.2s ease;
    cursor: pointer;
}

.toggle-switch.active {
    background: #3b82f6;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-switch.active::after {
    transform: translateX(20px);
}

/* Tooltip */
.tooltip {
    position: relative;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.95);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    margin-bottom: 4px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    z-index: 1000;
}

.tooltip:hover::before {
    opacity: 1;
}

/* Special Effects */
.holographic {
    background: linear-gradient(45deg, transparent 30%, rgba(59, 130, 246, 0.1) 50%, transparent 70%);
    background-size: 200% 200%;
    animation: gradientXY 3s ease infinite;
}

.perspective-tilt {
    transform-style: preserve-3d;
    transition: transform 0.2s ease;
}

.perspective-tilt:hover {
    transform: perspective(1000px) rotateX(5deg) rotateY(5deg);
}

/* Background patterns */
.bg-pattern {
    background-image: 
        radial-gradient(at 40% 20%, rgba(59, 130, 246, 0.1) 0px, transparent 50%),
        radial-gradient(at 80% 0%, rgba(139, 92, 246, 0.1) 0px, transparent 50%),
        radial-gradient(at 0% 50%, rgba(14, 165, 233, 0.1) 0px, transparent 50%);
}

/* Table hover effects */
.table-hover tbody tr {
    transition: background-color 0.2s ease;
}

.table-hover tbody tr:hover {
    background-color: rgba(59, 130, 246, 0.1);
}

/* Modal backdrop */
.modal-backdrop {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

/* Ensure modals appear above everything */
/* Target all modal containers with fixed positioning and backdrop */
.fixed.inset-0.bg-black,
.fixed.inset-0[class*="bg-black"],
.fixed.inset-0[class*="bg-opacity"] {
    z-index: 9999 !important; /* Ensure modals are always on top */
}

/* Ensure any element with fixed inset-0 that contains a modal-like structure is on top */
div.fixed.inset-0:has(div[class*="bg-slate-800"][class*="rounded"]),
div.fixed.inset-0:has(div[class*="rounded-2xl"][class*="shadow"]) {
    z-index: 9999 !important;
}

/* Override any lower z-index values on modals - but only for fixed positioned elements */
.fixed[class*="z-50"],
.fixed[class*="z-[70]"],
.fixed[class*="z-[9999]"] {
    position: fixed !important;
}

/* Ensure dropdown menus (absolute positioned) have proper z-index but keep absolute positioning */
.absolute[class*="z-50"],
.absolute[class*="z-[70]"],
.absolute[class*="z-[100]"] {
    z-index: 100 !important; /* Dropdowns should be above content but below modals */
    position: absolute !important; /* Keep absolute positioning for dropdowns - CRITICAL */
}

/* Ensure parent containers of dropdowns have relative positioning */
.relative {
    position: relative !important; /* Ensure dropdowns position relative to their parent */
}

/* Ensure modals are above headers (z-30), sticky headers (z-20), and all content */
header.glass-morphism {
    z-index: 30 !important; /* Keep header below modals */
}

.sticky-table-header {
    z-index: 20 !important; /* Keep sticky headers below modals */
}

/* Ensure scroll-to-top button is always visible above everything except modals */
/* Use maximum specificity and highest z-index */
html body #scrollToTopBtn,
body #scrollToTopBtn,
#scrollToTopBtn {
    z-index: 2147483647 !important; /* Maximum z-index */
    position: fixed !important;
    isolation: isolate !important; /* Create new stacking context */
    transform: translateZ(0) !important; /* Force hardware acceleration and new stacking context */
    will-change: transform !important; /* Optimize for rendering */
    contain: layout style paint !important; /* Isolate rendering */
}

/* Override any table or container z-index */
.bg-slate-800,
.bg-slate-800\/50,
.card-dark,
table,
thead,
tbody,
tr,
td,
th {
    z-index: auto !important; /* Ensure tables don't create high z-index stacking contexts */
}

/* Ensure table containers don't interfere */
.bg-slate-800:has(table),
.bg-slate-800\/50:has(table),
.card-dark:has(table) {
    z-index: auto !important;
    isolation: auto !important;
    transform: none !important;
}

/* Drag and drop zone */
.drag-zone {
    border: 2px dashed #475569;
    background: rgba(30, 41, 59, 0.4);
    transition: all 0.3s ease;
}

.drag-zone:hover {
    border-color: #3b82f6;
    background-color: rgba(59, 130, 246, 0.1);
}

.drag-zone.drag-over {
    border-color: #3b82f6;
    background-color: rgba(59, 130, 246, 0.2);
    transform: scale(1.02);
}

/* Code block */
.code-block {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.2);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* Status indicators */
.status-online { 
    background-color: #10b981; 
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}
.status-offline { 
    background-color: #ef4444; 
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}
.status-away { 
    background-color: #f59e0b; 
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}
.status-busy { 
    background-color: #8b5cf6; 
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

/* Notification styles */
.notification {
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    margin-bottom: 0.75rem;
    width: 420px; /* Fixed width for consistency */
    word-wrap: break-word;
}

/* Responsive notification width for mobile */
@media (max-width: 640px) {
    .notification {
        width: calc(100vw - 2rem); /* Full width minus padding on mobile */
        max-width: 420px;
    }
    
    #toast-container {
        left: 1rem !important;
        right: 1rem !important;
        transform: none !important;
    }
}

.notification-success {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(16, 185, 129, 0.3);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 0 15px -3px rgba(16, 185, 129, 0.2);
}

.notification-success i {
    color: #10b981 !important;
}

.notification-error {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(239, 68, 68, 0.3);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 0 15px -3px rgba(239, 68, 68, 0.2);
}

.notification-error i {
    color: #ef4444 !important;
}

.notification-warning {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(245, 158, 11, 0.3);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 0 15px -3px rgba(245, 158, 11, 0.2);
}

.notification-warning i {
    color: #f59e0b !important;
}

.notification-info {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(59, 130, 246, 0.3);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 0 15px -3px rgba(59, 130, 246, 0.2);
}

.notification-info i {
    color: #3b82f6 !important;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .main-content.sidebar-open {
        margin-left: 256px;
    }
}

@media (max-width: 768px) {
    .glass-morphism,
    .glass-effect,
    .glass-ultra {
        backdrop-filter: blur(10px);
    }
    
    .card-dark {
        margin: 0.5rem;
    }
    
    .main-content.sidebar-open {
        margin-left: 0;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-break-before {
        page-break-before: always;
    }
    
    .print-break-after {
        page-break-after: always;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .card-dark,
    .glass-morphism,
    .glass-effect {
        background: white !important;
        border: 1px solid #ccc !important;
        box-shadow: none !important;
    }
}

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

/* Focus visible for keyboard navigation */
.focus-visible:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card-dark {
        border: 2px solid #ffffff;
    }
    
    .text-slate-400 {
        color: #ffffff !important;
    }
    
    .text-slate-300 {
        color: #ffffff !important;
    }
}

/* Hover submenu stability improvements */
.group[data-sidebar-size="sm"] .group\/sm {
    position: relative;
}

/* Create invisible hover bridge for smoother UX */
.group[data-sidebar-size="sm"] .group\/sm::before {
    content: '';
    position: absolute;
    top: 0;
    right: -12px;
    width: 12px;
    height: 100%;
    background: transparent;
    z-index: 51;
    pointer-events: auto;
}

/* Submenu hover improvements */
.hover-submenu {
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
    transform-origin: left center;
}

/* Add slight delay before hiding submenu */
.group[data-sidebar-size="sm"] .group\/sm:not(:hover) .hover-submenu {
    transition-delay: 200ms;
}

/* Smooth animation when showing */
.group[data-sidebar-size="sm"] .group\/sm:hover .hover-submenu {
    animation: slideInSubmenu 0.25s ease-out;
}

@keyframes slideInSubmenu {
    from {
        opacity: 0;
        transform: translateX(-8px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* Invisible scrollbar - scrolling works but no visual scrollbar */
.custom-scrollbar {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.custom-scrollbar::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* Dark mode overrides (if needed) */
@media (prefers-color-scheme: dark) {
    /* Additional dark mode specific styles can go here */
}

/* Sticky Table Headers */
/* Calculate header height dynamically via CSS custom property (set by JavaScript) */
:root {
    --header-height: 64px; /* Default fallback, will be updated by JavaScript */
}

.sticky-table-header {
    position: -webkit-sticky !important; /* Safari support - force sticky */
    position: sticky !important; /* Force sticky positioning */
    top: var(--header-height, 64px) !important; /* Stick below the main header - dynamically calculated */
    z-index: 20 !important; /* Below main header (z-30) but above content */
    background: rgba(51, 65, 85, 0.98) !important; /* slate-700/98 with backdrop - important to override any inline styles */
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border-bottom: 1px solid rgba(100, 116, 139, 0.4) !important; /* slate-500/40 */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2) !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    /* Ensure sticky works relative to viewport, not a container */
    will-change: transform; /* Optimize for sticky positioning */
    /* Force the header to be part of the table flow */
    display: table-header-group !important;
}

.sticky-table-header th {
    background: rgba(51, 65, 85, 0.98) !important; /* Ensure each cell has background - important to override */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: relative;
    border-bottom: none; /* Remove any border that might interfere */
}

/* CRITICAL: Fix sticky table headers */
/* The issue: Any parent with overflow breaks position: sticky */
/* Solution: Ensure all parents allow sticky to work relative to viewport */

/* Ensure table containers and all parents don't have overflow that breaks sticky */
.bg-slate-800.rounded-xl,
.bg-slate-800\/50.rounded-xl,
.bg-slate-800\/50.backdrop-blur-sm.rounded-xl,
.card-dark.rounded-2xl,
.bg-slate-800,
.bg-slate-800\/50 {
    overflow: visible !important; /* Critical: Remove any overflow that breaks sticky */
}

/* Ensure main content area doesn't interfere */
main,
#main-content,
.main-content-responsive {
    overflow: visible !important; /* Allow sticky to work relative to viewport */
    position: relative;
}

/* Ensure no intermediate containers break sticky */
/* Target containers that might have sticky headers */
div.bg-slate-800:has(table thead.sticky-table-header),
div.bg-slate-800\/50:has(table thead.sticky-table-header),
div.card-dark:has(table thead.sticky-table-header) {
    overflow: visible !important;
}

/* Also ensure direct children don't break sticky */
div.bg-slate-800 > div.overflow-x-auto,
div.bg-slate-800\/50 > div.overflow-x-auto,
div.card-dark > div.overflow-x-auto {
    overflow-y: visible !important;
}

/* Apply rounded corners and proper overflow to the inner scrollable container */
.overflow-x-auto.rounded-xl {
    border-radius: 0.75rem; /* rounded-xl */
    overflow-x: auto;
    overflow-y: visible !important; /* Critical: Don't create vertical scroll context */
    /* This allows sticky headers to work relative to viewport scroll */
}

.overflow-x-auto.rounded-2xl {
    border-radius: 1rem; /* rounded-2xl */
    overflow-x: auto;
    overflow-y: visible !important; /* Critical: Don't create vertical scroll context */
}

/* Ensure first and last rows have rounded corners for visual consistency */
.overflow-x-auto.rounded-xl table tbody tr:first-child td:first-child {
    border-top-left-radius: 0.75rem;
}

.overflow-x-auto.rounded-xl table tbody tr:first-child td:last-child {
    border-top-right-radius: 0.75rem;
}

.overflow-x-auto.rounded-xl table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 0.75rem;
}

.overflow-x-auto.rounded-xl table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 0.75rem;
}

.overflow-x-auto.rounded-2xl table tbody tr:first-child td:first-child {
    border-top-left-radius: 1rem;
}

.overflow-x-auto.rounded-2xl table tbody tr:first-child td:last-child {
    border-top-right-radius: 1rem;
}

.overflow-x-auto.rounded-2xl table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 1rem;
}

.overflow-x-auto.rounded-2xl table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 1rem;
}

/* Ensure table container structure allows sticky to work */
/* The overflow-x-auto should only affect horizontal scrolling, not vertical sticky */
.overflow-x-auto {
    position: relative;
    overflow-y: visible !important; /* Don't create vertical scrolling context - CRITICAL */
    overflow-x: auto; /* Allow horizontal scrolling */
    /* This is the key: overflow-x-auto for horizontal scroll, but overflow-y: visible for sticky */
}

/* Ensure tables themselves don't interfere with sticky */
table {
    position: relative;
}

/* CRITICAL FIX: Ensure ALL parent containers of sticky headers allow viewport scrolling */
/* This is a catch-all rule that targets any container that might have a sticky header */
div:has(thead.sticky-table-header),
div:has(.sticky-table-header) {
    overflow: visible !important;
    overflow-y: visible !important;
    overflow-x: visible !important;
}

/* Also target the parent of the container */
div:has(thead.sticky-table-header) > div,
div:has(.sticky-table-header) > div {
    overflow-y: visible !important;
}

/* Ensure the table wrapper divs don't create scroll contexts */
div.bg-slate-800:has(table),
div.bg-slate-800\/50:has(table),
div.card-dark:has(table) {
    overflow: visible !important;
    overflow-y: visible !important;
}

/* When scrolling, add subtle border to sticky header */
.sticky-table-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(100, 116, 139, 0.5), transparent);
    pointer-events: none;
}

/* Ensure sticky headers work in tables with border-separate */
table.border-separate .sticky-table-header th {
    background: rgba(51, 65, 85, 0.98) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Ensure main content area allows proper sticky positioning */
main {
    position: relative;
    overflow: visible !important; /* Critical: Don't create scrolling context */
}

/* Make sure the main content div doesn't interfere */
#main-content {
    position: relative;
    overflow: visible !important; /* Critical: Don't create scrolling context */
}

/* Ensure body and html don't interfere with sticky */
html, body {
    overflow-x: hidden; /* Prevent horizontal scroll */
    overflow-y: auto; /* Allow vertical scroll - this is the scrolling container for sticky */
    position: relative;
}

/* Critical: Ensure all parent containers up to body allow sticky to work */
#app {
    position: relative;
    overflow: visible !important;
}

/* Ensure Vue app container doesn't break sticky */
#app > div {
    position: relative;
    overflow: visible !important;
}
