* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
}

/* ==================== LOADING SCREEN ==================== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #2c3e50;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s;
}

.loading-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-content i {
    font-size: 3rem;
    color: #3498db;
    margin-bottom: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==================== MAIN TOOLBAR ==================== */
.main-toolbar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    padding: 8px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 2000;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.toolbar-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #2c3e50;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toolbar-btn:hover {
    background: #3498db;
    color: white;
    transform: scale(1.1);
}

.toolbar-divider {
    width: 1px;
    height: 30px;
    background: #e0e0e0;
    margin: 0 5px;
}

.toolbar-info {
    padding: 0 10px;
    color: #2c3e50;
    font-weight: bold;
}

/* ==================== FLOATING PANELS ==================== */
.floating-panel {
    position: fixed;
    top: 80px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.2);
    z-index: 1900;
    width: 360px;
    max-height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.98);
}

.floating-panel.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.stats-panel {
    left: 20px;
}

.sidebar-panel {
    left: 20px;
}

.legend-panel {
    right: 20px;
}

.panel-header {
    padding: 15px 20px;
    border-bottom: 1px solid #ecf0f1;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-header h3 {
    font-size: 1rem;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-header h3 i {
    color: #3498db;
}

.panel-actions {
    display: flex;
    gap: 5px;
}

.panel-btn {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: #7f8c8d;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-btn:hover {
    background: #f0f0f0;
    color: #e74c3c;
}

.panel-content {
    padding: 15px;
    overflow-y: auto;
    flex: 1;
}

.panel-footer {
    padding: 12px 15px;
    border-top: 1px solid #ecf0f1;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
    display: flex;
    justify-content: space-around;
    font-size: 0.85rem;
    color: #2c3e50;
}

.panel-footer div {
    display: flex;
    align-items: center;
    gap: 5px;
}

.panel-footer i {
    color: #3498db;
}

/* ==================== SIDEBAR CONTENT ==================== */
.filters-section, .search-section, .list-section {
    margin-bottom: 20px;
}

.filters-section h4, .search-section h4 {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 10px;
}

.filter-group {
    margin-bottom: 12px;
}

.filter-group label {
    display: block;
    font-size: 0.8rem;
    color: #7f8c8d;
    margin-bottom: 4px;
}

.filter-group select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9rem;
}

.btn-reset {
    width: 100%;
    padding: 8px;
    background: #f0f0f0;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.btn-reset:hover {
    background: #e0e0e0;
}

/* Active filters */
.active-filters {
    margin: 10px 0;
}

#filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.filter-tag {
    background: #3498db;
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.filter-tag i {
    cursor: pointer;
}

.filter-tag i:hover {
    color: #e74c3c;
}

/* Search box */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 10px;
    color: #95a5a6;
}

.search-box input {
    width: 100%;
    padding: 10px 35px 10px 35px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.search-box .clear-btn {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: #95a5a6;
    cursor: pointer;
    display: none;
}

/* FDT List */
.list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

#fdt-count {
    background: #3498db;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    margin-left: 5px;
}

.fdt-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ecf0f1;
    border-radius: 6px;
}

.fdt-item {
    background: #f8f9fa;
    padding: 10px;
    border-bottom: 1px solid #ecf0f1;
    cursor: pointer;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.fdt-item:hover {
    background: #f0f0f0;
    transform: translateX(3px);
}

.fdt-item.active {
    background: #e3f2fd;
    border-left-color: #3498db;
}

.fdt-name {
    font-weight: bold;
    margin-bottom: 3px;
}

.fdt-details {
    font-size: 0.75rem;
    color: #7f8c8d;
}

/* ==================== LEGEND ==================== */
.legend-section {
    margin-bottom: 15px;
}

.legend-section h4 {
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-bottom: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.legend-color {
    width: 15px;
    height: 15px;
    border-radius: 3px;
}

/* ==================== SEARCH RESULTS ==================== */
.search-results-dropdown {
    position: fixed;
    top: 130px;
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    z-index: 2100;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

.search-results-dropdown.active {
    display: block;
}

.search-result-item {
    padding: 10px 15px;
    border-bottom: 1px solid #ecf0f1;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-result-item:hover {
    background: #f5f6fa;
}

/* ==================== MAP ==================== */
#map {
    width: 100vw;
    height: 100vh;
    z-index: 1;
}

/* ==================== STATUS BADGES ==================== */
.status-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: bold;
    text-transform: uppercase;
}

.status-active { background: #27ae60; color: white; }
.status-warning { background: #f39c12; color: white; }
.status-critical { background: #e74c3c; color: white; }
.status-pending { background: #95a5a6; color: white; }
.status-unknown { background: #7f8c8d; color: white; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .main-toolbar {
        top: 10px;
        padding: 5px 10px;
    }
    
    .toolbar-btn {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .floating-panel {
        width: 300px;
    }
    
    .search-results-dropdown {
        width: 300px;
    }
}