* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background: #f0f4f8;
  color: #2c3e50;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

header {
  background: linear-gradient(135deg, #7b241c, #2c3e50);
  color: white;
  padding: 1rem 2rem;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.container {
  display: flex;
  flex: 1;
  gap: 24px;
  padding: 20px;
}

#map {
  flex: 1;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  height: 100%;
  transition: box-shadow 0.3s ease;
}

#map:hover {
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
}

.sidebar {
  width: 360px;
  background: white;
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: all 0.3s ease;
}

.sidebar h2, .sidebar h3 {
  font-size: 1.25rem;
  color: #7b241c;
  margin-bottom: 12px;
  border-bottom: 2px solid #eaeff5;
  padding-bottom: 6px;
}

.menu-btn {
  width: 100%;
  padding: 12px 16px;
  background: #f5eaea;
  border: 1px solid #e0bdbc;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  font-weight: 600;
  transition: all 0.2s;
  margin-bottom: 8px;
}

.menu-btn:hover {
  background: #ecd6d6;
}

.menu-btn.active {
  background: linear-gradient(135deg, #7b241c, #2c3e50);
  color: white;
  border-color: #7b241c;
}

label {
  display: block;
  margin: 12px 0 6px 0;
  font-weight: 600;
  color: #2c3e50;
}

select {
  width: 100%;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 10px;
  font-size: 1rem;
  margin-bottom: 4px;
  transition: border-color 0.3s;
}

select:focus {
  outline: none;
  border-color: #7b241c;
  box-shadow: 0 0 0 2px rgba(123, 36, 28, 0.2);
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.action-btn {
  flex: 1;
  padding: 12px;
  background: linear-gradient(135deg, #7b241c, #922b21);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.action-btn:hover {
  background: linear-gradient(135deg, #922b21, #7b241c);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.action-btn.secondary {
  background: linear-gradient(135deg, #5d6d7e, #7b8a8b);
}

.action-btn.secondary:hover {
  background: linear-gradient(135deg, #7b8a8b, #5d6d7e);
}

.result {
  background: #f9f9f9;
  border-left: 4px solid #7b241c;
  padding: 16px;
  border-radius: 8px;
  max-height: 400px;
  overflow-y: auto;
  display: none;
}

.result.show {
  display: block;
}

.result table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

.result th {
  background: #7b241c;
  color: white;
  padding: 10px;
  text-align: left;
}

.result td {
  padding: 10px;
  border-bottom: 1px solid #ddd;
}

.result tr:hover {
  background: #f5eaea;
}

/* Карточка объекта */
.object-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  border: 1px solid #e0bdbc;
  overflow: hidden;
}

.card-header {
  background: linear-gradient(135deg, #7b241c, #922b21);
  color: white;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header h3 {
  margin: 0;
  color: white;
  border: none;
  padding: 0;
}

.close-btn {
  background: transparent;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

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

.card-content {
  padding: 16px;
}

.card-image {
  text-align: center;
  margin-bottom: 16px;
}

.card-image img {
  max-width: 100%;
  max-height: 200px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.card-details table {
  width: 100%;
  border-collapse: collapse;
}

.card-details td {
  padding: 8px 0;
  border-bottom: 1px solid #eee;
  vertical-align: top;
}

.card-details td:first-child {
  width: 120px;
  font-weight: 600;
  color: #7b241c;
}

/* Всплывающие окна на карте */
.photo-popup {
  background: white;
  border-radius: 8px;
  padding: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  max-width: 300px;
  border: 2px solid #7b241c;
}

.name-tooltip {
  background: rgba(123, 36, 28, 0.9);
  color: white;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

/* Отступы для подгрупп */
.submenu-group {
  margin-top: 12px;
}

.submenu-group h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

/* Переключение подменю */
.submenu-group.active {
  display: block;
}

/* Информационное сообщение */
.info-message {
  background: #e8f4fd;
  border-left: 4px solid #3498db;
  padding: 12px;
  border-radius: 8px;
  margin-top: 12px;
  font-size: 0.95rem;
}

/* Адаптивность */
@media (max-width: 1200px) {
  .container {
    flex-direction: column;
    height: auto;
  }
  
  #map {
    height: 500px;
    min-height: 500px;
  }
  
  .sidebar {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .actions {
    flex-direction: column;
  }
  
  .action-btn {
    width: 100%;
  }
  
  header {
    font-size: 1.2rem;
    padding: 0.75rem 1rem;
  }
}