#map {
  height: calc(100vh - 56px);
  width: 100vw;
}
body, html {
  margin: 0;
  padding: 0;
  overflow: hidden;
}
.table-sm td, .table-sm th {
  padding: 1px 4px !important;
}
/* Table styling for details panel */
#details .table thead th {
  background-color: #6c757d;
  color: white;
  border-color: #495057;
}

#details .table-bordered {
  border-color: #6c757d;
}

#details .table-bordered td,
#details .table-bordered th {
  border-color: #6c757d;
}
/* =========================
   MAPA A ROZVRŽENÍ
========================= */
#map {
  height: 100%;
  width: 100%;
}

/* Desaturace pro vrstvu mapy.cz */
.desaturated-layer {
  filter: saturate(0.6) brightness(1.0) contrast(1.0);
}

#legend {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 1000;
}

/* =========================
   LEGENDA PANEL
========================= */
#legend-panel {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 1000;
  background: #ffffff;
  border-radius: 6px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  min-width: 140px;
  max-width: 180px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid #e0e0e0;
}

#legend-panel.collapsed {
  transform: translateY(calc(100% - 25px));
}

.legend-header {
  background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
  color: white;
  padding: 10px;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  transition: background 0.3s ease;
  height: 28px;
}

.legend-header:hover {
  background: linear-gradient(135deg, #5a6268 0%, #343a40 100%);
}

.legend-arrow {
  font-size: 10px;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
}

#legend-panel.collapsed .legend-arrow {
  transform: rotate(0deg);
}

.legend-content {
  padding: 8px;
  background: #ffffff;
}

.legend-section {
  margin-bottom: 8px;
}

.legend-section:last-child {
  margin-bottom: 0;
}

.legend-divider {
  height: 1px;
  background: #e0e0e0;
  margin: 8px 0;
}

.legend-item {
  margin-bottom: 4px;
  font-size: 11px;
  color: #495057;
}

.legend-item:last-child {
  margin-bottom: 0;
}

.legend-line {
  width: 20px;
  height: 1px;
  margin-right: 10px;
  flex-shrink: 0;
}
/* =========================

   NÁSTROJE PANEL
========================= */
#tools-panel {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 1000;
  background: #ffffff;
  border-radius: 6px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  min-width: 140px;
  max-width: 180px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid #e0e0e0;
}

#tools-panel.collapsed {
  transform: translateY(calc(100% - 25px));
}

.tools-header {
  background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
  color: white;
  padding: 10px;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  transition: background 0.3s ease;
  height: 28px;
}

.tools-header:hover {
  background: linear-gradient(135deg, #5a6268 0%, #343a40 100%);
}

.tools-arrow {
  font-size: 10px;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
}

#tools-panel.collapsed .tools-arrow {
  transform: rotate(0deg);
}

.tools-content {
  padding: 8px;
  background: #ffffff;
}

.tools-section {
  margin-bottom: 8px;
}

.tools-section:last-child {
  margin-bottom: 0;
}

.section-label {
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 4px;
  display: block;
  color: #495057;
}

.role-filters {
  font-size: 10px;
}

.filter-item {
  display: block;
  margin-bottom: 2px;
  cursor: pointer;
  color: #6c757d;
  transition: color 0.2s ease;
}

.filter-item:hover {
  color: #495057;
}

.filter-item input[type="checkbox"] {
  margin-right: 4px;
  transform: scale(0.9);
}

.search-input {
  width: 100%;
  padding: 4px 6px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 11px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: #6c757d;
  box-shadow: 0 0 0 2px rgba(108, 117, 125, 0.2);
}

.search-results {
  display: none;
  background: #fff;
  border: 1px solid #ced4da;
  border-radius: 4px;
  max-height: 200px;
  overflow-y: auto;
  position: absolute;
  z-index: 1001;
  width: 100%;
  top: 100%;
  margin-top: 2px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.search-results div:last-child {
  border-bottom: none !important;
}

.tools-buttons {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.tool-button {
  width: 100%;
  padding: 5px 8px;
  border: none;
  border-radius: 4px;
  background: #6c757d;
  color: white;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.tool-button:hover {
  background: #5a6268;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.tool-button:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* =========================
   VRSTVY PANEL
========================= */
#layers-panel {
  position: absolute;
  bottom: 10px;
  left: 200px;
  z-index: 1000;
  background: #ffffff;
  border-radius: 6px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  min-width: 120px;
  max-width: 160px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid #e0e0e0;
}

#layers-panel.collapsed {
  transform: translateY(calc(100% - 25px));
}

.layers-header {
  background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
  color: white;
  padding: 10px;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  transition: background 0.3s ease;
  height: 28px;
}

.layers-header:hover {
  background: linear-gradient(135deg, #218838 0%, #155724 100%);
}

.layers-arrow {
  font-size: 10px;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
}

#layers-panel.collapsed .layers-arrow {
  transform: rotate(0deg);
}

.layers-content {
  padding: 8px;
  background: #ffffff;
}

.layers-section {
  margin-bottom: 8px;
}

.layers-section:last-child {
  margin-bottom: 0;
}

.layer-item {
  display: block;
  margin-bottom: 4px;
  cursor: pointer;
  color: #495057;
  font-size: 11px;
  transition: color 0.2s ease;
}

.layer-item:hover {
  color: #28a745;
}

.layer-item input[type="radio"] {
  margin-right: 6px;
  transform: scale(0.9);
}

.layer-item:last-child {
  margin-bottom: 0;
}

@media (max-width: 600px) {
/* =========================
   RESPONSIVNÍ STYLY
========================= */
#legend-panel {
  right: 10px;
  bottom: 10px;
  min-width: 120px;
  max-width: 140px;
  font-size: 0.9em;
}
#tools-panel {
  left: 10px;
  bottom: 10px;
  min-width: 120px;
  max-width: 140px;
  font-size: 0.9em;
}
.search-input {
  font-size: 0.9em !important;
}
#details {
  right: 2vw;
  top: 10vw;
  max-width: 96vw;
  max-height: 80vh;
  z-index: 2002;
}
}
