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

body {
    font-family: 'Segoe UI', 'Roboto', sans-serif;
    background: #1a2a1f;
    color: #e0e0e0;
}

/* Шапка */
.header {
    background: linear-gradient(135deg, #1e3a1e 0%, #0f2a0f 100%);
    padding: 15px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo h1 {
    font-size: 1.4rem;
    color: #ffd966;
}

.logo p {
    font-size: 0.8rem;
    color: #a5d6a5;
}

.stats-header {
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
}

.stat-badge {
    background: rgba(0,0,0,0.4);
    padding: 5px 12px;
    border-radius: 20px;
}

/* Вкладки */
.tabs {
    display: flex;
    background: #0f2a0f;
    padding: 0 20px;
    gap: 5px;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    cursor: pointer;
    color: #a5d6a5;
    transition: all 0.3s;
    border-radius: 8px 8px 0 0;
}

.tab-btn.active {
    background: #2d5a2c;
    color: white;
}

.tab-btn:hover:not(.active) {
    background: #1e3a1e;
    color: #ffd966;
}

/* Контент вкладок */
.tab-content {
    display: none;
    padding: 20px;
    background: #1a2a1f;
    min-height: calc(100vh - 130px);
}

.tab-content.active {
    display: block;
}

/* Вкладка карты — для позиционирования кнопки списка */
#tab-map {
    position: relative;
}

/* Фильтры над картой */
.filter-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 15px;
    align-items: center;
}

.filter-group select, .filter-group input {
    padding: 8px 12px;
    border-radius: 8px;
    border: none;
    background: #2d2d2d;
    color: white;
}

.btn {
    background: #2d5a2c;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: 0.2s;
}

.btn:hover {
    background: #1e3a1e;
    transform: scale(1.02);
}

/* ========== КОНТЕЙНЕР ДЛЯ КАРТЫ ========== */
.map-container {
    position: relative;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
}

#map {
    width: 100%;
    height: 500px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* ========== КНОПКА И ЛЕГЕНДА - ПРИЛИПАЮТ К НИЖНЕМУ КРАЮ КАРТЫ ========== */
.map-bottom-controls {
    position: absolute;
    bottom: 15px;
    left: 15px;
    right: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    pointer-events: none;
}

.map-bottom-controls .btn,
.map-bottom-controls .map-legend {
    pointer-events: auto;
}

/* Кнопка "Показать все маркеры" */
.map-bottom-controls .btn {
    background: #2d5a2c;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    font-size: 14px;
    white-space: nowrap;
}

.map-bottom-controls .btn:hover {
    background: #1e3a1e;
    transform: scale(1.02);
}

/* Легенда карты */
.map-legend {
    background: rgba(26, 42, 31, 0.85);
    backdrop-filter: blur(8px);
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 12px;
    font-family: monospace;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.map-legend div {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #e0e0e0;
    white-space: nowrap;
}

.map-legend span {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* Таблицы */
.table-container {
    overflow-x: auto;
    background: #0f2a0f;
    border-radius: 12px;
    padding: 15px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #2d5a2c;
}

th {
    background: #1e3a1e;
    color: #ffd966;
    cursor: pointer;
}

tr:hover {
    background: #2d2d2d;
}

.category-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
}

.category-spiders { background: #ff4444; }
.category-reptiles { background: #44ff44; color: #1a2a1f; }
.category-mixed { background: #ffaa44; color: #1a2a1f; }

.action-btn {
    background: #ffaa44;
    border: none;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    margin: 0 2px;
}

.action-btn.delete {
    background: #ff4444;
    color: white;
}

/* Форма добавления */
.form-card {
    background: #0f2a0f;
    padding: 20px;
    border-radius: 12px;
    max-width: 600px;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #ffd966;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: none;
    background: #2d2d2d;
    color: white;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Аналитика */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.chart-card {
    background: #0f2a0f;
    padding: 15px;
    border-radius: 12px;
}

.chart-card canvas {
    max-height: 300px;
}

.analytics-summary {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.analytics-card {
    background: #0f2a0f;
    padding: 15px 25px;
    border-radius: 12px;
    text-align: center;
    flex: 1;
    min-width: 150px;
}

.analytics-number {
    font-size: 2rem;
    font-weight: bold;
    color: #ffd966;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #1a2a1f;
    padding: 20px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
}

/* Утилиты */
.search-box {
    margin-bottom: 15px;
}

.search-box input {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: none;
    background: #2d2d2d;
    color: white;
}

/* Адаптация для маленьких экранов */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    .charts-grid {
        grid-template-columns: 1fr;
    }
    .tab-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    
    .map-bottom-controls {
        bottom: 10px;
        left: 10px;
        right: 10px;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .map-bottom-controls .btn {
        text-align: center;
    }
    
    .map-legend {
        justify-content: center;
        gap: 10px;
        padding: 6px 12px;
    }
    
    .map-legend div {
        white-space: nowrap;
    }
}

/* ========== КНОПКА СПИСКА И БОКОВАЯ ПАНЕЛЬ ========== */

/* Кнопка списка */
.show-list {
    top: 20px;
    left: 20px;
    background: #2d5a2c;
    color: white;
    width: 20%;      /* 20% от ширины родителя */
    height: 10%;     /* 10% от высоты родителя */
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    z-index: 1000;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: 0.2s;
}

.show-list:hover {
    background: #1e3a1e;
    transform: scale(1.02);
}

.show-list:hover {
    background: #1e3a1e;
    transform: scale(1.02);
}

/* Боковая панель */
.sidebar {
    position: fixed;
    left: 20px;
    top: 100px;
    width: 320px;
    max-height: 70vh;
    background: #0f2a0f;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 1001;
    overflow-y: auto;
    display: none;
    backdrop-filter: blur(8px);
}

.sidebar-header {
    background: #2d5a2c;
    padding: 12px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    cursor: pointer;
    color: white;
}

.close-btn {
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
}

.close-btn:hover {
    color: #ffaa44;
}

.sidebar-content {
    padding: 12px;
}

.exhibition-item {
    padding: 10px;
    border-bottom: 1px solid #2d5a2c;
    cursor: pointer;
    transition: 0.2s;
}

.exhibition-item:hover {
    background: #2d2d2d;
    border-radius: 8px;
}

.exhibition-title {
    font-weight: bold;
    color: #ffd966;
}

.exhibition-date {
    font-size: 11px;
    color: #a5d6a5;
    margin-top: 4px;
}

.exhibition-address {
    font-size: 11px;
    color: #ffaa44;
    margin-top: 4px;
}

/* ========== СКРЫВАЕМ ТОЛЬКО ДВЕ КНОПКИ ========== */

/* Скрываем кнопку "Создать свою карту" */
.ymaps-2-1-79-controls__toolbar,
.ymaps-2-1-79-controls__toolbar_right {
    display: none !important;
}

/* Скрываем кнопку "Открыть в Яндекс Картах" */
.ymaps-2-1-79-copyright__content a {
    display: none !important;
}