body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #e7f0f7;
}

/* Top banner */
#topBanner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: rgba(255, 255, 255, 0.95);
    z-index: 1000;
    border-bottom: 1px solid #ddd;
    padding-left: 10px;
    display: flex;
    align-items: center;
}

h5.text-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Sidebar */
#sidebar {
    position: absolute;
    top: 60px;
    left: 0;
    width: 300px;
    height: calc(100vh - 60px);
    background: #f8f9fa;
    z-index: 1000;
    overflow-y: auto;
    border-right: 1px solid #ddd;
    padding: 10px;
}

#sidebar h4 {
    margin-top: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.form-check-label {
    font-size: 0.8rem;
}

.layer-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.layer-item label {
    flex: 1;
    margin-left: 6px;
    word-break: break-word;
    white-space: normal;
    display: flex;
    align-items: center;
}

.view-table-btn {
    flex-shrink: 0;
    background-color: #f8f9fa;
    border: 1px solid #ccc;
    color: #333;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    transition: background-color 0.2s ease;
}

.view-table-btn:hover {
    background-color: #e2e6ea;
    color: #000;
}

/* Map area */
#map {
    position: absolute;
    top: 60px;
    left: 300px;
    width: calc(100% - 300px);
    height: calc(100vh - 60px);
    transition: height 0.3s ease;
}

/* Attribute table */
#attributeTablePanel.active + #map {
    height: calc(100vh - 60px - 250px);
}

#attributeTablePanel {
    position: absolute;
    bottom: 0;
    left: 300px;
    width: calc(100% - 300px);
    max-height: 250px;
    overflow-y: auto;
    background: #fff;
    border-top: 1px solid #ddd;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    display: none;
    z-index: 1100;
    padding: 10px;
}

#attributeTablePanel table {
    font-size: 0.75rem;
}

#attributeTablePanel th,
#attributeTablePanel td {
    padding: 0.25rem 0.5rem;
}

/* Tabs on right panel */
#rightPanel {
    position: absolute;
    top: 70px;
    right: 10px;
    width: 260px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 0.75rem;
    z-index: 1200;
}

#rightPanel .nav-tabs {
    border-bottom: 1px solid #ddd;
    background: #f9f9f9;
    border-radius: 12px 12px 0 0;
}

#rightPanel .nav-tabs .nav-link {
    padding: 8px 12px;
    font-weight: 500;
    color: #333;
    border: none;
}

#rightPanel .nav-tabs .nav-link.active {
    background: #007bff;
    color: #fff;
    font-weight: 600;
    border-radius: 12px 12px 0 0;
}

#rightPanel .tab-content {
    padding: 12px;
    max-height: 400px;
    overflow-y: auto;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
}

.legend-item img {
    max-width: 100%;
    height: auto;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    background: #fff;
    padding: 2px;
    display: block;
    margin-bottom: 4px;
}

#legendContent {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#legendContent > div {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 10px;
}

#legendContent small {
    font-weight: 600;
    margin-bottom: 4px;
}

#legendContent img {
    max-width: 100%;
    display: block;
    border: none;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
}

/* Container de cada item da ordem */
.order-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  margin-bottom: 8px;
  background: #f8f9fa;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.order-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  margin-bottom: 10px;
  background: #f8f9fa;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.layer-title {
  font-size: 0.75rem;
  font-weight: 500;
  color: #333;
  line-height: 1.3;
}

.order-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-top: 2px;
}

.btn-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.btn-order {
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-order:hover {
  background: #e6e6e6;
}

.opacity-slider {
  width: 120px;
  height: 6px;
  accent-color: #007bff;
  cursor: pointer;
}

/* Leaflet controls */
.leaflet-bottom.leaflet-right {
    bottom: 40px;
    right: 10px;
}

.leaflet-control-container .leaflet-top.leaflet-right {
    top: 70px !important;
    right: 10px;
    z-index: 1200;
}

.category-header {
    background-color: #6c757d;
    color: #fff;
    padding: 6px 10px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 4px;
    margin-bottom: 4px;
    cursor: pointer;
}

.category-header:hover {
    background-color: #5a6268;
}

.category-header::after {
    content: '▶';
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.category-header.open::after {
    transform: rotate(90deg);
}

.category-content {
    padding-left: 10px;
    margin-bottom: 8px;
}

/* Metadados */
#metadataTableContainer table {
    font-size: 0.8rem;
}