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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.header h1 {
    font-size: 2rem;
    margin: 0;
}

.header h1 i {
    margin-right: 1rem;
}

.last-update {
    font-size: 1rem;
    opacity: 0.9;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Статистика IMDF */
.imdf-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 1rem 0;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: #3b82f6;
}

.stat-label {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Сообщения о загрузке и ошибках */
.loading, .error, .no-data {
    text-align: center;
    padding: 3rem;
    font-size: 1.2rem;
    background: white;
    margin: 1rem 0;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.error {
    color: #ef4444;
    border-left: 4px solid #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.loading {
    color: #3b82f6;
    border-left: 4px solid #3b82f6;
}

.no-data {
    color: #6b7280;
    border-left: 4px solid #6b7280;
}

.no-data h3 {
    margin: 1rem 0 0.5rem 0;
    color: #374151;
}

.no-data p {
    margin-bottom: 1.5rem;
    color: #6b7280;
}

.retry-btn, .demo-btn, .refresh-btn {
    padding: 0.75rem 1.5rem;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.retry-btn:hover, .demo-btn:hover, .refresh-btn:hover {
    background: #2563eb;
}

.demo-btn {
    background: #10b981;
}

.demo-btn:hover {
    background: #059669;
}

.refresh-btn {
    background: #8b5cf6;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.refresh-btn:hover {
    background: #7c3aed;
}

/* Фильтры */
.filters {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 600;
    color: #555;
}

.filter-group select {
    padding: 0.75rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    transition: border-color 0.3s;
    min-width: 200px;
}

.filter-group select:focus {
    outline: none;
    border-color: #667eea;
}

/* Легенда */
.legend {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.color-box {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid rgba(0, 0, 0, 0.1);
}

.color-box.excellent { background-color: #10b981; }
.color-box.good { background-color: #3b82f6; }
.color-box.fair { background-color: #f59e0b; }
.color-box.poor { background-color: #ef4444; }

/* Сетка аудиторий */
.classrooms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.classroom-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    border-left: 6px solid #e1e5e9;
}

.classroom-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.classroom-card.excellent { border-left-color: #10b981; }
.classroom-card.good { border-left-color: #3b82f6; }
.classroom-card.fair { border-left-color: #f59e0b; }
.classroom-card.poor { border-left-color: #ef4444; }

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.card-header h3 {
    font-size: 1.25rem;
    color: #1f2937;
    margin: 0;
}

.quality-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
}

.excellent .quality-badge { background-color: #10b981; color: white; }
.good .quality-badge { background-color: #3b82f6; color: white; }
.fair .quality-badge { background-color: #f59e0b; color: white; }
.poor .quality-badge { background-color: #ef4444; color: white; }

.room-info {
    margin-bottom: 1rem;
}

.room-info p {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: #6b7280;
    font-size: 0.9rem;
}

.sensor-data {
    margin-bottom: 1rem;
}

.data-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
}

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

.data-item .label {
    color: #6b7280;
}

.data-item .value {
    font-weight: 600;
    color: #1f2937;
}

.last-updated {
    text-align: right;
    color: #9ca3af;
    font-size: 0.875rem;
}

/* Статистика */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-value.excellent { color: #10b981; }
.stat-value.good { color: #3b82f6; }
.stat-value.fair { color: #f59e0b; }
.stat-value.poor { color: #ef4444; }
/* Стили для навигации между видами */
.view-navigation {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.view-btn {
    padding: 1rem 2rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    background: white;
    color: #6b7280;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.view-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.view-btn.active {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

/* Стили для карты */
.map-view {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    height: 70vh;
    width: 100%; /* Добавляем полную ширину */
    margin-bottom: 2rem; /* Отступ снизу */
}

#campus-map {
    height: 100%;
    width: 100%;
    min-height: 500px; /* Минимальная высота */
}

/* Улучшаем адаптивность контейнера */
.container {
    max-width: 1400px; /* Увеличиваем максимальную ширину */
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

/* Улучшаем отображение на мобильных */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .map-view {
        height: 50vh;
        min-height: 400px;
    }
    
    .filters {
        flex-direction: column;
        gap: 1rem;
    }
    
    .filter-group select {
        min-width: 100%;
    }
}

/* Улучшаем отображение попапов */
.map-popup {
    min-width: 280px;
    max-width: 350px;
}

.map-popup h3 {
    margin: 0 0 0.5rem 0;
    color: #1f2937;
    font-size: 1.1rem;
}

.map-popup p {
    margin: 0.25rem 0;
    color: #6b7280;
    font-size: 0.9rem;
}

.map-popup .sensor-data {
    margin: 0.75rem 0;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 6px;
    border-left: 3px solid #3b82f6;
}

.details-btn {
    width: 100%;
    padding: 0.75rem;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 0.75rem;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.details-btn:hover {
    background: #2563eb;
}

/* Легенда карты */
.map-legend {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-size: 0.875rem;
}

.map-legend h4 {
    margin: 0 0 0.5rem 0;
    color: #1f2937;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.legend-item .color-box {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.2);
}

.color-box.excellent { background-color: #10b981; }
.color-box.good { background-color: #3b82f6; }
.color-box.fair { background-color: #f59e0b; }
.color-box.poor { background-color: #ef4444; }
.color-box.no-data { background-color: #9ca3af; }

/* Стили для детального просмотра */
.room-detail-view {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 2rem;
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.back-btn {
    padding: 0.5rem 1rem;
    background: #6b7280;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.back-btn:hover {
    background: #4b5563;
}

.room-detail-content {
    display: grid;
    gap: 2rem;
}

.room-info, .sensor-data, .charts-section {
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 8px;
}

.room-info h3, .sensor-data h3, .charts-section h3 {
    margin: 0 0 1rem 0;
    color: #1f2937;
}

.data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.charts-placeholder {
    text-align: center;
    padding: 3rem;
    color: #6b7280;
}

/* Адаптивность */
@media (max-width: 768px) {
    .view-navigation {
        flex-direction: column;
    }
    
    .map-view {
        height: 50vh;
    }
    
    .data-grid {
        grid-template-columns: 1fr;
    }
}
/* Стили для фильтра этажей */
.floor-filter {
    margin-bottom: 1rem;
}

.floor-filter label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #374151;
}

.floor-select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.floor-select:focus {
    outline: none;
    border-color: #3b82f6;
}

/* Индикатор текущего этажа */
.floor-indicator {
    background: white;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-weight: 600;
    color: #374151;
    margin-bottom: 1rem;
}
.current-floor {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e5e7eb;
    color: #374151;
}

/* Адаптивность для фильтров */
@media (max-width: 768px) {
    .filters {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .filter-group {
        margin-bottom: 0;
    }
}

/* Стили для графиков */
.charts-section {
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 8px;
}

.charts-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-top: 1rem;
}

.chart-wrapper {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.chart-wrapper h4 {
    margin: 0 0 1rem 0;
    color: #374151;
    font-size: 1.1rem;
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

.loading-charts {
    text-align: center;
    padding: 3rem;
    color: #3b82f6;
    font-size: 1.1rem;
}

.no-charts-data {
    text-align: center;
    padding: 3rem;
    color: #6b7280;
}

/* Адаптивность для графиков */
@media (max-width: 768px) {
    .charts-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .chart-container {
        height: 250px;
    }
}
.no-chart-data {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #6b7280;
    font-style: italic;
}
/* Стили для блока аутентификации */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    flex-wrap: wrap;
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.auth-block {
    margin-left: 2rem;
}

.auth-status {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.auth-status.admin-authenticated {
    background: linear-gradient(135deg, #10b981, #059669);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.auth-message {
    color: white;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.auth-btn {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.auth-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.logout-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.logout-btn:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

/* Модальное окно */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

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

.modal-header {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 1.5rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group input {
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group input:disabled {
    background-color: #f9fafb;
    cursor: not-allowed;
}

.error-message {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 0.75rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

.btn-secondary:hover:not(:disabled) {
    background: #e5e7eb;
}

.demo-hint {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    color: #0369a1;
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-top: 1rem;
}

.demo-hint p {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Адаптивность */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .header-right {
        align-items: center;
        width: 100%;
    }
    
    .auth-block {
        margin-left: 0;
        width: 100%;
    }
    
    .auth-status {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Улучшенные стили для кнопки входа */
.auth-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #4F46E5, #7C3AED);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.2);
}

.auth-btn:hover {
    background: linear-gradient(135deg, #4338CA, #6D28D9);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(79, 70, 229, 0.3);
}

.auth-btn:active {
    transform: translateY(0);
}

.auth-btn.logout-btn {
    background: linear-gradient(135deg, #DC2626, #B91C1C);
    box-shadow: 0 4px 6px rgba(220, 38, 38, 0.2);
}

.auth-btn.logout-btn:hover {
    background: linear-gradient(135deg, #B91C1C, #991B1B);
    box-shadow: 0 6px 12px rgba(220, 38, 38, 0.3);
}

.auth-status.admin-authenticated {
    background: linear-gradient(135deg, #059669, #047857);
    padding: 8px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 6px rgba(5, 150, 105, 0.2);
}

.auth-message {
    color: white;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.last-update {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
}

.last-update span {
    font-weight: 600;
}

/* Улучшенный хедер */
.header {
    background: linear-gradient(135deg, #1E40AF, #1E3A8A);
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
        padding: 15px 20px;
    }
    
    .header-right {
        width: 100%;
        align-items: center;
    }
    
    .auth-status {
        flex-direction: column;
        gap: 10px;
    }
    
    .auth-status.admin-authenticated {
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
    }
}
/* Стили для поля поиска */
.filter-group.search-filter {
    position: relative;
    min-width: 250px;
}

.filter-group.search-filter input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
    background: white;
}

.filter-group.search-filter input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filter-group.search-filter i {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

/* Стили для кнопки перехода к реальным данным */
.switch-mode-btn {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.switch-mode-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    transform: translateY(-1px);
}

/* Стили для блока статуса данных */
.data-status {
    margin-bottom: 1.5rem;
}

.demo-mode, .real-mode {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.demo-mode {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 1px solid #f59e0b;
    color: #92400e;
}

.real-mode {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    border: 1px solid #3b82f6;
    color: #1e40af;
}

.real-mode .last-update {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Уведомление об устаревших данных */
.update-notification {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 1px solid #f59e0b;
    color: #92400e;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.update-btn {
    padding: 0.5rem 1rem;
    background: #f59e0b;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.update-btn:hover {
    background: #d97706;
}
/* Стили для контрола этажей на карте */
.floor-control {
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 60px;
    max-height: 400px;
    overflow-y: auto;
    padding: 5px 0;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.floor-control::-webkit-scrollbar {
    width: 6px;
}

.floor-control::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.floor-control::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.floor-button {
    display: block;
    width: 100%;
    padding: 12px 15px;
    border: none;
    background: white;
    color: #374151;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 0;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    user-select: none;
}

.floor-button:hover {
    background: #f3f4f6;
}

.floor-button.active {
    background: #3b82f6 !important;
    color: white !important;
    font-weight: 700 !important;
}

.floor-button:first-child {
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
}

.floor-button:last-child {
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
}

/* Скрываем фильтр этажей на вкладке карты */
.view-map .floor-filter-group {
    display: none !important;
}

/* Адаптивность контрола этажей */
@media (max-width: 768px) {
    .floor-control {
        top: 50%;
        left: 10px;
        transform: translateY(-50%);
        min-width: 50px;
        max-height: 300px;
    }
    
    .floor-button {
        padding: 10px 12px;
        font-size: 14px;
    }
}
/* Индикатор текущего этажа на карте */
.map-floor-indicator {
    position: absolute;
    top: 10px;
    right: 90px;
    background: rgba(255, 255, 255, 0.95);
    padding: 8px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    z-index: 999;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

.map-floor-indicator i {
    color: #3b82f6;
}

/* Адаптивность индикатора */
@media (max-width: 768px) {
    .map-floor-indicator {
        top: 5px;
        right: 70px;
        font-size: 12px;
        padding: 6px 10px;
    }
}
/* Стили для разных состояний фильтров */
.filter-group {
    transition: opacity 0.3s ease;
}

/* Показываем/скрываем фильтры в зависимости от вью */
.view-list .filter-group[data-for-map],
.view-map .filter-group[data-for-list] {
    display: none;
}
/* Сообщение "Аудитории не найдены" */
.no-data {
    text-align: center;
    padding: 3rem;
    font-size: 1.1rem;
    color: #6b7280;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-top: 2rem;
}

.no-data h3 {
    margin: 1rem 0;
    color: #374151;
}

.no-data p {
    margin-bottom: 1rem;
}
.device-control-modal .modal-content {
    max-width: 600px;
}

.device-info {
    background: #f3f4f6;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.commands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.command-btn {
    padding: 0.75rem;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background-color 0.3s;
}

.command-btn:hover:not(:disabled) {
    background: #2563eb;
}

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

.command-result {
    margin-top: 1rem;
    padding: 1rem;
    background: #1f2937;
    color: #f9fafb;
    border-radius: 6px;
    overflow-x: auto;
}

.command-result.success {
    border-left: 4px solid #10b981;
}

.command-result.failed {
    border-left: 4px solid #ef4444;
}

.command-result pre {
    margin: 0.5rem 0 0;
    font-size: 0.85rem;
    white-space: pre-wrap;
}

.loading-spinner {
    text-align: center;
    padding: 2rem;
    color: #3b82f6;
}

.device-control-btn {
    padding: 0.5rem 1rem;
    background: #8b5cf6;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.device-control-btn:hover {
    background: #7c3aed;
}
.command-btn.power-on {
    background: #10b981;
}
.command-btn.power-on:hover {
    background: #059669;
}
.command-btn.power-off {
    background: #ef4444;
}
.command-btn.power-off:hover {
    background: #dc2626;
}
.command-btn.ota-update {
    background: #8b5cf6;
}
.command-btn.ota-update:hover {
    background: #7c3aed;
}
.command-btn.ota-rollback {
    background: #f97316;
}
.command-btn.ota-rollback:hover {
    background: #ea580c;
}