* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #f0f4f8;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 20px;
}

header h1 {
    color: #2c7da0;
    font-size: 28px;
}

/* Поиск */
.search-section {
    margin-bottom: 20px;
}

.search-box {
    display: flex;
    gap: 10px;
    max-width: 600px;
    margin: 0 auto;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 30px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: #2c7da0;
}

.search-btn, .clear-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 500;
    transition: all 0.2s;
}

.search-btn {
    background: #2c7da0;
    color: white;
}

.search-btn:hover {
    background: #1f5e7a;
}

.clear-btn {
    background: #95a5a6;
    color: white;
}

.clear-btn:hover {
    background: #7f8c8d;
}

/* Фильтры */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.filter-btn {
    background: white;
    border: 1px solid #ccc;
    padding: 8px 16px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
}

.filter-btn:hover {
    background: #e0e7ef;
}

.filter-btn.active {
    background: #2c7da0;
    color: white;
    border-color: #2c7da0;
}

.admin-link {
    background: #6c757d;
    color: white;
    padding: 8px 16px;
    border-radius: 30px;
    text-decoration: none;
    margin-left: 10px;
}

.admin-link:hover {
    background: #5a6268;
}

/* Основной макет */
.main-layout {
    display: flex;
    gap: 20px;
    height: calc(100vh - 280px);
    min-height: 500px;
}

.map-section {
    flex: 1;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

#map {
    width: 100%;
    height: 100%;
}

/* Модальное окно поверх карты */
.object-modal {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.object-modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 450px;
    max-height: 85%;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #2c7da0;
    color: white;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    opacity: 0.8;
}

.modal-body {
    padding: 20px;
    max-height: calc(85vh - 60px);
    overflow-y: auto;
}

.modal-field {
    margin-bottom: 12px;
    font-size: 18px;
    line-height: 1.5;
}

.modal-field strong {
    color: #2c7da0;
}

.time-remaining-field {
    background: #fff3e0;
    padding: 8px;
    border-radius: 8px;
    color: #e67e22;
    font-weight: 500;
}

.discount-field {
    background: #e8f5e9;
    padding: 8px;
    border-radius: 8px;
    color: #2e7d32;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.modal-call-btn, .modal-edit-btn {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    flex: 1;
}

.modal-call-btn {
    background: #2c7da0;
    color: white;
}

.modal-call-btn:hover {
    background: #1f5e7a;
}

.modal-edit-btn {
    background: #f39c12;
    color: white;
}

.modal-edit-btn:hover {
    background: #e67e22;
}

.call-link {
    color: #2c7da0;
    text-decoration: none;
    font-weight: 500;
}

.call-link:hover {
    text-decoration: underline;
}

/* Список объектов */
.list-section {
    width: 380px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 0.3s ease;
}

.list-header {
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.list-header h3 {
    color: #2c7da0;
    font-size: 16px;
}

.view-toggle {
    display: flex;
    gap: 5px;
}

.view-btn {
    padding: 5px 10px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
}

.view-btn.active {
    background: #2c7da0;
    color: white;
    border-color: #2c7da0;
}

.objects-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

/* Карточка объекта в списке */
.object-card-item {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.object-card-item:hover {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
}

.card-category {
    color: #666;
}

.card-status {
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
}

.status-open {
    background: #d4edda;
    color: #155724;
}

.status-closed {
    background: #f8d7da;
    color: #721c24;
}

.card-name {
    font-weight: 600;
    font-size: 15px;
    color: #2c7da0;
    margin-bottom: 6px;
}

.card-address {
    font-size: 12px;
    color: #555;
    margin-bottom: 4px;
}

.card-hours {
    font-size: 12px;
    color: #777;
    margin-bottom: 4px;
}

.time-remaining {
    font-size: 11px;
    color: #e67e22;
    margin-bottom: 8px;
    display: block;
}

.card-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.call-btn, .details-btn, .edit-link {
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 11px;
    text-decoration: none;
    cursor: pointer;
    border: none;
}

.call-btn {
    background: #2c7da0;
    color: white;
}

.call-btn:hover {
    background: #1f5e7a;
}

.details-btn {
    background: #ecf0f1;
    color: #2c3e50;
}

.details-btn:hover {
    background: #bdc3c7;
}

.edit-link {
    background: #f39c12;
    color: white;
    display: inline-block;
}

.edit-link:hover {
    background: #e67e22;
}

.empty-list {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* Адаптивность */
@media (max-width: 900px) {
    .main-layout {
        flex-direction: column;
        height: auto;
    }

    .list-section {
        width: 100% !important;
        margin-top: 20px;
    }

    .map-section {
        height: 500px;
    }

    .search-box {
        flex-wrap: wrap;
    }

    .modal-content {
        width: 95%;
        margin: 10px;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 10px;
    }

    .map-section {
        height: 400px;
    }

    .modal-actions {
        flex-direction: column;
    }
}