body {
    font-family: Arial, sans-serif;
    background-color: #f0f2f5;
    margin: 0;
    padding: 20px;
}

.top-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: white;
    padding: 10px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    height: 40px;
}

.top-panel-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    height: 100%;
}

.container {
    max-width: 800px;
    margin: 60px auto 0;
    background: white;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.back-btn {
    background-color: #0066cc;
    color: white;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    padding: 0;
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.back-btn:hover {
    background-color: #0052a3;
    transform: translateY(-50%) scale(1.05);
}

.back-btn:active {
    background-color: #003d7a;
    transform: translateY(-50%) scale(0.95);
}

.back-btn::before {
    content: "";
    width: 24px;
    height: 24px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.error-message {
    background-color: #fee;
    color: #c00;
    padding: 15px;
    border-radius: 4px;
    margin: 20px;
    text-align: center;
}
.user-info {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}
.user-info h2 {
    color: #2c3e50;
    margin-top: 0;
}
.tasks-section {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.tasks-section h2 {
    color: #2c3e50;
    margin-top: 0;
}
.tasks-list {
    display: grid;
    gap: 15px;
    margin-top: 20px;
}
.task-item {
    background-color: #f8f9fa;
    border-radius: 6px;
    padding: 15px;
    border: 1px solid #e9ecef;
}
.task-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}
.task-type {
    color: #0066cc;
    font-weight: 500;
}
.task-status {
    color: #28a745;
    font-weight: 500;
}
.task-body {
    margin-bottom: 10px;
}
.task-description {
    margin: 0 0 10px 0;
    color: #2c3e50;
}
.task-address {
    margin: 0;
    color: #6c757d;
}
.task-footer {
    color: #6c757d;
    font-size: 0.9em;
}
.no-tasks {
    text-align: center;
    color: #6c757d;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 6px;
}
.abonents-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
}
.abonent-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}
.abonent-info {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}
.abonent-name {
    font-size: 20px;
    font-weight: 500;
    color: #333;
    margin-bottom: 5px;
}
.abonent-phone {
    font-size: 16px;
    color: #666;
}
.apartments-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}
.apartment-item {
    background: white;
    border-radius: 12px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
    cursor: pointer;
}
.apartment-item:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0,123,255,0.2);
    transform: translateY(-2px);
}
.apartment-address {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin-bottom: 10px;
    text-align: center;
}
.apartment-details {
    font-size: 14px;
    color: #666;
    text-align: center;
}
.apartment-number {
    margin-bottom: 5px;
    font-weight: 500;
}
.apartment-account {
    margin-bottom: 5px;
    color: #666;
}
.apartment-balance {
    color: #28a745;
    font-weight: 500;
    margin-bottom: 5px;
}
.apartment-last-online {
    color: #888;
    font-size: 13px;
}
.apartment-name {
    font-size: 16px;
    font-weight: 500;
    color: #0066cc;
    margin-bottom: 10px;
    text-align: center;
}
.negative-balance {
    color: #dc3545 !important;
}
.no-results {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 20px;
}
.devices-list {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.device-item {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 10px;
}
.device-id {
    font-weight: 500;
    color: #495057;
    margin-bottom: 5px;
}
.device-last-online {
    color: #6c757d;
    font-size: 13px;
}
.add-apartment-btn {
    text-align: center;
    margin: 20px 0;
}
.add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    background-color: #28a745;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid #28a745;
}
.add-btn:hover {
    background-color: white;
    color: #28a745;
}
.plus-icon {
    font-size: 24px;
    font-weight: bold;
    margin-right: 8px;
    line-height: 1;
}

/* Unified floating buttons styles */

/* Плавающие кнопки в правом нижнем углу */
.floating-buttons {
    position: fixed;
    right: 20px;
    bottom: 80px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 1000;
}

.floating-btn {
    background-color: #0066cc;
    color: white;
    border: none;
    width: 56px;
    height: 56px;
    border-radius: 28px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3), 0 0 0 4px rgba(255, 255, 255, 0.4);
    opacity: 0.7;
    visibility: hidden;
    transform: translateY(20px);
}

.floating-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.floating-btn:hover {
    background-color: #0052a3;
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 102, 204, 0.4), 0 0 0 4px rgba(255, 255, 255, 0.6);
    opacity: 1.0;
}

.floating-btn:active {
    background-color: #003d7a;
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 3px 8px rgba(0, 102, 204, 0.3), 0 0 0 4px rgba(255, 255, 255, 0.4);
}

.floating-btn .arrow-up-icon {
    width: 24px;
    height: 24px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m18 15-6-6-6 6'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
}

.floating-btn .arrow-left-icon {
    width: 24px;
    height: 24px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 18-6-6 6-6'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
}

.floating-btn .home-icon {
    width: 24px;
    height: 24px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3Cpolyline points='9,22 9,12 15,12 15,22'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
}

.floating-btn .arrow-down-icon {
    width: 24px;
    height: 24px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
}

/* Кнопки "НАЗАД" и "ДОМОЙ" (всегда видимы) */
.floating-always-visible {
    opacity: 0.7 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

/* Градиентный заголовок в верхней панели */
.top-panel-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 20px;
    margin: 0; /* Убираем отступы - заголовок прилегает к панели */
    width: 100%; /* Заголовок занимает всю ширину контейнера */
    text-align: center;
    box-shadow: none; /* Убираем тень, чтобы не выглядело как кнопка */
    border-radius: 0; /* Убираем скругления по умолчанию */
    cursor: default; /* Убираем курсор-pointer */
    box-sizing: border-box; /* Включаем padding в общую ширину */
    
    /* На больших экранах - скругления только сверху */
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}

/* Общие стили для фиксированного заголовка */
.top-panel-header.fixed-header {
    position: fixed !important;
    top: 0;
    z-index: 1000;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15); /* Усиливаем тень для фиксированного элемента */
}

/* Общие стили для body с фиксированным заголовком */
body.fixed-header-page {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

.top-panel-title {
    font-size: 20px;
    font-weight: bold;
    margin: 0;
    line-height: 1.2;
    cursor: default; /* Убираем курсор-pointer */
    pointer-events: none; /* Отключаем возможность клика */
}

/* Переопределяем стили для top-panel-content */
.top-panel .top-panel-content {
    display: block !important;
    width: 100% !important;
    padding: 0 !important;
}

/* Mobile responsive styles for floating buttons */
@media (max-width: 768px) {
    .top-panel-header {
        padding: 20px 0; /* Убираем боковые отступы */
        margin: 0; /* Убираем отступы */
        /* Убираем скругления сверху на узких экранах */
        border-top-left-radius: 0;
        border-top-right-radius: 0;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        width: 100%; /* На всю ширину контейнера */
        box-shadow: none;
    }
    
    /* Мобильные стили для фиксированного заголовка */
    .top-panel-header.fixed-header {
        position: fixed !important;
        top: 0;
        left: 0;
        transform: none;
        max-width: none; /* На мобильных убираем ограничение ширины */
        width: 100%; /* Полная ширина экрана на мобильных */
        border-top-left-radius: 0; /* Убираем скругления сверху на узких экранах */
        border-top-right-radius: 0;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    }
    
    .top-panel-title {
        font-size: 18px;
    }
    
    .floating-buttons {
        right: 15px;
        bottom: 75px;
        gap: 12px;
    }
    
    .floating-btn {
        width: 50px;
        height: 50px;
        border-radius: 25px;
    }
    
    .floating-btn .arrow-up-icon,
    .floating-btn .arrow-left-icon,
    .floating-btn .home-icon {
        width: 20px;
        height: 20px;
    }
    
    .floating-btn .arrow-down-icon {
        width: 20px;
        height: 20px;
    }
}

/* Unified reCAPTCHA styles for all devices */

/* Base reCAPTCHA styles */
.g-recaptcha {
    margin: 20px 0;
    text-align: center;
    transform-origin: center top;
    transition: transform 0.3s ease;
}

/* All screens 310px and wider - Full size (reCAPTCHA ~300px fits with 5px margin each side) */
@media (min-width: 310px) {
    .g-recaptcha {
        transform: scale(1);
        margin: 25px 0;
    }
}

/* Screens 290-309px - Scale to fit with 5px margin */
@media (min-width: 290px) and (max-width: 309px) {
    .g-recaptcha {
        transform: scale(0.97); /* (300-10)/300 = 0.967 ≈ 0.97 */
        margin: 22px 0;
        transform-origin: center top;
    }
}

/* Screens 270-289px - Scale to fit with 5px margin */
@media (min-width: 270px) and (max-width: 289px) {
    .g-recaptcha {
        transform: scale(0.9); /* (280-10)/300 = 0.9 */
        margin: 20px 0;
        transform-origin: center top;
    }
}

/* Screens 250-269px - Scale to fit with 5px margin */
@media (min-width: 250px) and (max-width: 269px) {
    .g-recaptcha {
        transform: scale(0.83); /* (260-10)/300 = 0.833 ≈ 0.83 */
        margin: 18px 0;
        transform-origin: center top;
    }
}

/* Screens 230-249px - Scale to fit with 5px margin */
@media (min-width: 230px) and (max-width: 249px) {
    .g-recaptcha {
        transform: scale(0.77); /* (240-10)/300 = 0.767 ≈ 0.77 */
        margin: 15px 0;
        transform-origin: center top;
    }
}

/* Very small screens <230px - Scale to fit with 5px margin */
@media (max-width: 229px) {
    .g-recaptcha {
        transform: scale(0.7); /* (220-10)/300 = 0.7 */
        margin: 12px 0;
        transform-origin: center top;
    }
} 

/* --- HINT POPUP (tooltip/modal) --- */
.hint-popup, .hint-tooltip, .hint-modal {
    position: fixed !important;
    z-index: 3000 !important;
    pointer-events: auto;
    background: linear-gradient(135deg, #fffbe8 0%, #ffe9ec 100%);
    color: #333;
    border: 1.5px solid #ffd700;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 2px 8px #ffd70033;
    padding: 16px 22px;
    font-size: 16px;
    max-width: 90vw;
    word-break: break-word;
    display: none;
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
    transition: opacity 0.25s cubic-bezier(.4,2,.6,1), transform 0.25s cubic-bezier(.4,2,.6,1);
}
.hint-popup.active, .hint-tooltip.active, .hint-modal.active {
    display: block !important;
    opacity: 1;
    transform: translateY(0) scale(1);
} 

/* --- ДОПОЛНЕНИЯ ДЛЯ ПЛАВАЮЩИХ КНОПОК (унификация с login_cabinet и lkumain_template_chats) --- */
.floating-buttons {
    opacity: 0.7;
    transition: opacity 0.3s ease;
}
.floating-buttons:hover {
    opacity: 1;
}
.floating-btn {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.floating-btn:hover {
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}
@media (max-width: 768px) {
    .floating-buttons {
        opacity: 0.6 !important;
    }
    .floating-buttons:hover {
        opacity: 0.9 !important;
    }
    .floating-btn {
        opacity: 0.7 !important;
        backdrop-filter: blur(8px) !important;
        -webkit-backdrop-filter: blur(8px) !important;
    }
    .floating-btn:hover {
        opacity: 0.9 !important;
    }
}
/* --- КОНЕЦ ДОПОЛНЕНИЙ --- */ 