* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f4f4f4;
}

header {
    background: #2c3e50;
    color: #fff;
    padding: 1rem 0;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

h1 {
    margin-bottom: 0.5rem;
}

nav {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem;
}

.nav-link {
    color: #fff;
    text-decoration: none;
    padding: 0.5rem 1rem;
    margin: 0;
    display: inline-block;
    border-radius: 3px;
    transition: background 0.3s;
    font-size: 0.95rem;
}

.nav-link:hover, .nav-link.active {
    background: #e67e22;
}

main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    min-height: 70vh;
}

.page {
    display: none;
}

.active-page {
    display: block;
}

.card {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
    border-bottom: 2px solid #e67e22;
    padding-bottom: 0.5rem;
    display: inline-block;
}

h3 {
    color: #2c3e50;
    margin: 1rem 0 0.5rem 0;
}

.news-item {
    border-left: 4px solid #e67e22;
    padding: 0.8rem;
    margin: 1rem 0;
    background: #f9f9f9;
}

.news-date {
    color: #e67e22;
    font-size: 0.85rem;
    font-weight: bold;
    margin-bottom: 0.3rem;
}

.contact-info p {
    margin: 0.8rem 0;
}

ul {
    padding-left: 1.5rem;
}

li {
    margin: 0.5rem 0;
}

a {
    color: #e67e22;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

footer {
    background: #2c3e50;
    color: #fff;
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
}

.map-container {
    margin: 1rem 0;
    border-radius: 8px;
    overflow: hidden;
}

/* Стили для новых элементов */
.quick-link {
    display: inline-block;
    background: #e67e22;
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    text-decoration: none;
    transition: background 0.3s;
}

.quick-link:hover {
    background: #d35400;
    text-decoration: none;
}

.alert {
    padding: 1rem;
    border-radius: 5px;
    margin: 1rem 0;
}

.alert-warning {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    color: #856404;
}

.alert-info {
    background: #d1ecf1;
    border-left: 4px solid #17a2b8;
    color: #0c5460;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.stat-item {
    background: #e67e22;
    color: #fff;
    padding: 1rem;
    text-align: center;
    border-radius: 5px;
    font-weight: bold;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    background: #f0f0f0;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    transition: transform 0.3s;
}

.gallery-item:hover {
    transform: scale(1.05);
}

.gallery-item .placeholder {
    font-size: 3rem;
}

.calculator {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.calculator input, .calculator select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.calculator button, button {
    background: #e67e22;
    color: #fff;
    border: none;
    padding: 0.7rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
}

.calculator button:hover, button:hover {
    background: #d35400;
}

#payment-result {
    margin-top: 1rem;
    padding: 1rem;
    background: #d4edda;
    border-radius: 5px;
    font-weight: bold;
    text-align: center;
}

.social-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 1rem 0;
}

.social-btn {
    display: inline-block;
    padding: 0.7rem 1.2rem;
    border-radius: 5px;
    text-decoration: none;
    color: #fff;
    font-weight: bold;
    transition: transform 0.2s;
}

.social-btn:hover {
    transform: translateY(-2px);
    text-decoration: none;
}

.whatsapp { background: #25D366; }
.whatsapp-group { background: #075E54; }
.telegram { background: #0088cc; }
.vk { background: #4a76a8; }
.ok { background: #ee8208; }

.logout-btn {
    background: #dc3545;
    margin-top: 1rem;
}

.logout-btn:hover {
    background: #c82333;
}

input, textarea {
    width: 100%;
    padding: 0.5rem;
    margin: 0.5rem 0;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: inherit;
}

textarea {
    resize: vertical;
}

.event-item {
    background: #f8f9fa;
    padding: 1rem;
    margin: 0.5rem 0;
    border-radius: 5px;
    border-left: 3px solid #e67e22;
}

.event-date {
    font-weight: bold;
    color: #e67e22;
}

.vote-item {
    background: #f8f9fa;
    padding: 1rem;
    margin: 0.5rem 0;
    border-radius: 5px;
}

.vote-option {
    margin: 0.5rem 0;
}

.vote-option button {
    margin-left: 1rem;
    padding: 0.3rem 0.8rem;
    font-size: 0.9rem;
}

.meter-history {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #666;
}

/* Адаптивность */
@media (max-width: 768px) {
    .nav-link {
        padding: 0.4rem 0.7rem;
        font-size: 0.85rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .card {
        padding: 1rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .social-buttons {
        flex-direction: column;
    }
    
    .social-btn {
        text-align: center;
    }
}



/* Дополнительные стили для админ-панели */
.subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: -5px;
}

#user-role-badge {
    text-align: center;
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-weight: bold;
}

.role-chairman { background: linear-gradient(135deg, #ffd700, #ff8c00); color: #333; }
.role-board { background: linear-gradient(135deg, #3498db, #2980b9); color: #fff; }
.role-member { background: linear-gradient(135deg, #2ecc71, #27ae60); color: #fff; }

.chairman-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 15px 0;
}

.chairman-buttons button {
    background: #e67e22;
}

.vote-results-item {
    background: #f8f9fa;
    padding: 15px;
    margin: 10px 0;
    border-radius: 8px;
    border-left: 4px solid #e67e22;
}

.vote-details {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #ddd;
    font-size: 0.9rem;
}

.member-item {
    background: #f8f9fa;
    padding: 10px;
    margin: 5px 0;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.member-vote-status {
    font-size: 0.85rem;
    color: #e67e22;
}

.status-voted { color: #27ae60; font-weight: bold; }
.status-not-voted { color: #e74c3c; }

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
}

.modal-content input, .modal-content textarea {
    width: 100%;
    margin: 10px 0;
    padding: 8px;
}

.close {
    float: right;
    cursor: pointer;
    font-size: 24px;
}

/* ========== НОВЫЕ СТИЛИ ДЛЯ УДОБСТВА ========== */

/* Шапка и навигация */
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    padding: 0 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.badge {
    background: #e67e22;
    color: #fff;
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    font-size: 0.7rem;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
}

.breadcrumbs {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.7);
    background: rgba(0,0,0,0.2);
    margin-top: 0.5rem;
}

/* Кнопки */
.btn-primary {
    background: #e67e22;
    color: #fff;
    border: none;
    padding: 0.7rem 1.2rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.btn-primary:hover {
    background: #d35400;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #3498db;
    color: #fff;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: #2980b9;
}

.btn-danger {
    background: #e74c3c;
    color: #fff;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-danger:hover {
    background: #c0392b;
}

.button-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 1rem 0;
}

/* Быстрые действия */
.quick-actions {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.quick-action-btn {
    background: #f8f9fa;
    border: 1px solid #ddd;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    color: #333;
}

.quick-action-btn:hover {
    background: #e67e22;
    color: #fff;
    border-color: #e67e22;
}

/* Карточки контактов */
.contacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.contact-card {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.contact-icon {
    font-size: 1.8rem;
}

/* Список документов */
.doc-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.doc-item {
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 5px;
}

/* Инфо-блоки */
.info-box {
    background: #d1ecf1;
    border-left: 4px solid #17a2b8;
    padding: 0.8rem;
    margin-bottom: 1rem;
    border-radius: 5px;
    font-size: 0.85rem;
}

.info-text {
    color: #666;
    font-size: 0.85rem;
    margin-top: 1rem;
    text-align: center;
}

.more-link {
    display: inline-block;
    margin-top: 0.5rem;
    color: #e67e22;
    text-decoration: none;
}

/* Настройки */
.settings-group {
    margin: 1.5rem 0;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.settings-group h3 {
    margin-bottom: 1rem;
}

.switch-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    margin: 0.5rem 0;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    background: #ccc;
    border-radius: 24px;
    transition: 0.3s;
}

.switch:before {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    left: 2px;
    bottom: 2px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
}

input:checked + .switch {
    background: #e67e22;
}

input:checked + .switch:before {
    transform: translateX(26px);
}

.switch-label input {
    display: none;
}

/* Экстренные службы */
.emergency-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.8rem;
}

.emergency-grid div {
    background: #f8f9fa;
    padding: 0.8rem;
    border-radius: 5px;
    text-align: center;
}

/* Результат расчёта */
.payment-result {
    margin-top: 1rem;
    padding: 1rem;
    background: #d4edda;
    border-radius: 5px;
    font-weight: bold;
    text-align: center;
}

/* История показаний */
.history-list {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: #666;
}

/* Модальное окно */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background: #fff;
    padding: 1.5rem;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    position: relative;
}

.modal-content .close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Toast уведомления */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #333;
    color: #fff;
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
}

.toast.success { background: #27ae60; }
.toast.error { background: #e74c3c; }
.toast.info { background: #3498db; }

/* Тёмная тема */
body.dark-theme {
    background: #1a1a2e;
    color: #eee;
}

body.dark-theme .card {
    background: #16213e;
    color: #eee;
}

body.dark-theme .nav-link {
    color: #eee;
}

body.dark-theme .news-item,
body.dark-theme .contact-card,
body.dark-theme .doc-item {
    background: #0f3460;
}

/* Адаптивность */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }
    
    nav {
        display: none;
        flex-direction: column;
    }
    
    nav.show {
        display: flex;
    }
    
    .nav-link {
        display: block;
        margin: 0.2rem 0;
    }
    
    .header-top {
        flex-direction: row;
    }
    
    .logo {
        flex: 1;
    }
    
    .contacts-grid {
        grid-template-columns: 1fr;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .button-group button {
        width: 100%;
    }
}