/* ...existing code... */

/* Enhanced styles for field management */
#user-fields-container {
    max-height: 400px;
    overflow-y: auto;
}

.fields-card {
    position: absolute;
    top: 70px;
    right: 15px;
    width: 350px;
    max-width: 90%;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    transition: all 0.3s ease;
}

/* Improved floating menu positioning to prevent overlap with navigation */
.floating-menu {
    position: fixed;
    bottom: 170px; /* Further increased from 140px to avoid overlap with navigation */
    right: 20px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Updated floating button style to match general button style */
.floating-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    color: #198754; /* Match the color scheme */
}

.floating-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    background-color: #f8f9fa; /* Subtle background change on hover */
}

.floating-btn i {
    font-size: 1.5rem;
    color: #198754;
}

/* Specific styles for fields button */
.floating-btn.fields-btn {
    background-color: #fff;
    position: relative; /* For tooltip positioning */
}

.floating-btn.fields-btn:hover {
    background-color: #f8f9fa;
}

.floating-btn.fields-btn.active {
    background-color: #198754; /* Match active state with green theme */
}

.floating-btn.fields-btn.active i {
    color: #fff; /* White icon when active */
}

/* Style for the analyze button */
.floating-btn.analyze-btn {
    background-color: #fff;
    position: relative;
}

.floating-btn.analyze-btn:hover {
    background-color: #f8f9fa;
}

.floating-btn.analyze-btn i {
    color: #0d6efd;
}

.floating-btn.analyze-btn:hover i {
    color: #0a58ca;
}

/* Tooltip for floating buttons */
.floating-btn::after {
    content: attr(title);
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.floating-btn:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Responsive styles for mobile */
@media (max-width: 576px) {
    .fields-card {
        top: 60px;
        right: 10px;
        width: calc(100% - 20px);
    }
    
    .floating-menu {
        bottom: 200px; /* Even higher on mobile to avoid all controls */
    }
    
    .search-container {
        width: 200px; /* Even smaller on mobile */
        top: 10px !important;
        right: 10px !important;
    }
}

/* Popup edit button styling */
.edit-field-popup-btn {
    display: block;
    width: 100%;
    margin-top: 8px;
}

/* Styles for field management */
#user-fields-container {
    max-height: 400px;
    overflow-y: auto;
}

.map-alert {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    min-width: 300px;
    max-width: 80%;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Style for leaflet draw toolbar */
.leaflet-draw.leaflet-control {
    margin-top: 10px;
}

.leaflet-draw-actions a {
    background-color: #fff;
    color: #333;
    padding: 5px 10px;
    border-bottom: 1px solid #ccc;
}

.leaflet-draw-actions a:hover {
    background-color: #f4f4f4;
}

/* Make draw controls more visible */
.leaflet-touch .leaflet-draw-toolbar .leaflet-draw-draw-polygon {
    background-position: -31px -2px;
}

.leaflet-touch .leaflet-draw-toolbar .leaflet-draw-edit-edit {
    background-position: -152px -2px;
}

.leaflet-touch .leaflet-draw-toolbar .leaflet-draw-edit-remove {
    background-position: -182px -2px;
}

/* Style for geometry edit handles */
.leaflet-edit-resize {
    border: 2px solid #00c853;
}

.leaflet-edit-move {
    border: 2px solid #2196f3;
}

/* Fixed panel navigation styles */
.panel-nav {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 10px;
    gap: 8px;
}

/* Покращені стилі для навігації вкладок */
.nav-tabs .nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 14px;
}

.nav-tabs .nav-link i {
    margin-right: 0;
}

/* Ensure panel sections have clear transitions */
.panel-section-container {
    position: absolute;
    width: 100%;
    left: 0;
    right: 0;
    top: 0; 
    padding-top: 80px; /* Space for header and tabs */
    padding-left: 20px;
    padding-right: 20px;
    height: 100%;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    z-index: -1;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    background-color: rgba(255, 255, 255, 0.97);
}

.panel-section-container.active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

/* Ensure the analytics panel structure is clean */
.analytics-panel {
    position: fixed;
    left: -350px;
    top: 0;
    width: 350px;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.97);
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.2);
    z-index: 999;
    transition: left 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden; /* Changed from overflow-y: auto to prevent double scrollbars */
    padding: 0; /* Remove padding as we'll handle it in child elements */
    border-radius: 0 10px 10px 0;
}

.analytics-panel.open {
    left: 0;
}

.analytics-panel-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: rgba(255, 255, 255, 0.97);
    z-index: 2;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.panel-nav {
    position: absolute;
    top: 50px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 10px 20px;
    background-color: rgba(255, 255, 255, 0.97);
    z-index: 2;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* Panel sections and tabs */
.panel-nav {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 10px;
}

.panel-nav-item {
    flex: 1;
    background: none;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    margin: 0 4px;
}

.panel-nav-item.active {
    background-color: rgba(25, 135, 84, 0.1);
    color: #198754;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.panel-nav-item:hover:not(.active) {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Ensure panel sections have clear transitions */
.panel-section-container {
    position: absolute;
    width: 100%;
    left: 0;
    right: 0;
    top: 0; 
    padding-top: 80px; /* Space for header and tabs */
    padding-left: 20px;
    padding-right: 20px;
    height: 100%;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    z-index: -1;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    background-color: rgba(255, 255, 255, 0.97);
}

.panel-section-container.active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

/* Ensure the analytics panel structure is clean */
.analytics-panel {
    position: fixed;
    left: -350px;
    top: 0;
    width: 350px;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.97);
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.2);
    z-index: 999;
    transition: left 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden; /* Changed from overflow-y: auto to prevent double scrollbars */
    padding: 0; /* Remove padding as we'll handle it in child elements */
    border-radius: 0 10px 10px 0;
}

.analytics-panel.open {
    left: 0;
}

.analytics-panel-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: rgba(255, 255, 255, 0.97);
    z-index: 2;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.panel-nav {
    position: absolute;
    top: 50px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 10px 20px;
    background-color: rgba(255, 255, 255, 0.97);
    z-index: 2;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* Panel sections and tabs */
.panel-nav {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 10px;
}

.panel-nav-item {
    flex: 1;
    background: none;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    margin: 0 4px;
}

.panel-nav-item.active {
    background-color: rgba(25, 135, 84, 0.1);
    color: #198754;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.panel-nav-item:hover:not(.active) {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Стилі для перемикачів у вкладках */
.nav-tabs .form-switch {
    margin: 0 0 0 8px;
    display: flex;
    align-items: center;
}

.nav-tabs .form-check-input {
    width: 32px;
    height: 18px;
    cursor: pointer;
    margin-top: 0;
}

.nav-tabs .nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 14px;
}

.nav-tabs .nav-link i {
    margin-right: 0;
}

/* Ensure panel sections have clear transitions */
.panel-section-container {
    position: absolute;
    width: 100%;
    left: 0;
    right: 0;
    top: 0; 
    padding-top: 80px; /* Space for header and tabs */
    padding-left: 20px;
    padding-right: 20px;
    height: 100%;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    z-index: -1;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    background-color: rgba(255, 255, 255, 0.97);
}

.panel-section-container.active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

/* Ensure the analytics panel structure is clean */
.analytics-panel {
    position: fixed;
    left: -350px;
    top: 0;
    width: 350px;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.97);
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.2);
    z-index: 999;
    transition: left 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden; /* Changed from overflow-y: auto to prevent double scrollbars */
    padding: 0; /* Remove padding as we'll handle it in child elements */
    border-radius: 0 10px 10px 0;
}

.analytics-panel.open {
    left: 0;
}

.analytics-panel-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: rgba(255, 255, 255, 0.97);
    z-index: 2;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.panel-nav {
    position: absolute;
    top: 50px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 10px 20px;
    background-color: rgba(255, 255, 255, 0.97);
    z-index: 2;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* Panel sections and tabs */
.panel-nav {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 10px;
}

.panel-nav-item {
    flex: 1;
    background: none;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    margin: 0 4px;
}

.panel-nav-item.active {
    background-color: rgba(25, 135, 84, 0.1);
    color: #198754;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.panel-nav-item:hover:not(.active) {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Стилі для перемикачів у вкладках */
.nav-tabs .form-switch {
    margin: 0 0 0 8px;
    display: flex;
    align-items: center;
}

.nav-tabs .form-check-input {
    width: 32px;
    height: 18px;
    cursor: pointer;
    margin-top: 0;
}

.nav-tabs .nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 14px;
}

.nav-tabs .nav-link i {
    margin-right: 0;
}

/* Ensure panel sections have clear transitions */
.panel-section-container {
    position: absolute;
    width: 100%;
    left: 0;
    right: 0;
    top: 0; 
    padding-top: 80px; /* Space for header and tabs */
    padding-left: 20px;
    padding-right: 20px;
    height: 100%;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    z-index: -1;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    background-color: rgba(255, 255, 255, 0.97);
}

.panel-section-container.active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

/* Ensure the analytics panel structure is clean */
.analytics-panel {
    position: fixed;
    left: -350px;
    top: 0;
    width: 350px;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.97);
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.2);
    z-index: 999;
    transition: left 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden; /* Changed from overflow-y: auto to prevent double scrollbars */
    padding: 0; /* Remove padding as we'll handle it in child elements */
    border-radius: 0 10px 10px 0;
}

.analytics-panel.open {
    left: 0;
}

.analytics-panel-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: rgba(255, 255, 255, 0.97);
    z-index: 2;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.panel-nav {
    position: absolute;
    top: 50px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 10px 20px;
    background-color: rgba(255, 255, 255, 0.97);
    z-index: 2;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* Panel sections and tabs */
.panel-nav {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 10px;
}

.panel-nav-item {
    flex: 1;
    background: none;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    margin: 0 4px;
}

.panel-nav-item.active {
    background-color: rgba(25, 135, 84, 0.1);
    color: #198754;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.panel-nav-item:hover:not(.active) {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Стилі для перемикачів у вкладках */
.nav-tabs .form-switch {
    margin: 0 0 0 8px;
    display: flex;
    align-items: center;
}

.nav-tabs .form-check-input {
    width: 32px;
    height: 18px;
    cursor: pointer;
    margin-top: 0;
}

.nav-tabs .nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 14px;
}

.nav-tabs .nav-link i {
    margin-right: 0;
}

/* Ensure panel sections have clear transitions */
.panel-section-container {
    position: absolute;
    width: 100%;
    left: 0;
    right: 0;
    top: 0; 
    padding-top: 80px; /* Space for header and tabs */
    padding-left: 20px;
    padding-right: 20px;
    height: 100%;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    z-index: -1;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    background-color: rgba(255, 255, 255, 0.97);
}

.panel-section-container.active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

/* Ensure the analytics panel structure is clean */
.analytics-panel {
    position: fixed;
    left: -350px;
    top: 0;
    width: 350px;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.97);
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.2);
    z-index: 999;
    transition: left 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden; /* Changed from overflow-y: auto to prevent double scrollbars */
    padding: 0; /* Remove padding as we'll handle it in child elements */
    border-radius: 0 10px 10px 0;
}

.analytics-panel.open {
    left: 0;
}

.analytics-panel-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: rgba(255, 255, 255, 0.97);
    z-index: 2;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.panel-nav {
    position: absolute;
    top: 50px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 10px 20px;
    background-color: rgba(255, 255, 255, 0.97);
    z-index: 2;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* Panel sections and tabs */
.panel-nav {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 10px;
}

.panel-nav-item {
    flex: 1;
    background: none;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    margin: 0 4px;
}

.panel-nav-item.active {
    background-color: rgba(25, 135, 84, 0.1);
    color: #198754;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.panel-nav-item:hover:not(.active) {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Стилі для перемикачів у вкладках */
.nav-tabs .form-switch {
    margin: 0 0 0 8px;
    display: flex;
    align-items: center;
}

.nav-tabs .form-check-input {
    width: 32px;
    height: 18px;
    cursor: pointer;
    margin-top: 0;
}

.nav-tabs .nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 14px;
}

.nav-tabs .nav-link i {
    margin-right: 0;
}

/* Ensure panel sections have clear transitions */
.panel-section-container {
    position: absolute;
    width: 100%;
    left: 0;
    right: 0;
    top: 0; 
    padding-top: 80px; /* Space for header and tabs */
    padding-left: 20px;
    padding-right: 20px;
    height: 100%;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    z-index: -1;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    background-color: rgba(255, 255, 255, 0.97);
}

.panel-section-container.active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

/* Ensure the analytics panel structure is clean */
.analytics-panel {
    position: fixed;
    left: -350px;
    top: 0;
    width: 350px;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.97);
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.2);
    z-index: 999;
    transition: left 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden; /* Changed from overflow-y: auto to prevent double scrollbars */
    padding: 0; /* Remove padding as we'll handle it in child elements */
    border-radius: 0 10px 10px 0;
}

.analytics-panel.open {
    left: 0;
}

.analytics-panel-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: rgba(255, 255, 255, 0.97);
    z-index: 2;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.panel-nav {
    position: absolute;
    top: 50px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 10px 20px;
    background-color: rgba(255, 255, 255, 0.97);
    z-index: 2;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* Panel sections and tabs */
.panel-nav {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 10px;
}

.panel-nav-item {
    flex: 1;
    background: none;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    margin: 0 4px;
}

.panel-nav-item.active {
    background-color: rgba(25, 135, 84, 0.1);
    color: #198754;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.panel-nav-item:hover:not(.active) {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Стилі для перемикачів у вкладках */
.nav-tabs .form-switch {
    margin: 0 0 0 8px;
    display: flex;
    align-items: center;
}

.nav-tabs .form-check-input {
    width: 32px;
    height: 18px;
    cursor: pointer;
    margin-top: 0;
}

.nav-tabs .nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 14px;
}

.nav-tabs .nav-link i {
    margin-right: 0;
}

/* Ensure panel sections have clear transitions */
.panel-section-container {
    position: absolute;
    width: 100%;
    left: 0;
    right: 0;
    top: 0; 
    padding-top: 80px; /* Space for header and tabs */
    padding-left: 20px;
    padding-right: 20px;
    height: 100%;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    z-index: -1;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    background-color: rgba(255, 255, 255, 0.97);
}

.panel-section-container.active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

/* Ensure the analytics panel structure is clean */
.analytics-panel {
    position: fixed;
    left: -350px;
    top: 0;
    width: 350px;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.97);
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.2);
    z-index: 999;
    transition: left 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden; /* Changed from overflow-y: auto to prevent double scrollbars */
    padding: 0; /* Remove padding as we'll handle it in child elements */
    border-radius: 0 10px 10px 0;
}

.analytics-panel.open {
    left: 0;
}

.analytics-panel-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: rgba(255, 255, 255, 0.97);
    z-index: 2;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.panel-nav {
    position: absolute;
    top: 50px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 10px 20px;
    background-color: rgba(255, 255, 255, 0.97);
    z-index: 2;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* Panel sections and tabs */
.panel-nav {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 10px;
}

.panel-nav-item {
    flex: 1;
    background: none;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    margin: 0 4px;
}

.panel-nav-item.active {
    background-color: rgba(25, 135, 84, 0.1);
    color: #198754;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.panel-nav-item:hover:not(.active) {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Стилі для перемикачів у вкладках */
.nav-tabs .form-switch {
    margin: 0 0 0 8px;
    display: flex;
    align-items: center;
}

.nav-tabs .form-check-input {
    width: 32px;
    height: 18px;
    cursor: pointer;
    margin-top: 0;
}

.nav-tabs .nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 14px;
}

.nav-tabs .nav-link i {
    margin-right: 0;
}

/* Ensure panel sections have clear transitions */
.panel-section-container {
    position: absolute;
    width: 100%;
    left: 0;
    right: 0;
    top: 0; 
    padding-top: 80px; /* Space for header and tabs */
    padding-left: 20px;
    padding-right: 20px;
    height: 100%;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    z-index: -1;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    background-color: rgba(255, 255, 255, 0.97);
}

.panel-section-container.active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

/* Ensure the analytics panel structure is clean */
.analytics-panel {
    position: fixed;
    left: -350px;
    top: 0;
    width: 350px;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.97);
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.2);
    z-index: 999;
    transition: left 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden; /* Changed from overflow-y: auto to prevent double scrollbars */
    padding: 0; /* Remove padding as we'll handle it in child elements */
    border-radius: 0 10px 10px 0;
}

.analytics-panel.open {
    left: 0;
}

.analytics-panel-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: rgba(255, 255, 255, 0.97);
    z-index: 2;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.panel-nav {
    position: absolute;
    top: 50px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 10px 20px;
    background-color: rgba(255, 255, 255, 0.97);
    z-index: 2;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* Panel sections and tabs */
.panel-nav {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 10px;
}

.panel-nav-item {
    flex: 1;
    background: none;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    margin: 0 4px;
}

.panel-nav-item.active {
    background-color: rgba(25, 135, 84, 0.1);
    color: #198754;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.panel-nav-item:hover:not(.active) {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Стилі для перемикачів у вкладках */
.nav-tabs .form-switch {
    margin: 0 0 0 8px;
    display: flex;
    align-items: center;
}

.nav-tabs .form-check-input {
    width: 32px;
    height: 18px;
    cursor: pointer;
    margin-top: 0;
}

.nav-tabs .nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 14px;
}

.nav-tabs .nav-link i {
    margin-right: 0;
}

/* Ensure panel sections have clear transitions */
.panel-section-container {
    position: absolute;
    width: 100%;
    left: 0;
    right: 0;
    top: 0; 
    padding-top: 80px; /* Space for header and tabs */
    padding-left: 20px;
    padding-right: 20px;
    height: 100%;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    z-index: -1;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    background-color: rgba(255, 255, 255, 0.97);
}

.panel-section-container.active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

/* Ensure the analytics panel structure is clean */
.analytics-panel {
    position: fixed;
    left: -350px;
    top: 0;
    width: 350px;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.97);
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.2);
    z-index: 999;
    transition: left 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden; /* Changed from overflow-y: auto to prevent double scrollbars */
    padding: 0; /* Remove padding as we'll handle it in child elements */
    border-radius: 0 10px 10px 0;
}

.analytics-panel.open {
    left: 0;
}

.analytics-panel-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: rgba(255, 255, 255, 0.97);
    z-index: 2;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.panel-nav {
    position: absolute;
    top: 50px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 10px 20px;
    background-color: rgba(255, 255, 255, 0.97);
    z-index: 2;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* Panel sections and tabs */
.panel-nav {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 10px;
}

.panel-nav-item {
    flex: 1;
    background: none;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    margin: 0 4px;
}

.panel-nav-item.active {
    background-color: rgba(25, 135, 84, 0.1);
    color: #198754;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.panel-nav-item:hover:not(.active) {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Стилі для перемикачів у вкладках */
.nav-tabs .form-switch {
    margin: 0 0 0 8px;
    display: flex;
    align-items: center;
}

.nav-tabs .form-check-input {
    width: 32px;
    height: 18px;
    cursor: pointer;
    margin-top: 0;
}

.nav-tabs .nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 14px;
}

.nav-tabs .nav-link i {
    margin-right: 0;
}

/* Ensure panel sections have clear transitions */
.panel-section-container {
    position: absolute;
    width: 100%;
    left: 0;
    right: 0;
    top: 0; 
    padding-top: 80px; /* Space for header and tabs */
    padding-left: 20px;
    padding-right: 20px;
    height: 100%;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    z-index: -1;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    background-color: rgba(255, 255, 255, 0.97);
}

.panel-section-container.active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

/* Ensure the analytics panel structure is clean */
.analytics-panel {
    position: fixed;
    left: -350px;
    top: 0;
    width: 350px;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.97);
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.2);
    z-index: 999;
    transition: left 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden; /* Changed from overflow-y: auto to prevent double scrollbars */
    padding: 0; /* Remove padding as we'll handle it in child elements */
    border-radius: 0 10px 10px 0;
}

.analytics-panel.open {
    left: 0;
}

.analytics-panel-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: rgba(255, 255, 255, 0.97);
    z-index: 2;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.panel-nav {
    position: absolute;
    top: 50px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 10px 20px;
    background-color: rgba(255, 255, 255, 0.97);
    z-index: 2;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* Panel sections and tabs */
.panel-nav {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 10px;
}

.panel-nav-item {
    flex: 1;
    background: none;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    margin: 0 4px;
}

.panel-nav-item.active {
    background-color: rgba(25, 135, 84, 0.1);
    color: #198754;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.panel-nav-item:hover:not(.active) {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Стилі для перемикачів у вкладках */
.nav-tabs .form-switch {
    margin: 0 0 0 8px;
    display: flex;
    align-items: center;
}

.nav-tabs .form-check-input {
    width: 32px;
    height: 18px;
    cursor: pointer;
    margin-top: 0;
}

.nav-tabs .nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 14px;
}

.nav-tabs .nav-link i {
    margin-right: 0;
}

/* Ensure panel sections have clear transitions */
.panel-section-container {
    position: absolute;
    width: 100%;
    left: 0;
    right: 0;
    top: 0; 
    padding-top: 80px; /* Space for header and tabs */
    padding-left: 20px;
    padding-right: 20px;
    height: 100%;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    z-index: -1;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    background-color: rgba(255, 255, 255, 0.97);
}

.panel-section-container.active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

/* Ensure the analytics panel structure is clean */
.analytics-panel {
    position: fixed;
    left: -350px;
    top: 0;
    width: 350px;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.97);
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.2);
    z-index: 999;
    transition: left 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden; /* Changed from overflow-y: auto to prevent double scrollbars */
    padding: 0; /* Remove padding as we'll handle it in child elements */
    border-radius: 0 10px 10px 0;
}

.analytics-panel.open {
    left: 0;
}

.analytics-panel-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: rgba(255, 255, 255, 0.97);
    z-index: 2;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.panel-nav {
    position: absolute;
    top: 50px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 10px 20px;
    background-color: rgba(255, 255, 255, 0.97);
    z-index: 2;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* Panel sections and tabs */
.panel-nav {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 10px;
}

.panel-nav-item {
    flex: 1;
    background: none;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    margin: 0 4px;
}

.panel-nav-item.active {
    background-color: rgba(25, 135, 84, 0.1);
    color: #198754;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.panel-nav-item:hover:not(.active) {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Стилі для перемикачів у вкладках */
.nav-tabs .form-switch {
    margin: 0 0 0 8px;
    display: flex;
    align-items: center;
}

.nav-tabs .form-check-input {
    width: 32px;
    height: 18px;
    cursor: pointer;
    margin-top: 0;
}

.nav-tabs .nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 14px;
}

.nav-tabs .nav-link i {
    margin-right: 0;
}

/* Ensure panel sections have clear transitions */
.panel-section-container {
    position: absolute;
    width: 100%;
    left: 0;
    right: 0;
    top: 0; 
    padding-top: 80px; /* Space for header and tabs */
    padding-left: 20px;
    padding-right: 20px;
    height: 100%;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    z-index: -1;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    background-color: rgba(255, 255, 255, 0.97);
}

.panel-section-container.active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

/* Ensure the analytics panel structure is clean */
.analytics-panel {
    position: fixed;
    left: -350px;
    top: 0;
    width: 350px;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.97);
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.2);
    z-index: 999;
    transition: left 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden; /* Changed from overflow-y: auto to prevent double scrollbars */
    padding: 0; /* Remove padding as we'll handle it in child elements */
    border-radius: 0 10px 10px 0;
}

.analytics-panel.open {
    left: 0;
}

.analytics-panel-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: rgba(255, 255, 255, 0.97);
    z-index: 2;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.panel-nav {
    position: absolute;
    top: 50px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 10px 20px;
    background-color: rgba(255, 255, 255, 0.97);
    z-index: 2;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* Panel sections and tabs */
.panel-nav {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 10px;
}

.panel-nav-item {
    flex: 1;
    background: none;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    margin: 0 4px;
}

.panel-nav-item.active {
    background-color: rgba(25, 135, 84, 0.1);
    color: #198754;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.panel-nav-item:hover:not(.active) {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Стилі для перемикачів у вкладках */
.nav-tabs .form-switch {
    margin: 0 0 0 8px;
    display: flex;
    align-items: center;
}

.nav-tabs .form-check-input {
    width: 32px;
    height: 18px;
    cursor: pointer;
    margin-top: 0;
}

.nav-tabs .nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 14px;
}

.nav-tabs .nav-link i {
    margin-right: 0;
}

/* Ensure panel sections have clear transitions */
.panel-section-container {
    position: absolute;
    width: 100%;
    left: 0;
    right: 0;
    top: 0; 
    padding-top: 80px; /* Space for header and tabs */
    padding-left: 20px;
    padding-right: 20px;
    height: 100%;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    z-index: -1;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    background-color: rgba(255, 255, 255, 0.97);
}

.panel-section-container.active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

/* Ensure the analytics panel structure is clean */
.analytics-panel {
    position: fixed;
    left: -350px;
    top: 0;
    width: 350px;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.97);
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.2);
    z-index: 999;
    transition: left 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden; /* Changed from overflow-y: auto to prevent double scrollbars */
    padding: 0; /* Remove padding as we'll handle it in child elements */
    border-radius: 0 10px 10px 0;
}

.analytics-panel.open {
    left: 0;
}

.analytics-panel-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: rgba(255, 255, 255, 0.97);
    z-index: 2;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.panel-nav {
    position: absolute;
    top: 50px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 10px 20px;
    background-color: rgba(255, 255, 255, 0.97);
    z-index: 2;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* Panel sections and tabs */
.panel-nav {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 10px;
}

.panel-nav-item {
    flex: 1;
    background: none;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    margin: 0 4px;
}

.panel-nav-item.active {
    background-color: rgba(25, 135, 84, 0.1);
    color: #198754;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.panel-nav-item:hover:not(.active) {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Стилі для перемикачів у вкладках */
.nav-tabs .form-switch {
    margin: 0 0 0 8px;
    display: flex;
    align-items: center;
}

.nav-tabs .form-check-input {
    width: 32px;
    height: 18px;
    cursor: pointer;
    margin-top: 0;
}

.nav-tabs .nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 14px;
}

.nav-tabs .nav-link i {
    margin-right: 0;
}

/* Ensure panel sections have clear transitions */
.panel-section-container {
    position: absolute;
    width: 100%;
    left: 0;
    right: 0;
    top: 0; 
    padding-top: 80px; /* Space for header and tabs */
    padding-left: 20px;
    padding-right: 20px;
    height: 100%;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    z-index: -1;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    background-color: rgba(255, 255, 255, 0.97);
}

.panel-section-container.active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

/* Ensure the analytics panel structure is clean */
.analytics-panel {
    position: fixed;
    left: -350px;
    top: 0;
    width: 350px;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.97);
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.2);
    z-index: 999;
    transition: left 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden; /* Changed from overflow-y: auto to prevent double scrollbars */
    padding: 0; /* Remove padding as we'll handle it in child elements */
    border-radius: 0 10px 10px 0;
}

.analytics-panel.open {
    left: 0;
}

.analytics-panel-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: rgba(255, 255, 255, 0.97);
    z-index: 2;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.panel-nav {
    position: absolute;
    top: 50px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 10px 20px;
    background-color: rgba(255, 255, 255, 0.97);
    z-index: 2;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* Panel sections and tabs */
.panel-nav {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 10px;
}

.panel-nav-item {
    flex: 1;
    background: none;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    margin: 0 4px;
}

.panel-nav-item.active {
    background-color: rgba(25, 135, 84, 0.1);
    color: #198754;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.panel-nav-item:hover:not(.active) {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Стилі для перемикачів у вкладках */
.nav-tabs .form-switch {
    margin: 0 0 0 8px;
    display: flex;
    align-items: center;
}

.nav-tabs .form-check-input {
    width: 32px;
    height: 18px;
    cursor: pointer;
    margin-top: 0;
}

.nav-tabs .nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 14px;
}

.nav-tabs .nav-link i {
    margin-right: 0;
}

/* Ensure panel sections have clear transitions */
.panel-section-container {
    position: absolute;
    width: 100%;
    left: 0;
    right: 0;
    top: 0; 
    padding-top: 80px; /* Space for header and tabs */
    padding-left: 20px;
    padding-right: 20px;
    height: 100%;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    z-index: -1;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    background-color: rgba(255, 255, 255, 0.97);
}

.panel-section-container.active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

/* Ensure the analytics panel structure is clean */
.analytics-panel {
    position: fixed;
    left: -350px;
    top: 0;
    width: 350px;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.97);
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.2);
    z-index: 999;
    transition: left 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden; /* Changed from overflow-y: auto to prevent double scrollbars */
    padding: 0; /* Remove padding as we'll handle it in child elements */
    border-radius: 0 10px 10px 0;
}

.analytics-panel.open {
    left: 0;
}

.analytics-panel-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: rgba(255, 255, 255, 0.97);
    z-index: 2;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.panel-nav {
    position: absolute;
    top: 50px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 10px 20px;
    background-color: rgba(255, 255, 255, 0.97);
    z-index: 2;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* Panel sections and tabs */
.panel-nav {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 10px;
}

.panel-nav-item {
    flex: 1;
    background: none;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    margin: 0 4px;
}

.panel-nav-item.active {
    background-color: rgba(25, 135, 84, 0.1);
    color: #198754;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.panel-nav-item:hover:not(.active) {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Стилі для перемикачів у вкладках */
.nav-tabs .form-switch {
    margin: 0 0 0 8px;
    display: flex;
    align-items: center;
}

.nav-tabs .form-check-input {
    width: 32px;
    height: 18px;
    cursor: pointer;
    margin-top: 0;
}

.nav-tabs .nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 14px;
}

.nav-tabs .nav-link i {
    margin-right: 0;
}

/* Ensure panel sections have clear transitions */
.panel-section-container {
    position: absolute;
    width: 100%;
    left: 0;
    right: 0;
    top: 0; 
    padding-top: 80px; /* Space for header and tabs */
    padding-left: 20px;
    padding-right: 20px;
    height: 100%;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    z-index: -1;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    background-color: rgba(255, 255, 255, 0.97);
}

.panel-section-container.active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

/* Ensure the analytics panel structure is clean */
.analytics-panel {
    position: fixed;
    left: -350px;
    top: 0;
    width: 350px;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.97);
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.2);
    z-index: 999;
    transition: left 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden; /* Changed from overflow-y: auto to prevent double scrollbars */
    padding: 0; /* Remove padding as we'll handle it in child elements */
    border-radius: 0 10px 10px 0;
}

.analytics-panel.open {
    left: 0;
}

.analytics-panel-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: rgba(255, 255, 255, 0.97);
    z-index: 2;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.panel-nav {
    position: absolute;
    top: 50px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 10px 20px;
    background-color: rgba(255, 255, 255, 0.97);
    z-index: 2;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* Panel sections and tabs */
.panel-nav {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 10px;
}

.panel-nav-item {
    flex: 1;
    background: none;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    margin: 0 4px;
}

.panel-nav-item.active {
    background-color: rgba(25, 135, 84, 0.1);
    color: #198754;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.panel-nav-item:hover:not(.active) {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Стилі для перемикачів у вкладках */
.nav-tabs .form-switch {
    margin: 0 0 0 8px;
    display: flex;
    align-items: center;
}

.nav-tabs .form-check-input {
    width: 32px;
    height: 18px;
    cursor: pointer;
    margin-top: 0;
}

.nav-tabs .nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 14px;
}

.nav-tabs .nav-link i {
    margin-right: 0;
}

/* Ensure panel sections have clear transitions */
.panel-section-container {
    position: absolute;
    width: 100%;
    left: 0;
    right: 0;
    top: 0; 
    padding-top: 80px; /* Space for header and tabs */
    padding-left: 20px;
    padding-right: 20px;
    height: 100%;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    z-index: -1;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    background-color: rgba(255, 255, 255, 0.97);
}

.panel-section-container.active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

/* Ensure the analytics panel structure is clean */
.analytics-panel {
    position: fixed;
    left: -350px;
    top: 0;
    width: 350px;
    height:  100%;
    background-color: rgba(255, 255, 255, 0.97);
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.2);
    z-index: 999;
    transition: left 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden; /* Changed from overflow-y: auto to prevent double scrollbars */
    padding: 0; /* Remove padding as we'll handle it in child elements */
    border-radius: 0 10px 10px 0;
}

.analytics-panel.open {
    left: 0;
}

.analytics-panel-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: rgba(255, 255, 255, 0.97);
    z-index: 2;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.panel-nav {
    position: absolute;
    top: 50px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 10px 20px;
    background-color: rgba(255, 255, 255, 0.97);
    z-index: 2;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* Panel sections and tabs */
.panel-nav {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 10px;
}

.panel-nav-item {
    flex: 1;
    background: none;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    margin: 0 4px;
}

.panel-nav-item.active {
    background-color: rgba(25, 135, 84, 0.1);
    color: #198754;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.panel-nav-item:hover:not(.active) {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Стилі для перемикачів у вкладках */
.nav-tabs .form-switch {
    margin: 0 0 0 8px;
    display: flex;
    align-items: center;
}

.nav-tabs .form-check-input {
    width: 32px;
    height: 18px;
    cursor: pointer;
    margin-top: 0;
}

.nav-tabs .nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 14px;
}

.nav-tabs .nav-link i {
    margin-right: 0;
}
