/**
 * Main Stylesheet
 * Modern Design with Glassmorphism - Dark Theme
 */

:root {
    --primary-gradient: linear-gradient(135deg, #0a0a1a 0%, #1a1a2e 50%, #0f1419 100%);
    --secondary-gradient: linear-gradient(135deg, #0f0c29 0%, #1a1a2e 50%, #0a0a1a 100%);
    --bg-gradient: linear-gradient(135deg, #050510 0%, #0a0a1a 25%, #1a1a2e 50%, #0f1419 75%, #050510 100%);
    --glass-bg: rgba(20, 20, 35, 0.75);
    --glass-border: rgba(255, 255, 255, 0.12);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.85);
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
    --border-radius: 15px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #050510;
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}


/* Premium Animated Background */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: #050510;
    background-image: 
        linear-gradient(180deg, rgba(5, 5, 16, 0.95) 0%, rgba(10, 10, 26, 0.9) 50%, rgba(5, 5, 16, 0.95) 100%),
        radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.05) 0%, transparent 70%);
}

/* Base gradient layer with premium colors */
.animated-bg::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.18) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(59, 130, 246, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 60% 20%, rgba(168, 85, 247, 0.1) 0%, transparent 50%),
        linear-gradient(135deg, rgba(15, 23, 42, 0.9) 0%, rgba(30, 41, 59, 0.7) 50%, rgba(15, 23, 42, 0.9) 100%);
    animation: premiumGradientShift 35s ease infinite;
    background-size: 200% 200%;
}

/* Premium mesh overlay */
.animated-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at top left, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
        radial-gradient(ellipse at top right, rgba(139, 92, 246, 0.1) 0%, transparent 40%),
        radial-gradient(ellipse at bottom left, rgba(59, 130, 246, 0.08) 0%, transparent 40%),
        radial-gradient(ellipse at bottom right, rgba(168, 85, 247, 0.1) 0%, transparent 40%),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 1px,
            rgba(255, 255, 255, 0.015) 1px,
            rgba(255, 255, 255, 0.015) 2px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 1px,
            rgba(255, 255, 255, 0.015) 1px,
            rgba(255, 255, 255, 0.015) 2px
        );
    animation: premiumMeshMove 45s ease infinite;
    opacity: 0.7;
}

/* Premium gradient animation */
@keyframes premiumGradientShift {
    0% {
        background-position: 0% 0%;
        transform: rotate(0deg);
    }
    33% {
        background-position: 100% 50%;
        transform: rotate(120deg);
    }
    66% {
        background-position: 50% 100%;
        transform: rotate(240deg);
    }
    100% {
        background-position: 0% 0%;
        transform: rotate(360deg);
    }
}

/* Premium mesh animation */
@keyframes premiumMeshMove {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.7;
    }
    25% {
        transform: translate(2%, -2%) scale(1.02);
        opacity: 0.8;
    }
    50% {
        transform: translate(-1%, 2%) scale(0.98);
        opacity: 0.6;
    }
    75% {
        transform: translate(1%, 1%) scale(1.01);
        opacity: 0.75;
    }
}

/* Premium overlay for extra depth */
.premium-bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        conic-gradient(from 0deg at 50% 50%, 
            transparent 0deg,
            rgba(99, 102, 241, 0.04) 60deg,
            transparent 120deg,
            rgba(139, 92, 246, 0.04) 180deg,
            transparent 240deg,
            rgba(59, 130, 246, 0.04) 300deg,
            transparent 360deg
        );
    animation: premiumRotate 60s linear infinite;
    opacity: 0.5;
    mix-blend-mode: overlay;
}

@keyframes premiumRotate {
    0% {
        transform: rotate(0deg) scale(1);
    }
    50% {
        transform: rotate(180deg) scale(1.1);
    }
    100% {
        transform: rotate(360deg) scale(1);
    }
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem 0;
    position: relative;
    z-index: 1;
}

/* Glassmorphism Cards */
.glass-card {
    background: rgba(20, 20, 35, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    transition: var(--transition);
    color: #ffffff;
    overflow: visible !important;
}

/* Prevent text truncation in summary cards */
.glass-card > div:first-child span {
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
    word-break: normal !important;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.25);
}

/* Modern Navigation Bar */
.navbar-modern {
    background: rgba(20, 20, 35, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3),
                0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    position: relative;
    z-index: 1000;
}

.navbar-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.2) 50%, 
        transparent 100%);
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
    position: relative;
}

/* Logo */
.navbar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: white;
    font-weight: 700;
    font-size: 1.25rem;
    transition: all 0.3s ease;
    z-index: 10;
}

.navbar-logo:hover {
    transform: translateY(-1px);
    opacity: 0.9;
}

.navbar-logo-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(100, 150, 255, 0.2), rgba(150, 100, 255, 0.2));
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.navbar-logo:hover .navbar-logo-icon {
    transform: scale(1.05) rotate(2deg);
    box-shadow: 0 6px 20px rgba(100, 150, 255, 0.3);
}

.navbar-logo-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.navbar-logo-text {
    background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.9) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Desktop Navigation Links */
.navbar-nav-desktop {
    display: none;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    justify-content: center;
    margin: 0 2rem;
}

@media (min-width: 768px) {
    .navbar-nav-desktop {
        display: flex;
    }
}

.navbar-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.navbar-link::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(100, 150, 255, 0.1), rgba(150, 100, 255, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.navbar-link:hover {
    color: white;
    transform: translateY(-1px);
}

.navbar-link:hover::before {
    opacity: 1;
}

.navbar-link-active {
    color: white;
    background: linear-gradient(135deg, rgba(100, 150, 255, 0.15), rgba(150, 100, 255, 0.15));
    box-shadow: 0 2px 10px rgba(100, 150, 255, 0.2);
}

.navbar-link-active::before {
    opacity: 1;
}

.navbar-link-icon {
    font-size: 1.125rem;
    transition: transform 0.3s ease;
}

.navbar-link:hover .navbar-link-icon {
    transform: scale(1.1);
}

.navbar-link-indicator {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: linear-gradient(135deg, #64a5ff, #9a64ff);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(100, 165, 255, 0.8);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: translateX(-50%) scale(1); }
    50% { opacity: 0.7; transform: translateX(-50%) scale(1.2); }
}

/* User Menu */
.navbar-user-container {
    position: relative;
    z-index: 100;
}

.navbar-user-button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem 0.5rem 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.navbar-user-button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.navbar-user-avatar {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(100, 150, 255, 0.2), rgba(150, 100, 255, 0.2));
    border-radius: 10px;
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
}

.navbar-user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.125rem;
}

.navbar-user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
    line-height: 1.2;
}

.navbar-user-role {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.2;
}

.navbar-user-chevron {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    transition: transform 0.3s ease;
}

.navbar-user-container.active .navbar-user-chevron {
    transform: rotate(180deg);
}

.navbar-user-dropdown {
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 0;
    width: 280px;
    background: rgba(20, 20, 35, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4),
                0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar-user-dropdown.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.navbar-user-dropdown-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, rgba(100, 150, 255, 0.1), rgba(150, 100, 255, 0.1));
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar-user-dropdown-avatar {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(100, 150, 255, 0.2), rgba(150, 100, 255, 0.2));
    border-radius: 12px;
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.9);
    flex-shrink: 0;
}

.navbar-user-dropdown-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.25rem;
}

.navbar-user-dropdown-email {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.6);
}

.navbar-user-dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0.5rem 0;
}

.navbar-user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.navbar-user-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border-left-color: rgba(100, 150, 255, 0.5);
    padding-left: 1.5rem;
}

.navbar-user-dropdown-item i {
    font-size: 1.125rem;
    width: 20px;
    text-align: center;
}

.navbar-user-dropdown-item-danger {
    color: rgba(255, 107, 107, 0.9);
}

.navbar-user-dropdown-item-danger:hover {
    background: rgba(255, 107, 107, 0.1);
    border-left-color: rgba(255, 107, 107, 0.5);
    color: #ff6b6b;
}

/* Mobile Menu Toggle */
.navbar-mobile-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 10000;
    position: relative;
}

@media (min-width: 768px) {
    .navbar-mobile-toggle {
        display: none;
    }
}

.navbar-mobile-toggle-line {
    width: 100%;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.navbar-mobile-toggle.active .navbar-mobile-toggle-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.navbar-mobile-toggle.active .navbar-mobile-toggle-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.navbar-mobile-toggle.active .navbar-mobile-toggle-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Menu */
.navbar-mobile-menu {
    position: fixed !important;
    top: 72px !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: calc(100vh - 72px) !important;
    background: rgba(20, 20, 35, 0.98) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    z-index: 9999 !important;
    transform: translateX(-100%) !important;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    overflow-y: auto !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    display: block !important;
}

.navbar-mobile-menu.show {
    transform: translateX(0) !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, visibility 0s linear 0s !important;
}

.navbar-mobile-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.navbar-mobile-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
}

.navbar-mobile-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    transform: translateX(4px);
}

.navbar-mobile-link-active {
    background: linear-gradient(135deg, rgba(100, 150, 255, 0.15), rgba(150, 100, 255, 0.15));
    color: white;
    box-shadow: 0 2px 10px rgba(100, 150, 255, 0.2);
}

.navbar-mobile-link i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

.navbar-mobile-link-check {
    margin-left: auto;
    color: rgba(100, 150, 255, 0.8);
    font-size: 1.125rem;
}

.navbar-mobile-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 1rem 0;
}

.navbar-mobile-link-danger {
    color: rgba(255, 107, 107, 0.9);
}

.navbar-mobile-link-danger:hover {
    background: rgba(255, 107, 107, 0.1);
    color: #ff6b6b;
}

.footer-glass {
    @apply backdrop-blur-[20px] bg-[rgba(30,30,50,0.7)] border-t border-[rgba(255,255,255,0.1)];
}

/* Mobile Card Styles for Management Page */
.mobile-card-entry {
    transition: all 0.3s ease;
    margin-bottom: 1.5rem !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4),
                0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    position: relative;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.mobile-card-entry:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: -0.75rem;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.2) 20%, 
        rgba(255, 255, 255, 0.2) 80%, 
        transparent 100%);
}

.mobile-card-entry:active {
    transform: scale(0.98);
}

.mobile-card-entry:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(255, 255, 255, 0.15) inset;
    border-color: rgba(255, 255, 255, 0.35);
    transform: translateY(-2px);
}

@media (max-width: 767px) {
    /* Make buttons more touch-friendly on mobile */
    .btn-glass,
    .btn-primary-glass,
    .btn-danger-glass {
        min-height: 44px;
        font-size: 1rem;
    }
    
    /* Improve modal inputs on mobile */
    input[type="text"],
    input[type="tel"],
    textarea {
        font-size: 16px !important; /* Prevents zoom on iOS */
    }
    
    /* Show mobile cards, hide desktop table on mobile */
    #mobileCardsContainer {
        display: block !important;
    }
    
    .desktop-table-container {
        display: none !important;
    }
    
    .overflow-x-auto table {
        display: none !important;
    }
}

@media (min-width: 768px) {
    /* Show desktop table, hide mobile cards on desktop */
    #mobileCardsContainer {
        display: none !important;
    }
    
    .desktop-table-container {
        display: block !important;
    }
    
    .overflow-x-auto table {
        display: table !important;
    }
}

/* Search input spacing fix */
#searchInput {
    padding-left: 3rem !important;
}

@media (min-width: 768px) {
    #searchInput {
        padding-left: 2.75rem !important;
    }
}

/* Dropdown Menu */
.dropdown-menu {
    background: rgba(20, 20, 35, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
}

.dropdown-item {
    color: var(--text-primary);
    transition: var(--transition);
}

.dropdown-item:hover {
    background: rgba(40, 40, 60, 0.8);
    color: var(--text-primary);
}

/* Tables - Polished Design with Dark Theme */
.table-container,
.desktop-table-container {
    background: rgba(15, 15, 25, 0.95) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.8),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    margin: 2rem 0;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    position: relative;
    display: block !important;
}

.table-container .table-responsive {
    background: transparent !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.table-container .table-responsive::-webkit-scrollbar {
    height: 8px;
}

.table-container .table-responsive::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.table-container .table-responsive::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.table-container .table-responsive::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.table-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.4) 50%, 
        transparent
    );
    z-index: 1;
}

/* Override Bootstrap table styles completely */
.table,
table {
    margin-bottom: 0 !important;
    color: #ffffff !important;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    background: transparent !important;
    width: 100% !important;
    table-layout: fixed !important;
}

/* Remove Bootstrap's default table styling */
.table > *,
table > * {
    background: transparent !important;
}

.table thead,
table thead {
    display: table-header-group !important;
}

.table tbody,
table tbody {
    display: table-row-group !important;
}

.table tr,
table tr {
    display: table-row !important;
}

/* Allow rows to be hidden for search functionality */
.table tr.search-hidden,
table tr.search-hidden,
tbody tr.search-hidden {
    display: none !important;
}

.table th,
table th,
.table td,
table td {
    display: table-cell !important;
}

/* CRITICAL: Ensure all table cells are visible and properly sized */
.table thead th,
table thead th {
    display: table-cell !important;
    visibility: visible !important;
    width: auto !important;
}

.table tbody td,
table tbody td {
    display: table-cell !important;
    visibility: visible !important;
    width: auto !important;
}

.table * {
    color: inherit;
}

.table-responsive {
    background: transparent !important;
}

.table thead {
    background: linear-gradient(135deg, 
        rgba(25, 25, 40, 1) 0%, 
        rgba(20, 20, 35, 1) 100%) !important;
    backdrop-filter: blur(10px);
    position: relative;
}

.table thead::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.5) 50%, 
        transparent
    );
}

.table thead th,
table thead th {
    border: none !important;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1.2px;
    padding: 1.25rem 1rem !important;
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    background: transparent !important;
    vertical-align: middle !important;
    white-space: nowrap;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table thead th i {
    display: inline-block;
    width: 18px;
    text-align: center;
    margin-right: 0.5rem;
    vertical-align: middle;
    flex-shrink: 0;
}

.table thead th.column1 {
    padding-left: 1.5rem !important;
}

.table thead th.column6 {
    padding-right: 1.5rem !important;
}

.table tbody {
    background: rgba(18, 18, 28, 0.95) !important;
}

.table tbody tr {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    background: transparent !important;
}

.table tbody tr:last-child {
    border-bottom: none;
}

.table tbody tr::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, 
        rgba(255, 255, 255, 0.3) 0%, 
        transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.table tbody tr:hover {
    background: rgba(35, 35, 55, 1) !important;
    transform: translateX(5px);
    box-shadow: 
        -5px 0 15px rgba(0, 0, 0, 0.5),
        inset 0 0 20px rgba(100, 150, 255, 0.15);
}

.table tbody tr:hover::before {
    opacity: 1;
}

.table tbody tr:nth-child(even) {
    background: rgba(22, 22, 32, 0.95) !important;
}

.table tbody tr:nth-child(even):hover {
    background: rgba(40, 40, 60, 1) !important;
}

.table tbody td,
table tbody td {
    padding: 1.25rem 1rem !important;
    vertical-align: middle !important;
    font-size: 0.95rem;
    color: #e0e0e0 !important;
    border: none !important;
    position: relative;
    background: transparent !important;
    text-align: left;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
}

.table tbody td.column1,
table tbody td.column1 {
    padding-left: 1.5rem !important;
    padding-right: 1rem !important;
    font-weight: 600;
    color: #ffffff !important;
    width: 260px !important;
    min-width: 260px !important;
    max-width: 260px !important;
    display: table-cell !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.table tbody td.column1 strong,
table tbody td.column1 strong {
    color: #ffffff !important;
    display: inline !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.table tbody td.column2,
table tbody td.column2 {
    width: 200px !important;
    min-width: 200px !important;
    max-width: 200px !important;
}

.table tbody td.column3,
table tbody td.column3 {
    width: 140px !important;
    min-width: 140px !important;
    max-width: 140px !important;
}

.table tbody td.column4,
table tbody td.column4 {
    width: 150px !important;
    min-width: 150px !important;
    max-width: 150px !important;
    text-align: center !important;
}

.table tbody td.column5,
table tbody td.column5 {
    width: 150px !important;
    min-width: 150px !important;
    max-width: 150px !important;
    text-align: center !important;
}

.table tbody td.column6,
table tbody td.column6 {
    padding-right: 1.5rem !important;
    width: auto !important;
    min-width: 200px !important;
}

.table tbody td:last-child {
    padding-right: 1.5rem !important;
}

/* Ensure badges align properly */
.table tbody td .badge-payment,
.table tbody td .badge-debt,
.table tbody td .badge-glass {
    display: inline-block;
    vertical-align: middle;
    white-space: nowrap;
}

.table tbody td strong {
    font-weight: 600;
    color: #ffffff !important;
}

/* Status Badges - Softer Colors */
.badge-debt,
.badge-debt * {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

.badge-payment,
.badge-payment * {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

.badge-debt {
    background: rgba(220, 100, 100, 0.9);
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.875rem;
    box-shadow: 
        0 2px 8px rgba(220, 100, 100, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    display: inline-block;
    transition: all 0.3s ease;
    border: 1px solid rgba(200, 80, 80, 0.5);
}

.badge-debt:hover {
    background: rgba(230, 110, 110, 0.95);
    transform: translateY(-1px);
    box-shadow: 
        0 4px 12px rgba(220, 100, 100, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.badge-payment {
    background: rgba(120, 150, 150, 0.8);
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.875rem;
    box-shadow: 
        0 2px 8px rgba(120, 150, 150, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    display: inline-block;
    transition: all 0.3s ease;
    border: 1px solid rgba(100, 130, 130, 0.5);
}

.badge-payment:hover {
    background: rgba(130, 160, 160, 0.85);
    transform: translateY(-1px);
    box-shadow: 
        0 4px 12px rgba(120, 150, 150, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.badge-glass {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    color: rgba(255, 255, 255, 0.9);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-weight: 500;
    font-size: 0.875rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: inline-block;
}

/* Footer */
.footer-glass {
    background: rgba(20, 20, 35, 0.9);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

/* Table Scrollbar Styling */
.table-responsive {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) rgba(255, 255, 255, 0.1);
}

.table-responsive::-webkit-scrollbar {
    height: 10px;
    width: 10px;
}

.table-responsive::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin: 0 1rem;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    transition: background 0.3s ease;
    border: 2px solid rgba(15, 15, 25, 0.5);
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Fix alignment issues with table-responsive */
.table-responsive table {
    margin-bottom: 0;
}

/* Column-specific styling to match old implementation exactly */
/* Force first column to be visible and properly sized */
.table thead th.column1,
table thead th.column1 {
    width: 260px !important;
    min-width: 260px !important;
    max-width: 260px !important;
    padding-left: 1.5rem !important;
    padding-right: 1rem !important;
    box-sizing: border-box !important;
    display: table-cell !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
}

.table tbody td.column1,
table tbody td.column1 {
    width: 260px !important;
    min-width: 260px !important;
    max-width: 260px !important;
    padding-left: 1.5rem !important;
    padding-right: 1rem !important;
    box-sizing: border-box !important;
    display: table-cell !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    background: transparent !important;
}

.table .column2,
table .column2,
.table thead th.column2,
table thead th.column2,
.table tbody td.column2,
table tbody td.column2 {
    width: 200px !important;
    min-width: 200px !important;
    max-width: 200px !important;
    box-sizing: border-box !important;
}

.table .column3,
table .column3,
.table thead th.column3,
table thead th.column3,
.table tbody td.column3,
table tbody td.column3 {
    width: 140px !important;
    min-width: 140px !important;
    max-width: 140px !important;
    box-sizing: border-box !important;
}

.table .column4,
table .column4,
.table thead th.column4,
table thead th.column4,
.table tbody td.column4,
table tbody td.column4 {
    width: 150px !important;
    min-width: 150px !important;
    max-width: 150px !important;
    text-align: center !important;
    box-sizing: border-box !important;
}

.table .column5,
table .column5,
.table thead th.column5,
table thead th.column5,
.table tbody td.column5,
table tbody td.column5 {
    width: 150px !important;
    min-width: 150px !important;
    max-width: 150px !important;
    text-align: center !important;
    box-sizing: border-box !important;
}

.table .column6,
table .column6,
.table thead th.column6,
table thead th.column6,
.table tbody td.column6,
table tbody td.column6 {
    width: auto !important;
    min-width: 200px !important;
    box-sizing: border-box !important;
}

/* Additional Table Enhancements */
.table tbody tr {
    border-left: 3px solid transparent;
}

.table tbody tr:hover {
    border-left-color: rgba(100, 150, 255, 0.5);
}

/* Ensure table cells don't wrap unnecessarily */
.table tbody td {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.table tbody td:first-child,
table tbody td:first-child {
    white-space: nowrap;
    display: table-cell !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Responsive Table */
@media (max-width: 1200px) {
    #residents-table colgroup col:nth-child(1) { width: 200px !important; }
    #residents-table colgroup col:nth-child(2) { width: 180px !important; }
    #residents-table colgroup col:nth-child(3) { width: 120px !important; }
    #residents-table colgroup col:nth-child(4) { width: 130px !important; }
    #residents-table colgroup col:nth-child(5) { width: 130px !important; }
    
    #residents-table .column1 { width: 200px !important; min-width: 200px !important; }
    #residents-table .column2 { width: 180px !important; min-width: 180px !important; }
    #residents-table .column3 { width: 120px !important; min-width: 120px !important; }
    #residents-table .column4 { width: 130px !important; min-width: 130px !important; }
    #residents-table .column5 { width: 130px !important; min-width: 130px !important; }
    
    .table thead th,
    .table tbody td {
        padding: 1rem 0.75rem !important;
        font-size: 0.9rem;
    }
}

@media (max-width: 992px) {
    #residents-table {
        table-layout: auto !important;
    }
    
    #residents-table colgroup col {
        width: auto !important;
    }
    
    #residents-table .column1,
    #residents-table .column2,
    #residents-table .column3,
    #residents-table .column4,
    #residents-table .column5,
    #residents-table .column6 {
        width: auto !important;
        min-width: 120px !important;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 1rem 0;
    }
    
    .glass-card {
        padding: 1.5rem;
    }
    
    .table-container {
        border-radius: 15px;
        margin: 1rem 0;
        overflow: visible;
    }
    
    .table-container .table-responsive {
        overflow-x: scroll;
    }
    
    #residents-table {
        min-width: 1000px;
        table-layout: fixed !important;
    }
    
    #residents-table thead th,
    #residents-table tbody td {
        padding: 0.875rem 0.5rem !important;
        font-size: 0.85rem;
    }
    
    #residents-table thead th.column1,
    #residents-table tbody td.column1 {
        padding-left: 1rem !important;
        min-width: 150px !important;
    }
    
    #residents-table thead th.column6,
    #residents-table tbody td.column6 {
        padding-right: 1rem !important;
    }
    
    #residents-table thead th i {
        font-size: 0.9rem;
        margin-right: 0.25rem;
    }
    
    /* Stack badges on mobile */
    .badge-payment,
    .badge-debt,
    .badge-glass {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }
}

@media (max-width: 576px) {
    #residents-table {
        min-width: 700px;
    }
    
    #residents-table thead th,
    #residents-table tbody td {
        padding: 0.75rem 0.4rem !important;
        font-size: 0.8rem;
    }
    
    #residents-table thead th i {
        display: none;
    }
}

/* Profile Page Overflow Fixes */
.profile-page-container {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    padding-left: 1rem;
    padding-right: 1rem;
}

.profile-page-container .glass-card {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    padding: 1.5rem;
}

.profile-page-container .grid {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
}

.profile-page-container .grid > div {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
    margin: 0;
}

.profile-page-container p,
.profile-page-container label {
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    margin: 0;
}

/* Ensure all profile boxes are properly constrained */
.profile-page-container .bg-white\/5,
.profile-page-container [class*="bg-white/5"],
.profile-page-container div[class*="rounded-xl"] {
    max-width: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    width: 100% !important;
}

.profile-page-container .bg-white\/5 > *,
.profile-page-container [class*="bg-white/5"] > *,
.profile-page-container div[class*="rounded-xl"] > * {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.profile-page-container .bg-white\/5 p,
.profile-page-container [class*="bg-white/5"] p,
.profile-page-container div[class*="rounded-xl"] p {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    max-width: 100% !important;
    overflow: hidden !important;
}

.profile-page-container .bg-white\/5 .flex,
.profile-page-container [class*="bg-white/5"] .flex,
.profile-page-container div[class*="rounded-xl"] .flex {
    max-width: 100% !important;
    min-width: 0 !important;
}

@media (max-width: 768px) {
    .profile-page-container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .profile-page-container .glass-card {
        padding: 1.25rem;
    }
    
    .profile-page-container .bg-white\/5,
    .profile-page-container [class*="bg-white/5"] {
        padding: 1rem !important;
    }
}
