.brand-subtitle,
.brand-title {
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #fff;
}
.sidebar .block,
.sidebar-header {
  border-radius: 0.35rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.layer-row input[type="checkbox"],
.map-overlay {
  pointer-events: none;
}
:root {
  --sidebar-width: 320px;
  --primary-green: #4a7c2b;
  --primary-dark: #2d5016;
  --accent-green: #a8d867;
  --mobile-header-height: 70px;
  --mobile-footer-height: 90px;
  --primary-green-rgb: 74, 124, 43;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body,
html {
  height: 100%;
  overflow: hidden;
}
body {
  font-family: Poppins, Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: #f8f9fa;
}
.app-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}
.sidebar {
  width: var(--sidebar-width);
  max-width: 100%;
  border-right: 1px solid #e9ecef;
  background: #fff;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}
.sidebar-header {
  flex-shrink: 0;
  margin: 0.6rem;
  overflow: hidden;
}
.sidebar-scrollable {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 0.6rem;
  background: #fff;
}
.sidebar-footer {
  flex-shrink: 0;
  background: #fff;
  border-top: 1px solid #e9ecef;
  padding: 0.6rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}
.sidebar-footer .footer-row {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
.sidebar-footer .footer-consorcio-text {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary-dark);
  text-align: center;
}
.sidebar-footer .footer-consorcio-logo img {
  height: 28px;
  width: auto;
  object-fit: contain;
}
.brand-title-container {
  background: linear-gradient(
    135deg,
    var(--primary-dark) 0,
    var(--primary-green) 100%
  );
  color: #fff;
  padding: 1rem;
  text-align: center;
}
.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 0.3rem;
  overflow: hidden;
}
.brand-subtitle {
  font-size: 0.85rem;
  margin: 0;
  opacity: 0.95;
  overflow: hidden;
}
.sidebar .block {
  margin: 0.6rem 0;
  overflow: hidden;
}
.search-section {
  background: var(--primary-green);
  color: #fff;
  padding: 0.6rem;
  font-weight: 600;
}
.search-content {
  padding: 0.8rem;
  background: #fff;
}
.search-btn {
  background: var(--primary-green);
  border: none;
  color: #fff;
  padding: 0.375rem 0.75rem;
}
.search-btn:hover {
  background: var(--primary-dark);
}
.layer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  transition: background 0.2s;
}
.layer-row label:hover,
.layer-row:hover {
  background: #f8f9fa;
}
.layer-row .layer-name {
  font-size: 0.9rem;
  color: #343a40;
}
.layer-row.hidden {
  display: none !important;
}
.accordion-button {
  background: #fff;
  color: var(--primary-dark);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.7rem 1rem;
}
.accordion-button:not(.collapsed) {
  background: var(--primary-green);
  color: #fff;
}
.accordion-button:focus {
  box-shadow: none;
  border-color: rgba(0, 0, 0, 0.125);
}
.accordion-item {
  border: 1px solid rgba(0, 0, 0, 0.125);
  margin-bottom: 0;
}
.accordion-body {
  padding: 0;
}
.form-check-input:checked {
  background-color: var(--primary-green);
  border-color: var(--primary-green);
}
.form-check-input:focus {
  border-color: var(--accent-green);
  box-shadow: 0 0 0 0.25rem rgba(74, 124, 43, 0.25);
}
.sidebar-scrollable::-webkit-scrollbar {
  width: 8px;
}
.sidebar-scrollable::-webkit-scrollbar-track {
  background: #f1f1f1;
}
.sidebar-scrollable::-webkit-scrollbar-thumb {
  background: var(--primary-green);
  border-radius: 4px;
}
.sidebar-scrollable::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}
.map-container {
  flex: 1;
  position: relative;
  height: 100vh;
  overflow: hidden;
  background: linear-gradient(180deg, #e9f1ff 0, #f7fbff 100%);
}
#map {
  position: relative;
  width: 100%;
  height: 100%;
}
@media (max-width: 991.98px) {
  body {
    overflow: hidden;
  }
  .app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 0;
    margin: 0;
  }
  .sidebar {
    display: none;
  }
  .mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--mobile-header-height);
    z-index: 1030;
    background: #fff;
    border-bottom: 2px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }
  .mobile-title-container {
    background: linear-gradient(
      135deg,
      var(--primary-dark) 0,
      var(--primary-green) 100%
    );
    color: #fff;
    padding: 1rem;
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .mobile-title-container h1 {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 0.3rem;
  }
  .mobile-title-container p {
    font-size: 0.85rem;
    margin: 0;
    opacity: 0.95;
  }
  .map-container {
    position: absolute;
    top: var(--mobile-header-height);
    bottom: 0;
    left: 0;
    right: 0;
    height: auto;
    flex: none;
    z-index: 1;
  }
  #map {
    width: 100%;
    height: 100%;
    position: relative;
  }
  .mobile-floating-button-container {
    position: fixed;
    bottom: calc(var(--mobile-footer-height) + 10px);
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1035;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
  }
  .mobile-floating-button-container .button-wrapper {
    text-align: center;
    pointer-events: auto;
    width: 100%;
    max-width: 300px;
    padding: 0 20px;
  }
  .btn-layers {
    background: var(--primary-green);
    color: #fff;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transition: 0.3s;
    width: auto;
    max-width: 200px;
  }
  .btn-layers:active,
  .btn-layers:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
  }
  .mobile-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--mobile-footer-height);
    z-index: 1030;
    background: #fff;
    border-top: 2px solid #e9ecef;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
    padding: 0.6rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
  }
  .footer-row {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .footer-consorcio-text {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-dark);
    text-align: center;
  }
  .footer-consorcio-logo img {
    height: 28px;
    width: auto;
    object-fit: contain;
  }
  .offcanvas {
    width: 85vw !important;
    max-width: 400px;
    z-index: 1050;
  }
  .offcanvas-header {
    background: linear-gradient(
      135deg,
      var(--primary-dark) 0,
      var(--primary-green) 100%
    );
    color: #fff;
    padding: 1rem;
  }
  .offcanvas-title {
    font-weight: 700;
    font-size: 1.2rem;
  }
  .btn-close {
    filter: brightness(0) invert(1);
  }
  .offcanvas-body {
    padding: 1rem;
  }
  .offcanvas-backdrop {
    z-index: 1040;
  }
}
@media (min-width: 992px) {
  .leaflet-top.leaflet-right {
    top: 10px;
    right: 10px;
  }
  .mobile-controls-map,
  .mobile-footer,
  .mobile-header {
    display: none !important;
  }
}
.map-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 400;
}
.text-primary {
  color: #007bff !important;
  font-weight: 700;
}
.custom-zoom-container {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1000;
  background: #fff;
  border: 2px solid #ccc;
  border-radius: 4px;
  width: 32px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
}
.custom-zoom-container button {
  width: 100%;
  height: 32px;
  border: none;
  background: 0 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
}
.custom-zoom-container button:first-child {
  border-bottom: 1px solid #ccc;
}
.custom-zoom-container button:hover {
  background: #f4f4f4;
}
.custom-zoom-container .zoom-in i,
.custom-zoom-container .zoom-out i {
  font-size: 18px;
  color: #555;
}
.popup-table-wrapper {
  max-width: 300px;
  max-height: 400px;
  overflow-x: auto;
  border-radius: 4px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
}
.popup-cell-key,
.popup-cell-value {
  padding: 0.2rem 0.4rem;
  font-size: 0.7rem;
  word-break: break-word;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.popup-table {
  font-family: Poppins, Roboto, system-ui, sans-serif;
  width: auto;
  cursor: pointer !important;
  min-width: 100%;
}
.popup-data-table {
  width: 100%;
  min-width: fit-content;
  border-collapse: collapse;
  box-shadow: none;
  border-radius: 0;
}
.popup-row-white {
  background: #fff;
}
.popup-row-gray {
  background: #f0f2f5;
}
.popup-cell-key {
  font-weight: 600;
  color: #2d5016;
  border-right: 1px solid #e9ecef;
  width: 35%;
}
.popup-cell-value {
  color: #343a40;
}
.popup-data-table tr:hover {
  background: rgba(var(--primary-green-rgb), 0.7);
}
.leaflet-popup-content {
  margin: 0;
  padding: 0;
  border-radius: 4px;
}
.leaflet-popup-content-wrapper {
  border-radius: 4px;
  box-shadow: none;
  padding: 0;
}
.layer-row label {
  cursor: pointer;
  padding: 0.6rem 0.8rem;
  margin: 0;
}
