@font-face {
    font-family: 'Inter Variable';
    src: url('../fonts/InterVariable.woff2') format('woff2-variations');
    font-weight: 100 900;
    font-style: normal;
    font-display: fallback; /* Show fallback font immediately, then swap when loaded */
}

/* CSS custom properties for safe area insets */
:root {
    --safe-area-inset-top: env(safe-area-inset-top);
    --safe-area-inset-right: env(safe-area-inset-right);
    --safe-area-inset-bottom: env(safe-area-inset-bottom);
    --safe-area-inset-left: env(safe-area-inset-left);
}

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

/* Prevent transitions during page load to avoid jumping */
.preload * {
    transition: none !important;
    animation: none !important;
}

/* Specifically target the elements that cause jumping */
.preload .sidebar {
    transition: none !important;
    transform: none !important;
    /* Force sidebar to its final position immediately */
    width: 200px !important;
    left: 0 !important;
}

.preload .main-wrapper {
    transition: none !important;
    /* Force main wrapper to its final position immediately */
    margin-left: 200px !important;
}

.preload .user-dropdown {
    transition: none !important;
    transform: none !important;
    /* Ensure dropdown is completely hidden during load */
    opacity: 0 !important;
    visibility: hidden !important;
    display: none !important;
}

.preload .user-dropdown-arrow {
    transition: none !important;
    transform: none !important;
}

.preload .user-info {
    transition: none !important;
}

/* Force stable layout during preload */
.preload .user-info-container {
    position: relative !important;
}

.preload .sidebar-footer {
    position: relative !important;
}

/* Language Switcher in Admin Dropdown */
.language-switcher-dropdown {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.language-switcher-dropdown .language-label {
    flex: 1;
}

.language-btn-dropdown {
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 11px;
    color: #374151;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 32px;
}

.language-btn-dropdown:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.language-sub-dropdown {
    position: absolute;
    bottom: 0;
    left: calc(100% + 8px);
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1005;
    min-width: 120px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-2px);
    transition: all 0.2s ease;
    pointer-events: none;
}

.language-sub-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
}

/* Keep language sub-dropdown visible when hovering over it */
.language-sub-dropdown:hover {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
}

/* Show language sub-dropdown on hover of language switcher */
.language-switcher-dropdown:hover .language-sub-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
}

/* Create invisible bridge for language switcher */
.language-switcher-dropdown::after {
    content: '';
    position: absolute;
    top: 0;
    right: -8px;
    width: 8px;
    height: 100%;
    z-index: 1000;
    pointer-events: auto;
}

/* Remove hover-based display - handle via JavaScript only */

body {
    font-family: 'Inter Variable', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    color: black;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    position: relative;
    font-size: 14px;
    font-weight: 400;
}

/* App Container with Sidebar Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
    width: 200px;
    background: #ffffff;
    border-right: 1px solid #eee;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    transition: transform 0.3s ease;
}

/* Sidebar Footer - User Info */
.sidebar-footer {
    margin-top: auto;
    padding: 8px;
    position: relative;
}

.user-info-container {
    position: relative;
    width: 100%;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
    position: relative;
}

/* Show dropdown on hover - only on devices that support hover */
@media (hover: hover) and (pointer: fine) {
    .user-info:hover {
        background: #f8f9fa;
    }
    .user-info-container:hover .user-dropdown {
        opacity: 1;
        visibility: visible;
        transform: translateX(0);
        pointer-events: auto;
    }

    /* Arrow hover animation removed since arrow is hidden */

    /* Keep dropdown visible when hovering over the dropdown itself */
    .user-dropdown:hover {
        opacity: 1;
        visibility: visible;
        transform: translateX(0);
        pointer-events: auto;
    }
}

/* Create an invisible hover bridge to prevent dropdown from disappearing */
.user-info-container::after {
    content: '';
    position: fixed;
    bottom: 15px;
    left: 200px;
    width: 8px;
    height: 48px; /* Approximate height of user info container */
    z-index: 999;
    pointer-events: auto;
}

/* Bridge positioning when sidebar is collapsed */
.sidebar.collapsed .user-info-container::after {
    left: 0px; /* No gap when collapsed */
}

.user-dropdown-arrow {
    display: none; /* Hide the dropdown arrow */
}

/* Active arrow animation removed since arrow is hidden */

.user-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #E5E5E5;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 14px;
    font-weight: 400;
    color: black;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.user-role {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* User Dropdown Menu - positioned 8px from right edge of sidebar */
.user-dropdown {
    position: fixed;
    bottom: 8px;
    left: 208px; /* 200px sidebar width + 8px gap */
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-4px);
    transition: all 0.2s ease;
    min-width: 180px;
    /* Ensure dropdown doesn't affect layout during page load */
    pointer-events: none;
}

/* Positioning when sidebar is collapsed */
.sidebar.collapsed .user-dropdown {
    left: 8px; /* Just 8px from left edge when collapsed */
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    color: #374151;
    text-decoration: none;
    font-size: 0.875rem;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #eee;
}

.user-dropdown-item:last-child {
    border-bottom: none;
}

@media (hover: hover) and (pointer: fine) {
    .user-dropdown-item:hover {
        background: #f8f9fa;
        color: #111827;
        text-decoration: none;
    }
}

.user-dropdown-item:first-child {
    border-radius: 6px 6px 0 0;
}

.user-dropdown-item:last-child {
    border-radius: 0 0 6px 6px;
}

.user-dropdown-item span {
    font-size: 14px;
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar-header {
    padding: 24px 20px;
    background: #ffffff;
}

.sidebar-header h1 {
    font-size: 1.5rem;
    color: black;
    font-weight: 500;
}

.sidebar-subtitle {
    font-size: 0.75rem;
    color: #9ca3af;
    margin: 0;
    font-weight: 400;
}

.sidebar-header .tagline {
    display: none;
}

.sidebar-menu {
    list-style: none;
    padding: 16px 0;
    margin: 0;
    flex: 1;
}

.menu-item {
    margin: 0;
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #6b7280;
    text-decoration: none;
    transition: all 0.15s ease;
    font-weight: 500;
    border-left: 3px solid transparent;
}

.menu-link:hover {
    background: #f9fafb;
    color: #374151;
}

.menu-item.active .menu-link {
    background: #f9fafb;
    color: black;
    font-weight: 500;
    border-left-color: #111827;
}
.menu-text {
    font-size: 0.875rem;
    font-weight: 400;
}

/* Sidebar Toggle Button - Always Visible */
.sidebar-toggle-btn {
    position: fixed;
    top: 50%;
    left: 185px;
    transform: translateY(-50%);
    width: 24px;
    height: 48px;
    background: #ffffff;
    border: 1px solid #eee;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
    z-index: 1002;
}

.sidebar-toggle-btn:hover {
    background: #f8fafc;
    color: #334155;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
}

.sidebar.collapsed + .sidebar-toggle-btn {
    left: 0;
    border-radius: 0 8px 8px 0;
}

.sidebar.collapsed + .sidebar-toggle-btn .toggle-icon {
    transform: scaleX(-1);
}

/* Mobile Header */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #ffffff;
    border-bottom: 1px solid #eee;
    z-index: 1002;
    padding: 0 16px;
    align-items: center;
    justify-content: space-between;
}

.mobile-header-left {
    display: flex;
    align-items: center;
}

.mobile-header-right {
    display: flex;
    align-items: center;
}

.mobile-system-buttons {
    display: flex;
    gap: 12px;
}

.mobile-system-buttons .btn {
    padding: 6px 16px;
    font-size: 10px;
    min-height: 28px;
    min-width: 50px;
    font-weight: 400;
    line-height: 1.2;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-btn {
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    outline: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    transition: all 0.2s ease;
}

.mobile-menu-btn span {
    width: 14px;
    height: 2px;
    background: black;
    border-radius: 1px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(3px, 3px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(3px, -3px);
}

/* Mobile Page Content */
.mobile-page-content {
    display: none;
    padding-top: 60px; /* Height of mobile header */
    flex-direction: column;
    min-height: 100vh;
    /* Use dynamic viewport height for better iOS Safari support */
    min-height: 100dvh;
    width: 100%;
}

.mobile-content-wrapper {
    flex: 1;
    width: 100%;
}

.mobile-page-title {
    padding: 16px;
    background: #ffffff;
}

.mobile-page-title h1 {
    font-size: 24px;
    font-weight: 400;
    color: #111827;
    margin: 0;
}



/* Mobile Overlay - Dark Background */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1003;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
    overflow: visible;
}



.mobile-overlay.show {
    display: block !important;
    opacity: 1;
    visibility: visible;
}

@media (max-width: 768px) {
    /* Hide desktop elements */
    .sidebar,
    .sidebar-toggle-btn,
    .top-header,
    .app-container .main-wrapper {
        display: none !important;
    }
    
    /* Show mobile elements */
    .mobile-header,
    .mobile-page-content {
        display: flex;
    }
    
    .mobile-page-content {
        flex-direction: column;
    }
    
    .mobile-overlay.show {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    .main-wrapper {
        margin-left: 0;
        padding-top: 0;
        display: none !important;
    }
    
    /* Mobile Sidebar as Left Overlay */
    .mobile-overlay .sidebar {
        display: flex !important;
        position: absolute;
        top: 0;
        left: 0;
        width: 200px; /* Reduced from 200px */
        height: 100vh;
        /* Use dynamic viewport height for better iOS Safari support */
        height: 100dvh;
        /* Fallback for older browsers that don't support dvh */
        height: calc(100vh - var(--safe-area-inset-bottom, 0px));
        background: #ffffff;
        border: none;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        flex-direction: column;
        overflow-y: auto;
        overflow-x: visible;
    }
    
    /* iOS Safari specific fix */
    @supports (-webkit-touch-callout: none) {
        .mobile-overlay .sidebar {
            height: calc(100vh - 34px); /* iOS Safari bottom bar height */
        }
    }
    
    .mobile-overlay.show .sidebar {
        transform: translateX(0);
    }
    

    
    .mobile-overlay .sidebar-header {
        padding: 16px 16px; /* Reduced padding for mobile */
        background: #ffffff;
        border-bottom: 1px solid #f1f5f9;
    }
    
    .mobile-overlay .neuraqua-logo {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        color: #000000;
        text-decoration: none;
        font-size: 18px; /* Slightly smaller for mobile sidebar */
        font-weight: 500;
    }
    
    .mobile-overlay .logo-square {
        width: 24px; /* Slightly smaller for mobile */
        height: 24px;
        background: #2563eb;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 12px; /* Adjusted for smaller square */
        font-weight: bold;
        border-radius: 4px; /* Add slight rounding for mobile */
    }
    
    .mobile-overlay .sidebar-menu {
        padding-top: 16px; /* Reduced from 64px since we have header now */
        margin: 0;
        flex: 1;
        list-style: none;
        background: #ffffff;
        display: flex;
        flex-direction: column;
    }
    
    .mobile-overlay .menu-item {
        margin: 0;
        display: block;
        width: 100%;
    }
    
    .mobile-overlay .menu-link {
        display: block !important;
        padding: 12px 12px; /* Further reduced padding */
        font-size: 12px; /* Further reduced from 15px */
        color: #374151;
        text-decoration: none;
        border-left: none;
        background: #ffffff;
        transition: all 0.2s ease;
        font-weight: 400;
        width: 100%;
        box-sizing: border-box;
        text-align: left; /* Center text for cleaner look */
    }
    
    .mobile-overlay .menu-link:hover {
        color: #111827;
    }
    
    .mobile-overlay .menu-item.active .menu-link {
        color: black;
        background: none;
        font-weight: 500;
    }
    
    .mobile-overlay .sidebar-footer {
        padding: 12px; /* Further reduced from 16px */
        /* Add bottom padding for iOS Safari safe area */
        padding-bottom: max(12px, var(--safe-area-inset-bottom, 0px));
        background: #ffffff;
        margin-top: auto;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Additional iOS Safari specific footer padding */
    @supports (-webkit-touch-callout: none) {
        .mobile-overlay .sidebar-footer {
            padding-bottom: 46px; /* Ensure user info is always visible */
        }
        
        .mobile-language-dropdown {
            bottom: 114px; /* Adjusted for iOS Safari */
        }
        
        .mobile-overlay .user-dropdown {
            bottom: 54px; /* Adjusted for iOS Safari */
        }
    }
    
    /* Mobile Language Switcher in Sidebar */
    .mobile-language-switcher {
        display: flex;
        justify-content: left;
        margin-bottom: 16px;
        position: relative;
        cursor: pointer;
        transition: all 0.2s ease;
    }
    
    .mobile-language-label {
        font-size: 12px;
        color: black;
        font-weight: 400;
        pointer-events: none;
    }
    
    .mobile-language-dropdown {
        position: fixed;
        left: 208px; /* 200px sidebar width + 8px gap */
        bottom: calc(80px + var(--safe-area-inset-bottom, 0px)); /* Position above the language switcher with safe area */
        background: white;
        border: 1px solid #eee;
        border-radius: 6px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        z-index: 1010;
        min-width: 120px;
        opacity: 0;
        visibility: hidden;
        transform: translateX(-8px);
        transition: all 0.2s ease;
        pointer-events: none;
    }
    
    .mobile-language-dropdown.show {
        opacity: 1;
        visibility: visible;
        transform: translateX(0);
        pointer-events: auto;
    }
    
    .mobile-language-dropdown .language-option {
        display: block;
        padding: 8px 12px;
        font-size: 12px;
        color: #374151;
        text-decoration: none;
        cursor: pointer;
        transition: background-color 0.2s ease;
        border-bottom: 1px solid #f1f5f9;
    }
    
    @media (hover: hover) and (pointer: fine) {
        .mobile-language-dropdown .language-option:hover {
            background: #f8f9fa;
        }
    }
    
    .mobile-language-dropdown .language-option:last-child {
        border-bottom: none;
    }
    
    .mobile-overlay .user-info {
        padding: 8px; /* Further reduced from 12px */
        border-radius: 4px; /* Further reduced from 6px */
        background: #f8f9fa;
        display: flex;
        align-items: center;
        gap: 8px; /* Further reduced from 10px */
        margin-bottom: 8px; /* Further reduced from 12px */
    }
    
    .mobile-overlay .user-avatar {
        width: 28px; /* Further reduced from 32px */
        height: 28px; /* Further reduced from 32px */
        border-radius: 50%;
        background: #E5E5E5;
        color: #333;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 12px; /* Further reduced from 14px */
        font-weight: 600;
    }
    
    .mobile-overlay .user-details {
        flex: 1;
    }
    
    .mobile-overlay .user-name {
        font-size: 12px; /* Further reduced from 14px */
        font-weight: 500;
        color: #111827;
        margin: 0;
        line-height: 1.2; /* Compact line height */
    }
    
    .mobile-overlay .user-dropdown {
        position: fixed;
        left: 208px; /* 200px sidebar width + 8px gap */
        bottom: calc(20px + var(--safe-area-inset-bottom, 0px)); /* Further reduced from 70px with safe area */
        background: white;
        border: 1px solid #e2e8f0;
        border-radius: 6px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        z-index: 1010;
        min-width: 160px; /* Further reduced from 180px */
        opacity: 0;
        visibility: hidden;
        transform: translateX(-8px);
        transition: all 0.2s ease;
        pointer-events: none;
    }
    
    .mobile-overlay .user-dropdown.show {
        opacity: 1;
        visibility: visible;
        transform: translateX(0);
        pointer-events: auto;
    }
    
    .mobile-overlay .user-dropdown-item {
        display: block;
        padding: 8px 12px; /* Further reduced padding */
        color: #374151;
        text-decoration: none;
        font-size: 12px; /* Further reduced from 13px */
        border-bottom: 1px solid #f1f5f9;
        transition: all 0.2s ease;
        white-space: nowrap;
    }
    
    @media (hover: hover) and (pointer: fine) {
        .mobile-overlay .user-dropdown-item:hover {
            background: #f8f9fa;
            color: #111827;
        }
    }
    
    .mobile-overlay .user-dropdown-item:last-child {
        border-bottom: none;
    }
    
    .mobile-overlay .language-switcher-dropdown {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 8px 12px; /* Further reduced to match */
        border-bottom: 1px solid #f1f5f9;
        cursor: pointer;
    }
    
    .mobile-overlay .language-label {
        flex: 1;
        font-size: 12px; /* Further reduced from 13px */
        color: #374151;
    }
    
    .mobile-overlay .language-btn-dropdown {
        background: #f8f9fa;
        border: 1px solid #e2e8f0;
        border-radius: 3px;
        padding: 2px 4px; /* Further reduced padding */
        font-size: 9px; /* Further reduced from 10px */
        color: #374151;
        cursor: pointer;
        font-weight: 500;
        transition: all 0.2s ease;
        min-width: 24px; /* Further reduced from 28px */
    }
    
    .mobile-overlay .language-btn-dropdown:hover {
        background: #f1f5f9;
    }
    
    .mobile-overlay .language-sub-dropdown {
        position: absolute;
        bottom: 0;
        left: calc(100% + 8px);
        background: white;
        border: 1px solid #e2e8f0;
        border-radius: 6px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        z-index: 1005;
        min-width: 120px;
        opacity: 0;
        visibility: hidden;
        transform: translateX(-2px);
        transition: all 0.2s ease;
        pointer-events: none;
    }
    
    .mobile-overlay .language-sub-dropdown.show {
        opacity: 1;
        visibility: visible;
        transform: translateX(0);
        pointer-events: auto;
    }
}

/* Main Wrapper */
.main-wrapper {
    flex: 1;
    margin-left: 200px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.main-wrapper.sidebar-collapsed {
    margin-left: 0;
}

/* Top Header */
.top-header {
    background: #ffffff;
    padding: 24px 40px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-header .header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

/* Force mobile layout on small screens */
@media (max-width: 768px) {
    /* Additional mobile fixes */
    body .app-container {
        display: none !important;
    }
    
    body {
        overflow-x: hidden;
    }
}
/* Pool Navigation */
.pool-navigation {
    display: flex;
    padding: 72px 0 24px 40px;
    margin: 0;
    gap: 32px;
    align-items: center;
    justify-content: flex-start;
    background: none;
    border: none;
    position: relative;
}

/* Desktop pool tabs should have direct spacing */
.pool-navigation .pool-tabs-container {
    display: flex;
    gap: 32px;
    align-items: center;
}

.pool-navigation .pool-tab {
    all: unset;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 400;
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.15s ease;
    display: inline-block;
}

.pool-navigation .pool-tab:hover {
    color: #6b7280;
}

.pool-navigation .pool-tab.active {
    color: black;
    font-weight: 500;
}

@media (max-width: 768px) {
    .pool-navigation {
        padding: 16px;
        flex-direction: column;
        gap: 12px;
        position: static;
        margin: 0;
        width: 100%;
    }
    
    .pool-navigation .pool-tabs-container {
        display: flex;
        gap: 8px;
        width: 100%;
        overflow-x: auto;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }
    
    .pool-navigation .pool-tab {
        flex: 1;
        min-width: 100px;
        text-align: center;
        padding: 12px 16px;
        transition: all 0.2s ease;
        touch-action: manipulation;
        font-size: 14px;
        white-space: nowrap;
    }
    
    .pool-navigation .pool-tab.active {
        color: #ffffff;
    }
    
    .pool-navigation .last-reading-info {
        position: static;
        font-size: 12px;
        color: #64748b;
        text-align: left;
        padding: 16px 0 0 0;
        margin: 0;
        width: 100%;
        box-sizing: border-box;
    }
}

/* Last Reading Display */
.last-reading-info {
    position: absolute;
    right: 2rem;
    align-items: center;
    font-size: 0.75rem;
    color: #64748b;
    white-space: nowrap;
}

.last-reading-text {
    font-weight: 400;
    color: black;
}

/* Language option styling for sub-dropdown */
.language-option {
    display: block;
    width: 100%;
    padding: 8px 12px;
    text-align: left;
    background: none;
    border: none;
    color: #475569;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.language-option:hover {
    background: #f8fafc;
}

.language-option.active {
    background: #f8f9fa;
    color: black;
    font-weight: 500;
}

.language-option:first-child {
    border-radius: 6px 6px 0 0;
}

.language-option:last-child {
    border-radius: 0 0 6px 6px;
}
.page-title h1 {
    font-size: 1.5rem;
    color: #111827;
    font-weight: 500;
    margin: 0;
}
/* Main Content */
.main-content {
    flex: 1;
    padding: 40px;
    background: #ffffff;
}

/* Filters Bar */
.filters-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 16px;
}

.filters-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filters-right {
    display: flex;
    align-items: center;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    color: black;
    left: 12px;
    z-index: 1;
}

.search-input {
    padding: 8px 12px 8px 40px;
    border: 1px solid #eee;
    border-radius: 6px;
    font-size: 0.875rem;
    background: white;
    color: black;
    min-width: 240px;
}

.search-input::placeholder {
    color: black;
}

.search-input:focus {
    outline: none;
    border-color: #eee;
}

.filters-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: white;
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filters-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.date-filter {
    padding: 8px 12px;
    border: 1px solid #eee;
    border-radius: 6px;
    font-size: 0.875rem;
    background: white;
    cursor: pointer;
}

.date-filter:focus {
    outline: none;
    border-color: #eee;
}

/* Logs Table */
.logs-table-container {
    background: white;
    border-radius: 8px;
    border: 1px solid #eee;
    overflow-x: auto;
    width: 100%;
    max-width: none;
    box-shadow: none;
}

.logs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    table-layout: fixed;
    min-width: 1200px;
}

.logs-table th {
    background: #ffffff;
    padding: 12px 16px;
    text-align: left;
    font-weight: 400;
    color: black;
    border-bottom: 1px solid #eee;
}

.logs-table th:first-child {
    width: 160px;
}

.logs-table th:last-child {
    width: 80px;
}

.logs-table th:not(:first-child):not(:last-child) {
    width: calc((100% - 240px) / 6);
}

.logs-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    color: #111827;
    white-space: nowrap;
}

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

.logs-table tr:hover {
    background: #f8fafc;
}

.logs-table .no-logs {
    text-align: center;
    color: #6b7280;
    font-style: normal;
    padding: 80px 16px;
    vertical-align: middle;
    font-size: 0.9rem;
}

.source-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 400;
}

.source-badge.automated {
    background: #dbeafe;
    color: #1d4ed8;
}

.source-badge.manual {
    background: #dcfce7;
    color: #16a34a;
}

/* Responsive Table */
@media (max-width: 1200px) {
    .logs-table {
        min-width: 1000px;
        font-size: 0.8125rem;
    }
    
    .logs-table th,
    .logs-table td {
        padding: 10px 12px;
    }
}

@media (max-width: 1000px) {
    .logs-table {
        min-width: 800px;
        font-size: 0.75rem;
    }
    
    .logs-table th,
    .logs-table td {
        padding: 8px 10px;
    }
    
    .logs-table th:first-child {
        width: 140px;
    }
    
    .logs-table th:last-child {
        width: 70px;
    }
}

@media (max-width: 768px) {
    /* Main content adjustments for mobile */
    .mobile-content-wrapper .main-content {
        padding: 16px;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Sensor Cards Grid Mobile Layout */
    .mobile-content-wrapper .readings-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 16px;
        margin: 20px 16px;
        width: calc(100% - 32px);
        box-sizing: border-box;
    }
    
    .mobile-content-wrapper .pool-content {
        width: 100%;
        padding: 0;
    }
    
    .sensor-card {
        padding: 20px;
        border-radius: 6px;
        transition: all 0.2s ease;
    }
    
    .sensor-name {
        font-size: 14px;
        margin-bottom: 12px;
    }
    
    .sensor-value {
        font-size: 1.5rem;
        margin-bottom: 4px;
    }
    
    .sensor-unit {
        font-size: 14px;
    }
    
    /* Filters Bar Mobile Layout */
    .filters-bar {
        flex-direction: column;
        gap: 12px;
        align-items: start;
    }
    
    .filters-left {
        flex-wrap: nowrap;
        gap: 6px;
        align-items: start;
    }
    
    .search-input {
        min-width: 180px;
        flex: 1;
        padding: 8px 12px 8px 32px;
        font-size: 14px;
        border-radius: 6px;
        touch-action: manipulation;
    }
    
    .search-icon {
        left: 10px;
        width: 14px;
        height: 14px;
    }
    
    .export-btn, .date-filter {
        padding: 8px 12px;
        font-size: 12px;
        border-radius: 6px;
        touch-action: manipulation;
        min-height: 36px;
        white-space: nowrap;
    }
    
    .export-btn svg {
        width: 12px;
        height: 12px;
    }
    
    .export-btn {
        gap: 4px;
    }
    
    /* Table Mobile Improvements */
    .logs-table {
        min-width: 700px;
        font-size: 0.75rem;
    }
    
    .logs-table th,
    .logs-table td {
        padding: 8px 6px;
        font-size: 12px;
    }
    
    .logs-table th:first-child {
        width: 120px;
    }
    
    .logs-table th:last-child {
        width: 60px;
    }
    
    .logs-table th:not(:first-child):not(:last-child) {
        width: calc((100% - 180px) / 6);
    }
    
    .logs-table .no-logs {
        padding: 40px 16px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 16px;
    }
    
    .filters-bar {
        gap: 8px;
    }
    
    .filters-left {
        gap: 8px;
    }
    
    .search-input {
        min-width: auto;
        width: 100%;
    }
    
    /* Logs table keeps desktop layout with horizontal scroll */
    
    .source-badge {
        padding: 1px 4px;
        font-size: 0.625rem;
    }
}
.header-content {
    width: 100%;
    padding: 0px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.system-status {
    display: flex;
    align-items: center;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 3s infinite;
}

.status-dot.online {
    background: #10b981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
}

.status-dot.offline {
    background: #ef4444;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
}

.status-dot.starting {
    background: #f59e0b;
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
}

@keyframes pulse {
    0% {
        transform: scale(0.60);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    
    70% {
        transform: scale(0.70);
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }
    
    100% {
        transform: scale(0.60);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.status-dot.offline {
    animation-name: pulse-red;
}

.status-dot.starting {
    animation-name: pulse-yellow;
}

@keyframes pulse-red {
    0% {
        transform: scale(0.60);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    
    70% {
        transform: scale(0.70);
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
    
    100% {
        transform: scale(0.60);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

@keyframes pulse-yellow {
    0% {
        transform: scale(0.60);
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
    }
    
    70% {
        transform: scale(0.70);
        box-shadow: 0 0 0 10px rgba(245, 158, 11, 0);
    }
    
    100% {
        transform: scale(0.60);
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    }
}

/* Export Switcher */
.export-switcher {
    position: relative;
    display: inline-block;
    margin-left: 12px;
}

.export-btn {
    background: white;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.875rem;
    color: black;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}



.export-btn:hover {
    background: #F5F5F5;
    border-color: #eee;
}



.export-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 50;
    min-width: 140px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all 0.2s ease;
    margin-top: 8px;
}

.export-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.export-option {
    display: block;
    width: 100%;
    padding: 8px 12px;
    background: none;
    border: none;
    text-align: left;
    color: #374151;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.export-option:hover {
    background: #f3f4f6;
}

.export-option:first-child {
    border-radius: 6px 6px 0 0;
}

.export-option:last-child {
    border-radius: 0 0 6px 6px;
}

/* Button Styling */
.btn {
    padding: 6px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.75em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.3px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: #2b6cb0;
    color: white;
    font-size: 16px;
    padding: 14px 28px;
    border-radius: 8px;
}

.btn-primary:hover {
    background: #000000e6;
}

.btn-start {
    background: #2563EB;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    font-weight: 400;
    font-size: 0.875rem;
    line-height: 16px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-start:hover {
    background: #1E40AF;
}

.btn-start:disabled {
    background: #E2DEDF;
    color: #B6B1B2;
    cursor: not-allowed;
}

.btn-stop {
    background: #ffffff;
    color: black;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-weight: 400;
    font-size: 0.875rem;
    line-height: 16px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-stop:hover {
    background: #E2DEDF;
}

.btn-stop:disabled {
    background: #E2DEDF;
    color: #B6B1B2;
    cursor: not-allowed;
}

.btn-secondary {
    background: #6b7280;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #4b5563;
}
.readings-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 20px;
    width: 100%;
    max-width: none;
}

.sensor-card {
    background: #ffffff;
    border-radius: 6px;
    padding: 24px;
    border: 1px solid #eee;
    transition: border-color 0.2s ease;
}

.sensor-card:hover {
    border-color: #d1d5db;
}

.sensor-name {
    font-size: 0.875rem;
    font-weight: 400;
    color: #171717;
    margin-bottom: 16px;
}

.sensor-value {
    font-size: 1.25rem;
    font-weight: 400;
    color: #111827;
    margin-bottom: 0;
    line-height: 1;
    font-variant-numeric: lining-nums tabular-nums;
}

.sensor-unit {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 400;
    margin-left: 4px;
}

.sensor-error {
    color: #e53e3e;
    font-style: italic;
}

.btn-excel {
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-excel:hover {
    background: #1d4ed8;
}

.btn-pdf {
    background: #dc2626;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-pdf:hover {
    background: #b91c1c;
}
.notifications {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.notification {
    background: #ffffff;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    min-width: 300px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
}

.notification.success {
    border-left: 4px solid #38a169;
}

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

.notification.info {
    border-left: 4px solid #2b6cb0;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    to {
        left: 100%;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid #eee;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    
    .sidebar-menu {
        padding: 10px 0;
    }
    
    .menu-link {
        padding: 10px 20px;
    }
    
    .main-wrapper {
        margin-left: 0;
    }
    
    .top-header {
        padding: 15px 20px;
    }
    
    
    .pool-navigation {
        flex-direction: column;
        padding: 20px 0 24px 20px;
    }
    
    
    .pool-navigation .pool-tab {
        font-size: 0.95rem;
        margin-bottom: 8px;
    }
    
    
    
    .main-content {
        padding: 20px;
    }
    
    .header-content {
        padding: 0 20px;
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
    
    main {
        padding: 20px;
    }
    
    
    .readings-grid {
        grid-template-columns: 1fr;
    }
    
    
    
    .notification {
        min-width: auto;
        margin: 0 10px;
    }
    
    
    
    .pool-content,
    .pool-logs-content {
        padding: 0;
    }
}
.pool-navigation .pool-tab {
    all: unset;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 400;
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.15s ease;
    display: inline-block;
}

.pool-navigation .pool-tab:hover {
    color: #6b7280;
}

.pool-navigation .pool-tab.active {
    color: black;
    font-weight: 500;
}
/* Pool Content Areas */
.pool-content {
    padding: 0;
}

/* Pool Logs Content Areas */
.pool-logs-content {
    padding: 0;
}
/* Admin Pages Mobile Responsive Styles */
@media (max-width: 768px) {
    .admin-container {
        padding: 20px;
        max-width: none;
    }
    
    .admin-header {
        gap: 16px;
        align-items: end;
        margin-bottom: 20px;
    }
    
    .admin-header .btn {
        justify-content: center;
        padding: 0 12px;
        font-size: 12px;
        touch-action: manipulation;
        min-height: 32px;
    }
    
    /* Mobile-friendly modal */
    .modal-content {
        margin: 10% auto;
        width: calc(100% - 40px);
        max-width: 400px;
        padding: 24px;
    }
    
    .modal-buttons {
        flex-direction: column;
        gap: 12px;
    }
    
    .btn-cancel, .btn-confirm {
        width: 100%;
        padding: 12px 16px;
        font-size: 16px;
        touch-action: manipulation;
    }
    
    /* Logs table container keeps desktop styling */
    
    .role-badge, .status-badge {
        font-size: 10px;
        padding: 3px 8px;
    }
    
    .btn-edit, .btn-danger {
        font-size: 10px;
        padding: 6px 8px;
        margin: 2px;
        display: block;
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }
    
    .btn-edit {
        margin-bottom: 4px;
    }
}

/* Form Elements Mobile Improvements */
@media (max-width: 768px) {
    /* Better touch targets for all buttons */
    .btn, button {
        min-height: 44px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Dropdown improvements */
    .export-dropdown {
        position: fixed;
        top: auto;
        bottom: 20px;
        left: 20px;
        right: 20px;
        width: auto;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
        border-radius: 12px;
    }
    
    .export-option {
        padding: 16px 20px;
        font-size: 16px;
        touch-action: manipulation;
    }
    
    .user-dropdown {
        min-width: 220px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
        border-radius: 12px;
    }
    
    .user-dropdown-item {
        padding: 16px 20px;
        font-size: 16px;
        touch-action: manipulation;
    }
    
    .language-sub-dropdown {
        min-width: 160px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
        border-radius: 12px;
    }
    
    .language-option {
        padding: 16px 20px;
        font-size: 16px;
        touch-action: manipulation;
    }
    
    /* Notification improvements */
    .notifications {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .notification {
        min-width: auto;
        margin-bottom: 8px;
        padding: 16px;
        border-radius: 12px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    }
}

/* Additional responsive styles within the main media query above */ 