.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}
.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 20px;
}
.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
  transition: opacity var(--t);
}
.logo:hover {
  opacity: 0.85;
  text-decoration: none;
}
.header-logo-img {
  height: 52px;
  object-fit: contain;
  display: block;
  padding: 2px;
}


.nav-main {
  gap: 2px;
  flex: 1;
  margin-left: 8px;
  text-align: center;
}
.nav-link {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition:
    background var(--t),
    color var(--t);
  text-decoration: none;
}
.nav-link:hover {
  background: var(--bg-muted);
  color: var(--accent);
  text-decoration: none;
}
.nav-link--cta {
  background: var(--accent);
  color: #fff !important;
  padding: 6px 14px;
}
.nav-link--cta:hover {
  background: var(--accent-dark) !important;
}
.nav-link--admin {
  color: var(--accent);
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}


.user-menu {
  position: relative;
}
.user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  transition:
    border-color var(--t),
    box-shadow var(--t);
}
.user-btn:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}
.user-avatar--md {
  width: 34px;
  height: 34px;
  font-size: 14px;
}
.user-nome {
  font-weight: 500;
}

.user-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 210px;
  overflow: hidden;
  z-index: 200;
}
.user-dropdown.open {
  display: block;
  animation: dropIn 0.12s ease;
}
@keyframes dropIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dropdown-header strong {
  font-size: 14px;
  color: var(--text);
}
.dropdown-header small {
  font-size: 12px;
  color: var(--text-muted);
}
.user-dropdown a {
  display: block;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-secondary);
  transition: background var(--t);
}
.user-dropdown a:hover {
  background: var(--bg-muted);
  text-decoration: none;
  color: var(--text);
}
.dropdown-logout {
  color: var(--danger) !important;
  border-top: 1px solid var(--border);
}
.dropdown-logout:hover {
  background: var(--danger-bg) !important;
}


.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.2s;
}

.site-footer {
  background: var(--bg-card);
  color: var(--accent-dark);
  padding: 28px 0;
  margin-top: auto;
}
.footer-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 15px;
}
.footer-copy {
  font-size: 15px;
  flex: 1;
  text-align: center;
}
.footer-nav {
  display: flex;
  gap: 20px;
}
.footer-nav a {
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
}
.footer-nav a:hover {
  color: #fff;
  text-decoration: none;
}


.page-hero {
  background: linear-gradient(
    135deg,
    var(--accent-dark) 0%,
    var(--accent) 100%
  );
  color: #fff;
  padding: 48px 0 40px;
}
.page-hero h1 {
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 400;
  margin-bottom: 8px;
}
.page-hero p {
  opacity: 0.85;
  font-size: 16px;
  max-width: 520px;
}


.admin-page-banner {
  background: var(--accent);
  color: #fff;
  padding: 20px 0;
}
.admin-page-banner h1 {
  font-size: 26px;
  font-weight: 400;
}

.admin-subnav {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}
.admin-subnav nav {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.admin-subnav nav::-webkit-scrollbar {
  display: none;
}
.subnav-link {
  padding: 13px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  text-decoration: none;
  transition:
    color var(--t),
    border-color var(--t);
}
.subnav-link:hover {
  color: var(--accent);
  text-decoration: none;
}
.subnav-link.active {
  font-weight: 600;
  color: var(--accent);
  border-bottom-color: var(--accent);
}


.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}
.kpi-card::before {
  content: none;
}
.kpi-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.kpi-value {
  font-size: 34px;
  color: var(--kpi-color, var(--text));
  line-height: 1;
}
.kpi-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}


.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  align-items: start;
}


.map-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1; 
  min-height: 0; 
}
.map-controls {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 10px 20px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  z-index: 2;
  flex-shrink: 0;
}
.map-count {
  font-size: 13px;
  color: var(--text-muted);
  margin-left: auto;
}
#mapa {
  flex: 1;
  min-height: 400px; 
  z-index: 1;
}

.leaflet-control-attribution {
  display: none;
}


.comment-item {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}
.comment-item:last-child {
  border-bottom: none;
}
.comment-item--interno {
  background: var(--bg-muted);
}
.comment-author {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.comment-name {
  font-weight: 500;
  font-size: 14px;
}
.comment-time {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 12px;
  margin-left: 6px;
}
.comment-body {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-top: 4px;
}


.overview-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.overview-stat {
  padding: 14px;
  border-radius: var(--radius);
}
.overview-stat--total {
  background: var(--bg);
}
.overview-stat--pending {
  background: #fff7ed;
}
.overview-stat--pending .overview-stat__label,
.overview-stat--pending .overview-stat__value {
  color: #b45309;
}
.overview-stat--resolved {
  background: #ecfdf5;
}
.overview-stat--resolved .overview-stat__label,
.overview-stat--resolved .overview-stat__value {
  color: #16a34a;
}
.overview-stat--analysis {
  background: #eef2ff;
}
.overview-stat--analysis .overview-stat__label,
.overview-stat--analysis .overview-stat__value {
  color: #4f46e5;
}
.overview-stat__label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.overview-stat__value {
  font-size: 22px;
  font-weight: 600;
}


.auth-layout {
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-box {
  width: 100%;
  max-width: 420px;
}
.auth-box--wide {
  max-width: 500px;
}
.auth-logo {
  text-align: center;
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}
.auth-logo img {
  width: 280px;
  object-fit: contain;
}
.auth-logo-name {
  font-size: 22px;
  color: var(--text);
}
.auth-logo-sub {
  font-size: 14px;
  color: var(--text-muted);
}


@media (max-width: 900px) {
  .nav-main {
    display: none;
  }
  .nav-toggle {
    display: flex;
  }
  .nav-main.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 12px 20px;
    box-shadow: var(--shadow);
    z-index: 99;
    gap: 4px;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .overview-stats {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 600px) {
  .overview-stats {
    grid-template-columns: 1fr 1fr;
  }
  .page-hero {
    padding: 32px 0 24px;
  }
}


.notif-menu {
  position: relative;
}

.notif-btn {
  position: relative;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition:
    border-color var(--t),
    background var(--t),
    transform var(--t);
}
.notif-btn:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}
.notif-btn.has-notif {
  animation: ring 2s ease 1s;
}

@keyframes ring {
  0%,
  100% {
    transform: rotate(0);
  }
  10%,
  30% {
    transform: rotate(-12deg);
  }
  20%,
  40% {
    transform: rotate(12deg);
  }
  50% {
    transform: rotate(0);
  }
}

.notif-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: var(--radius-full);
  border: 2px;
  min-width: 18px;
  text-align: center;
  animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes popIn {
  from {
    transform: scale(0);
  }
  to {
    transform: scale(1);
  }
}

.notif-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 320px;
  overflow: hidden;
  z-index: 200;
}
.notif-dropdown.open {
  display: block;
  animation: dropIn 0.15s ease;
}

.notif-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.notif-header strong {
  font-size: 14px;
}

.notif-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background var(--t);
  text-decoration: none;
  color: inherit;
}
.notif-item:hover {
  background: var(--bg-hover);
  text-decoration: none;
}
.notif-item--unread {
  background: var(--accent-light);
}
.notif-item__icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}
.notif-item__msg {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
}
.notif-item__time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}
.notif-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 5px;
}
.notif-empty {
  padding: 20px 16px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  margin: 0;
}
.notif-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  text-align: center;
  background: var(--bg-muted);
}
.notif-footer a {
  font-size: 13px;
  color: var(--accent);
}


#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: var(--text);
  color: #fff;
  box-shadow: var(--shadow-lg);
  min-width: 280px;
  max-width: 360px;
  pointer-events: all;
  animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.toast.hide {
  animation: toastOut 0.3s ease forwards;
}
.toast--sucesso {
  background: var(--success);
}
.toast--erro {
  background: var(--danger);
}
.toast--aviso {
  background: var(--warning);
}
.toast--info {
  background: var(--info);
}
.toast__icon {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}
.toast__msg {
  font-size: 14px;
  line-height: 1.4;
  flex: 1;
}
.toast__close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  font-size: 16px;
  padding: 0;
  line-height: 1;
}
.toast__close:hover {
  color: #fff;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes toastOut {
  from {
    opacity: 1;
    transform: none;
  }
  to {
    opacity: 0;
    transform: translateY(8px);
  }
}


.fade-in {
  animation: fadeInUp 0.4s ease both;
}
.fade-in-1 {
  animation-delay: 0.05s;
}
.fade-in-2 {
  animation-delay: 0.1s;
}
.fade-in-3 {
  animation-delay: 0.15s;
}
.fade-in-4 {
  animation-delay: 0.2s;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}


.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-muted) 25%,
    var(--border) 50%,
    var(--bg-muted) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}


.pw-strength {
  margin-top: 6px;
}
.pw-strength__bar {
  height: 4px;
  border-radius: 4px;
  background: var(--bg-muted);
  overflow: hidden;
}
.pw-strength__fill {
  height: 100%;
  border-radius: 4px;
  transition:
    width 0.3s,
    background 0.3s;
}
.pw-strength__label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}


.char-counter {
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
  margin-top: 3px;
}
.char-counter.near-limit {
  color: var(--warning);
}
.char-counter.at-limit {
  color: var(--danger);
}


tbody tr.row-highlight td {
  background: var(--accent-light) !important;
  transition: background 0.3s;
}


.btn-apagar-com:hover {
  opacity: 1 !important;
  color: var(--danger);
}


.subnav-link .notif-badge {
  vertical-align: middle;
}


@media (max-width: 600px) {
  .feed-grid {
    grid-template-columns: 1fr;
  }
}


#geocode-status {
  transition: opacity 0.3s;
}


.map-controls__label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}
.form-control--sm {
  height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.map-pin-wrap {
  background: transparent;
  border: none;
}
.map-pin {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--pin-color, #6b7280);
  border: 3px solid #fff;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
}
.map-pin::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid var(--pin-color, #6b7280);
}
.map-pin__icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  
  filter: brightness(0) invert(1);
  -webkit-filter: brightness(0) invert(1);
}

.main-content--map {
  padding: 0;
  height: calc(100vh - var(--header-h));
  display: flex;
  flex-direction: column;
}
