:root {
  --bg-body: #eef5ef;
  --bg-surface: #ffffff;
  --bg-surface-soft: #f6fbf7;
  --bg-elevated: #fcfefd;

  --text-main: #143127;
  --text-muted: #62786c;
  --text-soft: #8aa093;

  --border-color: #d9e7dc;
  --border-strong: #bfd4c3;

  --brand-primary: #1f6f43;
  --brand-primary-strong: #175937;
  --brand-primary-deep: #103c27;
  --brand-sidebar: #0f4a2a;
  --brand-light: #eaf7ee;
  --brand-light-strong: #d5eedc;
  --brand-accent: #2fa866;

  --success: #10b981;
  --success-bg: #d1fae5;
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --danger: #ef4444;
  --danger-bg: #fee2e2;
  --info: #3b82f6;
  --info-bg: #dbeafe;
  --neutral: #94a3b8;
  --neutral-bg: #f1f5f9;

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;

  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 12px 28px rgba(15, 60, 39, 0.08);
  --shadow-lg: 0 22px 50px rgba(15, 60, 39, 0.12);

  --sidebar-expanded-width: 288px;
  --sidebar-collapsed-width: 86px;
  --sidebar-width: var(--sidebar-expanded-width);
  --header-height: 76px;
  --transition: 0.22s ease;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--text-main);
  overflow-x: hidden;
  background:
      radial-gradient(circle at 20% 20%, rgba(47,168,102,0.15), transparent 35%),
      radial-gradient(circle at 80% 10%, rgba(31,111,67,0.12), transparent 40%),
      radial-gradient(circle at 50% 100%, rgba(47,168,102,0.10), transparent 50%),
      #ffffff;
}

body {
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

body.menu-mobile-open {
  overflow: hidden;
}

/* ==========================================================================
   SIDEBAR
   ========================================================================== */

.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.08), transparent 20%),
    linear-gradient(180deg, #103c27 0%, #0f4a2a 45%, #0c3d23 100%);
  color: #f5fff7;
  display: flex;
  flex-direction: column;
  padding: 18px 14px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  box-shadow: 12px 0 32px rgba(15, 60, 39, 0.14);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  z-index: 20;
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 14px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.brand-mark {
  width: 52px;
  height: 52px;
  min-width: 52px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.brand-mark img {
  width: 80%;
  height: 80%;
  object-fit: contain;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.brand-text h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.brand-text span {
  font-size: 12px;
  color: rgba(241, 255, 245, 0.68);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-text p {
  margin: 4px 0 0;
  color: rgba(241, 255, 245, 0.74);
  font-size: 11px;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.nav-menu::-webkit-scrollbar {
  display: none;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  border: none;
  background: transparent;
  color: rgba(245, 255, 247, 0.84);
  padding: 10px 12px;
  border-radius: 16px;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.2s;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  transform: translateX(3px);
}

.nav-btn.active {
  background:
    linear-gradient(135deg, rgba(255,255,255,0.16), rgba(255,255,255,0.08));
  color: #ffffff;
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.10);
  border: 1px solid rgba(255,255,255,0.10);
}

.nav-icon {
  width: 34px;
  height: 34px;
  min-width: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  background: transparent;
}

.nav-icon svg {
  width: 18px;
  height: 18px;
}

.nav-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.nav-category {
  order: 0;
  min-height: 16px;
  margin: 13px 10px 3px;
  color: rgba(241, 255, 245, 0.52);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
  overflow: hidden;
  white-space: nowrap;
}

.nav-category span {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  transition: opacity var(--transition), max-width var(--transition), transform var(--transition);
}

/* ORDENAÇÃO COMPLETA DO MENU */
.nav-category[data-nav-category="visao-geral"] { order: 1; }
.nav-menu .nav-btn[data-target="dashboard-volumes"] { order: 2; }
.nav-menu .nav-btn[data-target="dash"] { order: 3; }

.nav-category[data-nav-category="mapeamento"] { order: 4; }
.nav-menu .nav-btn[data-target="mapa"] { order: 5; }
.nav-menu .nav-btn[data-target="edificacoes"] { order: 6; }
.nav-menu .nav-btn[data-target="pontos"] { order: 7; }
.nav-menu .nav-btn[data-target="comcap"] { order: 8; }

.nav-category[data-nav-category="gestao-residuos"] { order: 9; }
.nav-menu .nav-btn[data-target="volumosos"] { order: 10; }
.nav-menu .nav-btn[data-target="esgoto"] { order: 11; }
.nav-menu .nav-btn[data-target="especiais"] { order: 12; }
.nav-menu .nav-btn[data-target="organicos"] { order: 13; }

.nav-category[data-nav-category="controle-operacional"] { order: 14; }
.nav-menu .nav-btn[data-target="vistorias"] { order: 15; }
.nav-menu .nav-btn[data-target="equipes"] { order: 16; }
.nav-menu .nav-btn[data-target="educacao-ambiental"] { order: 17; }
.nav-menu .nav-btn[data-target="pendencias"] { order: 18; }

.nav-category[data-nav-category="administracao"] { order: 19; }
.nav-menu .nav-btn[data-target="relatorios"] { order: 20; }
.nav-menu .nav-btn[data-target="registro-atividades"] { order: 21; }

.nav-btn {
  overflow: hidden;
  white-space: nowrap;
}

.nav-menu .nav-btn[data-target="dashboard-volumes"] {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.nav-menu .nav-btn[data-target="dashboard-volumes"] .nav-icon,
.nav-menu .nav-btn[data-target="dashboard-volumes"] .nav-label {
  visibility: visible !important;
  opacity: 1 !important;
}

.sidebar-footer-card {
  margin-top: 10px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.10);
  position: relative;
  z-index: 1;
}

.sidebar-footer-card {
  display: none !important;
}

.sidebar-footer-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: rgba(255,255,255,0.72);
  margin-bottom: 6px;
}

.sidebar-footer-title {
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.4;
}

.sidebar-footer-text {
  margin-top: 6px;
  font-size: 12px;
  color: rgba(255,255,255,0.72);
  line-height: 1.5;
}

/* ==========================================================================
   MAIN
   ========================================================================== */

.main-content {
  flex: 1;
  min-width: 0;
  width: calc(100% - var(--sidebar-width));
  padding: 24px 26px 34px;
}

.header-bar {
  min-height: var(--header-height);
  background:
    radial-gradient(circle at top right, rgba(47, 168, 102, 0.12), transparent 24%),
    linear-gradient(135deg, rgba(255,255,255,0.92), rgba(245, 251, 246, 0.96));
  border: 1px solid rgba(31,111,67,0.10);
  border-radius: 24px;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 20px;
  margin-bottom: 22px;
  backdrop-filter: blur(10px);
}

.header-context {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.header-context {
  display: none !important;
}

.header-bar {
  justify-content: flex-end;
}

.context-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.header-context strong {
  font-size: 18px;
  color: var(--brand-primary-deep);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.usuario-badge {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 12px;
  border: 1px solid rgba(31, 111, 67, 0.14);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 10px 18px rgba(15, 60, 39, 0.08);
}

.usuario-badge[hidden] {
  display: none !important;
}

.usuario-badge-label {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.usuario-badge strong {
  color: var(--brand-primary-deep);
  font-size: 14px;
  line-height: 1.2;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.usuario-badge-action {
  min-height: 30px;
  border: 0;
  border-radius: 10px;
  padding: 6px 10px;
  background: rgba(31, 111, 67, 0.08);
  color: var(--brand-primary);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.usuario-badge-action:hover {
  background: rgba(31, 111, 67, 0.13);
}

.usuario-sidebar {
  width: 100%;
  min-height: auto;
  flex-shrink: 0;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  margin: 0 0 10px;
  padding: 10px;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.usuario-sidebar .usuario-badge-label {
  color: rgba(245, 255, 247, 0.68);
}

.usuario-sidebar strong {
  max-width: 100%;
  color: #ffffff;
}

.usuario-sidebar .usuario-badge-action {
  width: 100%;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

.usuario-sidebar .usuario-badge-action:hover {
  background: rgba(255, 255, 255, 0.18);
}

.header-campus-badge {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(31,111,67,0.08);
  border: 1px solid rgba(31,111,67,0.10);
  color: var(--brand-primary);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.header-campus-badge {
  display: none !important;
}

#btnSair {
  display: none !important;
}

.header-bar {
  display: none !important;
}

/* ==========================================================================
   TABS / SECTIONS
   ========================================================================== */

.tab-content {
  display: none;
  animation: fadeUp 0.28s ease;
}

.tab-content.active {
  display: block;
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.section-header h2 {
  margin: 0;
  color: var(--brand-primary-deep);
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.section-header p {
  margin: 7px 0 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.page-header h2,
.page-header h3 {
  margin: 0;
  color: var(--brand-primary-deep);
}

.page-header p {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 14px;
}

/* ==========================================================================
   CARDS / CONTAINERS
   ========================================================================== */

.card {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(247, 252, 248, 0.98));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 20px;
  margin-bottom: 20px;
  position: relative;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  overflow: hidden;
  backdrop-filter: blur(8px);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 38px rgba(15, 60, 39, 0.10);
  border-color: var(--border-strong);
}

.card h3,
.card h4 {
  margin-top: 0;
  margin-bottom: 10px;
  color: var(--brand-primary-deep);
  letter-spacing: -0.02em;
}

.card p {
  color: var(--text-muted);
  line-height: 1.65;
}

.card-step-title {
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.card-step-title.no-border {
  border-bottom: none;
  padding-bottom: 0;
}

.table-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(247, 252, 248, 0.98));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.empty-state {
  padding: 20px;
  border: 1px dashed var(--border-strong);
  border-radius: 16px;
  background: var(--bg-surface-soft);
  color: var(--text-muted);
  font-size: 14px;
}

/* ==========================================================================
   GRID
   ========================================================================== */

.grid-2,
.grid-3,
.grid-4,
.form-grid,
.dash-cards,
.dash-grid {
  display: grid;
  gap: 18px;
}

.grid-2,
.dash-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4,
.dash-cards {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card.large {
  min-height: 180px;
}

.dash-header {
  margin-bottom: 18px;
}

.dash-header h2 {
  margin: 0;
  color: var(--brand-primary-deep);
  font-size: 28px;
}

.dash-header p {
  margin: 8px 0 0;
  color: var(--text-muted);
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn,
button,
input[type="button"],
input[type="submit"] {
  font: inherit;
}

.btn {
  border: none;
  border-radius: 14px;
  padding: 11px 16px;
  cursor: pointer;
  font-weight: 800;
  font-size: 13px;
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition), background var(--transition), color var(--transition), border-color var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  max-width: 100%;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled,
button:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none !important;
}

.btn-primary,
.btn:not(.secondary):not(.danger):not(.ghost):not(.success) {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
  color: #ffffff;
  box-shadow: 0 14px 24px rgba(31, 111, 67, 0.18);
}

.btn-primary:hover,
.btn:not(.secondary):not(.danger):not(.ghost):not(.success):hover {
  box-shadow: 0 18px 28px rgba(31, 111, 67, 0.22);
}

.btn.secondary {
  background: #ffffff;
  color: var(--brand-primary);
  border: 1px solid rgba(31, 111, 67, 0.16);
  box-shadow: 0 10px 18px rgba(15, 60, 39, 0.06);
}

.btn.secondary:hover {
  background: #f6fbf7;
}

.btn-success,
.btn.success {
  background: linear-gradient(135deg, #178f52, #28b66b);
  color: #ffffff;
  box-shadow: 0 14px 24px rgba(16, 185, 129, 0.18);
}

.btn-danger,
.btn.danger {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: #ffffff;
  box-shadow: 0 14px 24px rgba(239, 68, 68, 0.18);
}

.btn.ghost {
  background: rgba(31,111,67,0.08);
  color: var(--brand-primary);
  border: 1px solid rgba(31,111,67,0.10);
  box-shadow: none;
}

/* ==========================================================================
   INPUTS / FORMS
   ========================================================================== */

label {
  display: block;
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

input,
select,
textarea,
.input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: #ffffff;
  color: var(--text-main);
  padding: 11px 13px;
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition), transform var(--transition);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.02);
}

input:focus,
select:focus,
textarea:focus,
.input:focus {
  border-color: rgba(31, 111, 67, 0.34);
  box-shadow: 0 0 0 4px rgba(31, 111, 67, 0.10);
  background: #fff;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.field-inline {
  display: flex;
  gap: 12px;
  align-items: center;
}

.input-mobile-full {
  width: min(100%, 250px);
}

/* ==========================================================================
   TABLES
   ========================================================================== */

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
}

thead {
  background: #f4faf5;
}

th {
  text-align: left;
  font-size: 11px;
  font-weight: 900;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
}

td {
  padding: 15px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
  color: var(--text-main);
  vertical-align: top;
  word-break: break-word;
}

tbody tr {
  background: rgba(255, 255, 255, 0.65);
  transition: background var(--transition);
}

tbody tr:hover {
  background: #f7fcf8;
}

/* ==========================================================================
   BADGES / STATUS
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid transparent;
  white-space: nowrap;
  max-width: 100%;
}

.badge.success {
  background: var(--success-bg);
  color: #166534;
  border-color: #86efac;
}

.badge.warning {
  background: var(--warning-bg);
  color: #92400e;
  border-color: #fcd34d;
}

.badge.danger {
  background: var(--danger-bg);
  color: #b91c1c;
  border-color: #fca5a5;
}

.badge.info {
  background: var(--info-bg);
  color: #1d4ed8;
  border-color: #93c5fd;
}

.badge.neutral {
  background: var(--neutral-bg);
  color: #475569;
  border-color: #cbd5e1;
}

/* ==========================================================================
   LIST / SMALL METRICS
   ========================================================================== */

.metric-box,
.summary-box {
  background: linear-gradient(135deg, #ffffff, #f6fbf7);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.metric-box .label,
.summary-box .label {
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 800;
}

.metric-box .value,
.summary-box .value {
  font-size: 28px;
  line-height: 1;
  font-weight: 900;
  color: var(--brand-primary);
}

/* ==========================================================================
   MAPA
   ========================================================================== */

.map-container {
  height: clamp(640px, calc(100dvh - 150px), 920px);
  min-height: 640px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.40), rgba(255,255,255,0.18)),
    #dfeee2 url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" opacity="0.06"><path d="M0 0h100v100H0z" fill="none" stroke="%230f4a2a" stroke-width="1"/><circle cx="50" cy="50" r="2" fill="%230f4a2a"/></svg>');
  border-radius: 22px;
  position: relative;
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
}

#mapa .map-card {
  padding: 10px;
}

.map-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.map-header-actions select {
  width: min(260px, 100%);
}

.map-location-btn {
  min-height: 44px;
}

.map-pin {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 8px 14px rgba(0, 0, 0, 0.16);
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.map-pin:hover {
  transform: translate(-50%, -50%) scale(1.24);
  z-index: 10;
  box-shadow: 0 12px 18px rgba(0, 0, 0, 0.22);
}

.map-location-control {
  min-height: 42px;
  margin: 10px 10px 0 0;
  padding: 0 16px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 999px;
  background: #ffffff;
  color: #174ea6;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

.map-location-control:hover {
  transform: none;
  background: #eff6ff;
}

.map-location-control.is-loading {
  opacity: 0.78;
  cursor: wait;
}

.map-info-card {
  min-width: 210px;
  max-width: 280px;
  display: grid;
  gap: 6px;
  color: var(--text-main);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

.map-info-card__eyebrow {
  font-size: 11px;
  font-weight: 900;
  color: var(--brand-primary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.map-info-card strong {
  color: var(--brand-primary-deep);
  font-size: 16px;
  line-height: 1.25;
}

.map-info-card span,
.map-info-card small {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.35;
}

.map-info-card__btn {
  margin-top: 6px;
  min-height: 36px;
  border: none;
  border-radius: 10px;
  background: var(--brand-primary);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

/* ==========================================================================
   DRAWER
   ========================================================================== */

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 20, 13, 0.40);
  z-index: 40;
  display: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  backdrop-filter: blur(3px);
}

.drawer {
  position: fixed;
  top: 0;
  right: -470px;
  width: 430px;
  max-width: 100%;
  height: 100vh;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(246,251,247,0.98));
  z-index: 50;
  box-shadow: -18px 0 36px rgba(15, 60, 39, 0.16);
  transition: right 0.28s ease;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border-color);
}

.drawer-header {
  padding: 22px 22px 18px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  background:
    linear-gradient(135deg, rgba(31,111,67,0.08), rgba(47,168,102,0.04));
}

.drawer-header h3,
.drawer-header h2 {
  margin: 0;
  color: var(--brand-primary-deep);
  font-size: 20px;
}

.drawer-body {
  padding: 22px;
  overflow-y: auto;
  flex: 1;
}

.drawer.open {
  right: 0;
}

.drawer-overlay.open {
  display: block;
  opacity: 1;
}

/* ==========================================================================
   VISTORIAS
   ========================================================================== */

.vistoria-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
}

.vistoria-checklist-card {
  background: linear-gradient(180deg, #f4fbf6, #edf7f0);
  border-color: rgba(31, 111, 67, 0.18);
}

.vistoria-summary {
  position: sticky;
  top: 90px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(247,252,248,0.98));
  border: 1px solid var(--border-color);
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  padding: 22px;
}

.vistoria-summary h3 {
  margin-bottom: 18px;
  text-align: center;
}

.summary-metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 15px;
}

.summary-metric:last-of-type {
  border-bottom: none;
}

.summary-metric strong {
  font-size: 24px;
  line-height: 1;
}

.summary-ok {
  color: #16a34a;
}

.summary-parcial {
  color: #d97706;
}

.summary-erro {
  color: #dc2626;
}

.summary-result {
  margin-top: 18px;
  border-radius: 18px;
  padding: 22px 18px;
  border: 1px solid var(--border-color);
  background: rgba(148, 163, 184, 0.14);
  text-align: center;
}

.summary-result h3 {
  margin: 0 0 12px;
  font-size: 40px;
  color: var(--brand-primary-deep);
  line-height: 1;
}

.summary-result .badge {
  margin-inline: auto;
}

.ponto-em-vistoria-info {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(31,111,67,0.08), rgba(255,255,255,0.92));
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.accordion {
  border: 1px solid var(--border-color);
  border-radius: 18px;
  margin-bottom: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(247, 252, 248, 0.98));
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.accordion-header {
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(31,111,67,0.06), rgba(47,168,102,0.03));
  cursor: pointer;
  font-weight: 800;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--brand-primary-deep);
  transition: background var(--transition);
}

.accordion-header:hover {
  background: linear-gradient(135deg, rgba(31,111,67,0.08), rgba(47,168,102,0.04));
}

.accordion-arrow {
  font-size: 16px;
  transition: transform 0.2s ease;
}

.accordion.open .accordion-arrow {
  transform: rotate(180deg);
}

.accordion-content {
  display: none;
  padding: 16px 18px 18px;
  border-top: 1px solid var(--border-color);
  background: #ffffff;
}

.accordion.open .accordion-content {
  display: block;
}

.check-item {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) 210px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--border-color);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #fbfefb);
  transition:
    border-color var(--transition),
    box-shadow var(--transition),
    transform var(--transition),
    background var(--transition);
}

.check-item:last-child {
  margin-bottom: 0;
}

.check-item:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.check-item.status-animating {
  animation: statusPulse 0.28s ease;
}

.check-item.status-conforme {
  border-color: #9ee6b8;
  background: linear-gradient(180deg, rgba(240,253,244,0.95), rgba(255,255,255,0.98));
  box-shadow: 0 10px 22px rgba(16, 185, 129, 0.07);
}

.check-item.status-parcial {
  border-color: #f7d277;
  background: linear-gradient(180deg, rgba(255,251,235,0.96), rgba(255,255,255,0.98));
  box-shadow: 0 10px 22px rgba(245, 158, 11, 0.07);
}

.check-item.status-nao-conforme {
  border-color: #f4aaaa;
  background: linear-gradient(180deg, rgba(254,242,242,0.96), rgba(255,255,255,0.98));
  box-shadow: 0 10px 22px rgba(239, 68, 68, 0.07);
}

.check-item.status-na {
  border-color: var(--border-color);
  background: linear-gradient(180deg, #ffffff, #fbfefb);
}

.check-item-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.check-item-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.45;
}

.check-item-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-resolver-item,
.btn-limpar-item {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 12px;
}

.btn-resolver-item {
  background: linear-gradient(135deg, #178f52, #28b66b) !important;
  color: #ffffff !important;
  border: none !important;
}

.status-select {
  min-height: 44px;
  align-self: center;
}

.status-select.select-conforme {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.status-select.select-parcial {
  border-color: #fcd34d;
  background: #fff7ed;
  color: #92400e;
}

.status-select.select-nao-conforme {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #b91c1c;
}

.status-select.select-na {
  border-color: var(--border-color);
  background: #ffffff;
  color: var(--text-main);
}

.vistoria-obs {
  min-height: 44px;
  align-self: center;
}

.vistoria-foto-box {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 10px 12px;
  align-items: start;
  padding-top: 2px;
}

.btn-camera {
  min-height: 42px;
  width: 100%;
  justify-content: center;
  font-size: 12px;
}

.btn-camera svg {
  flex: 0 0 auto;
}

.vistoria-foto-legenda {
  min-height: 42px;
}

.vistoria-foto-info {
  grid-column: 1 / -1;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.4;
  margin-top: -2px;
}

.vistoria-foto-preview {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.vistoria-thumb {
  width: 92px;
  height: 92px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: #f4faf5;
  box-shadow: var(--shadow-sm);
}

.vistoria-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ==========================================================================
   RELATÓRIOS
   ========================================================================== */

.relatorios-layout {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.relatorio-topo {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 1fr);
  gap: 22px;
  align-items: stretch;
}

.relatorio-card-principal,
.relatorio-resumo-card,
.relatorio-preview-card {
  margin-bottom: 0;
}

.relatorio-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.relatorio-card-header h3 {
  margin: 0;
  font-size: 18px;
}

.relatorio-card-header p {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.relatorio-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.relatorio-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.relatorio-acoes {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
}

.relatorio-acoes .btn {
  min-width: 180px;
}

.relatorio-resumo-card {
  background:
    radial-gradient(circle at top right, rgba(47,168,102,0.10), transparent 35%),
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(244,250,246,0.98));
}

.relatorio-resumo-box {
  min-height: 180px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(31,111,67,0.10);
  background: rgba(31,111,67,0.04);
  color: var(--text-muted);
  line-height: 1.65;
}

.relatorio-preview-card {
  min-height: 360px;
}

.relatorio-preview-box {
  min-height: 280px;
  padding: 20px;
  border-radius: 18px;
  border: 1px solid var(--border-color);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(247,252,248,0.96));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}

.relatorio-preview-box:empty::before {
  content: "A pré-visualização do documento aparecerá aqui.";
  color: var(--text-soft);
}

/* ==========================================================================
   REGISTRO DE ATIVIDADES
   ========================================================================== */

#registro-atividades.tab-content.active {
  display: flex;
}

.audit-log-section {
  width: 100%;
  min-height: calc(100dvh - 58px);
}

.audit-log-frame {
  display: block;
  flex: 1;
  width: 100%;
  min-height: calc(100dvh - 58px);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

@media (max-width: 900px) {
  .audit-log-section,
  .audit-log-frame {
    min-height: calc(100dvh - 90px);
  }
}

@media (max-width: 640px) {
  .audit-log-section,
  .audit-log-frame {
    min-height: calc(100dvh - 86px);
  }

  .audit-log-frame {
    border-radius: 0;
  }
}

/* ==========================================================================
   TOAST / ALERTA VISUAL
   ========================================================================== */

.toast-container {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 5000;
  display: grid;
  gap: 10px;
  width: min(390px, calc(100vw - 24px));
  pointer-events: none;
}

.toast {
  --toast-color: var(--brand-primary);
  --toast-bg: #ffffff;
  pointer-events: auto;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 30px;
  align-items: start;
  gap: 12px;
  width: 100%;
  padding: 14px 14px 14px 16px;
  border-radius: 16px;
  background: var(--toast-bg);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-left: 5px solid var(--toast-color);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.18);
  color: var(--text-main);
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast.leaving {
  opacity: 0;
  transform: translateY(8px) scale(0.98);
}

.toast-success {
  --toast-color: #16a34a;
  --toast-bg: #fbfffc;
}

.toast-error {
  --toast-color: #dc2626;
  --toast-bg: #fffafa;
}

.toast-warning {
  --toast-color: #d97706;
  --toast-bg: #fffdf7;
}

.toast-info {
  --toast-color: #2563eb;
  --toast-bg: #fbfdff;
}

.toast-icon {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--toast-color) 13%, #ffffff);
  color: var(--toast-color);
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
}

.toast-content {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.toast-content strong {
  display: block;
  color: var(--text-main);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.2;
}

.toast-content span {
  display: block;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.toast-close {
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.05);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  box-shadow: none;
}

.toast-close:hover {
  transform: none;
  background: rgba(15, 23, 42, 0.09);
  color: var(--text-main);
}

.custom-alert,
.custom-confirm {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 2000; /* CORRIGIDO AQUI */
  min-width: 280px;
  max-width: 420px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255,255,255,0.98);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  color: var(--text-main);
}

/* ==========================================================================
   MODAL / FLOATING PANELS
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 20, 13, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  z-index: 80;
  backdrop-filter: blur(4px);
}

.usuario-modal-overlay {
  z-index: 3200;
}

.usuario-modal-overlay[hidden] {
  display: none !important;
}

.usuario-modal {
  width: min(480px, calc(100vw - 32px));
}

.usuario-modal .modal-header h3 {
  margin: 0;
  color: var(--brand-primary-deep);
  font-size: 22px;
}

.usuario-modal .modal-header p {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 14px;
}

.modal {
  width: min(760px, 100%);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(246,251,247,0.98));
  border: 1px solid var(--border-color);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-header {
  padding: 20px 22px;
  border-bottom: 1px solid var(--border-color);
  background:
    linear-gradient(135deg, rgba(31,111,67,0.06), rgba(47,168,102,0.04));
}

.modal-body {
  padding: 22px;
}

.modal-footer {
  padding: 18px 22px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ==========================================================================
   HELPERS
   ========================================================================== */

.muted {
  color: var(--text-muted);
}

.text-center {
  text-align: center;
}

.hidden {
  display: none !important;
}

.w-full {
  width: 100%;
}

.section-spacing-top {
  margin-top: 20px;
}

.section-spacing-top-sm {
  margin-top: 12px;
}

.header-inline-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.stack-actions {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.small-muted-text {
  font-size: 13px;
  margin-bottom: 16px;
  color: var(--text-muted);
}

.vistoria-note {
  font-size: 11px;
  margin-top: 12px;
  opacity: 0.78;
  text-align: center;
}

.map-filter-mobile {
  width: min(100%, 260px);
}

.equipe-form-card {
  display: none;
  margin-bottom: 20px;
}

.equipe-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.relatorio-form-grid {
  grid-template-columns: 1fr;
}

.mt-0 { margin-top: 0 !important; }
.mt-8 { margin-top: 8px !important; }
.mt-12 { margin-top: 12px !important; }
.mt-16 { margin-top: 16px !important; }
.mt-20 { margin-top: 20px !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-8 { margin-bottom: 8px !important; }
.mb-12 { margin-bottom: 12px !important; }
.mb-16 { margin-bottom: 16px !important; }
.mb-20 { margin-bottom: 20px !important; }

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes statusPulse {
  0% {
    transform: scale(0.995);
  }
  50% {
    transform: scale(1.004);
  }
  100% {
    transform: scale(1);
  }
}

/* ==========================================================================
   RESPONSIVO BASE
   ========================================================================== */

@media (max-width: 1280px) {
  .grid-4,
  .dash-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vistoria-layout {
    grid-template-columns: 1fr;
  }

  .vistoria-summary {
    position: static;
  }

  .check-item {
    grid-template-columns: 1fr;
  }

  .status-select,
  .vistoria-obs {
    align-self: stretch;
  }
}

@media (max-width: 1080px) {
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-2,
  .dash-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .relatorio-topo {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .header-bar,
  .card,
  .table-card {
    border-radius: 18px;
  }

  .section-header h2 {
    font-size: 24px;
  }

  .section-header p {
    font-size: 13px;
  }

  .grid-4,
  .grid-3,
  .dash-cards {
    grid-template-columns: 1fr;
  }

  .brand-header {
    padding-left: 6px;
    padding-right: 6px;
  }

  .nav-btn {
    padding: 12px;
  }

  .drawer {
    width: 100%;
    right: -100%;
  }

  .drawer-header,
  .drawer-body {
    padding: 16px;
  }

  .summary-result h3 {
    font-size: 30px;
  }

  .check-item {
    padding: 14px;
  }

  .check-item-actions {
    flex-direction: column;
  }

  .check-item-actions .btn {
    width: 100%;
  }

  .vistoria-foto-box {
    grid-template-columns: 1fr;
  }

  .vistoria-thumb {
    width: 84px;
    height: 84px;
  }

  .map-container {
    height: clamp(620px, calc(100dvh - 112px), 820px);
    min-height: 620px;
  }

  .btn,
  button,
  input,
  select,
  textarea {
    font-size: 16px;
  }

  .input-mobile-full,
  .map-filter-mobile {
    width: 100%;
  }

  .tabs-equipes {
    flex-direction: column;
  }

  .tabs-equipes .btn {
    width: 100%;
  }

  .confirm-modal,
  .modal,
  .comcap-modal {
    border-radius: 18px;
  }

  .confirm-actions,
  .modal-footer,
  .comcap-modal-actions,
  .esgoto-form-acoes,
  .relatorio-acoes {
    flex-direction: column;
  }

  .confirm-actions .btn,
  .modal-footer .btn,
  .comcap-modal-actions .btn,
  .esgoto-form-acoes .btn,
  .relatorio-acoes .btn {
    width: 100%;
  }

  .toast-container {
    right: 12px;
    left: 12px;
    bottom: 12px;
    width: auto;
  }

  .custom-alert,
  .custom-confirm {
    right: 12px;
    left: 12px;
    bottom: 12px;
    min-width: 0;
    max-width: none;
  }

  .table-mobile-cards thead {
    display: none;
  }

  .table-mobile-cards,
  .table-mobile-cards tbody,
  .table-mobile-cards tr,
  .table-mobile-cards td {
    display: block;
    width: 100%;
  }

  .table-mobile-cards tr {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    background: #ffffff;
    border-radius: 14px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
  }

  .table-mobile-cards td {
    border: none;
    padding: 8px 0;
    font-size: 13px;
  }

  .table-mobile-cards td:empty {
    display: none;
  }

  .table-volumosos {
    min-width: 820px;
  }

  .relatorio-resumo-box,
  .relatorio-preview-box {
    padding: 16px;
  }
}

@media (max-width: 520px) {
  .brand-mark {
    width: 46px;
    height: 46px;
    min-width: 46px;
  }

  .brand-text h1 {
    font-size: 17px;
  }

  .brand-text span {
    font-size: 11px;
  }

  .card {
    padding: 16px;
  }

  .section-header {
    gap: 12px;
  }

  .section-header h2 {
    font-size: 22px;
  }

  .summary-metric {
    font-size: 14px;
  }

  .summary-metric strong {
    font-size: 22px;
  }

  .summary-result {
    padding: 18px 14px;
  }

  .summary-result h3 {
    font-size: 28px;
  }

  .map-container {
    height: clamp(600px, calc(100dvh - 104px), 780px);
    min-height: 600px;
  }
}

/* ==========================================================================
   CORREÇÕES DO MODAL DE CONFIRMAÇÃO
   ========================================================================== */

.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 20, 13, 0.42);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
  z-index: 2000; /* CORRIGIDO AQUI */
  backdrop-filter: blur(4px);
}

.confirm-overlay.open {
  display: flex;
}

.confirm-modal {
  width: min(460px, 100%);
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(246,251,247,0.98));
  border: 1px solid var(--border-color);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  padding: 24px;
  text-align: center;
}

.confirm-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 28px;
  font-weight: 900;
}

.confirm-modal h3 {
  margin: 0 0 8px;
  color: var(--brand-primary-deep);
}

.confirm-modal p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.confirm-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.confirm-actions .btn {
  width: auto;
  min-width: 112px;
  min-height: 48px;
  padding: 12px 20px;
}

.confirm-actions .btn.danger {
  border: 2px solid #111827;
}

@media (max-width: 520px) {
  .confirm-actions .btn {
    width: 100%;
  }
}

/* ==========================================================================
   COMCAP
   ========================================================================== */

.comcap-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.comcap-btn-action {
  min-height: 36px;
  padding: 8px 12px;
  font-size: 12px;
  border-radius: 12px;
}

.comcap-history-row td {
  padding-top: 0;
  background: #fbfefb;
}

.comcap-history-box {
  margin-top: 4px;
  background: linear-gradient(180deg, #f8fcf9, #f2f8f4);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 16px;
}

.comcap-history-box strong {
  display: block;
  color: var(--brand-primary-deep);
  margin-bottom: 10px;
}

.comcap-history-empty {
  color: var(--text-muted);
  font-size: 13px;
}

.comcap-history-table-wrap {
  overflow-x: auto;
}

.comcap-history-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
}

.comcap-history-table th,
.comcap-history-table td {
  padding: 10px 12px;
  font-size: 13px;
}

.comcap-empty {
  opacity: 0.7;
}

.comcap-empty-row {
  text-align: center;
  opacity: 0.8;
}

.comcap-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 20, 13, 0.44);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  z-index: 200;
  backdrop-filter: blur(5px);
}

.comcap-modal-overlay.hidden {
  display: none;
}

.comcap-modal {
  width: min(820px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: linear-gradient(180deg, rgba(255,255,255,0.99), rgba(245,251,246,0.99));
  border: 1px solid var(--border-color);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
}

.comcap-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(135deg, rgba(31,111,67,0.07), rgba(47,168,102,0.03));
}

.comcap-modal-header h3 {
  margin: 0;
  color: var(--brand-primary-deep);
}

.comcap-modal-header p {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.comcap-modal-body {
  padding: 24px;
}

.comcap-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.comcap-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.comcap-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  background: #fff;
  cursor: pointer;
  margin: 0;
}

.comcap-check input {
  width: auto;
  min-height: auto;
  margin: 0;
}

.comcap-check span {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

body.comcap-modal-open {
  overflow: hidden;
}

.comcap-cards-wrap {
  display: none;
  margin-top: 16px;
}

.comcap-cards-grid {
  display: grid;
  gap: 14px;
}

.comcap-card-mobile {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.comcap-card-mobile__top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.comcap-card-mobile__top h3 {
  margin: 0;
  color: var(--brand-primary-deep);
  font-size: 18px;
  line-height: 1.2;
  word-break: break-word;
}

.comcap-card-mobile__top p {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.comcap-card-mobile__body {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.comcap-card-mobile__row {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--neutral-bg);
}

.comcap-card-mobile__row span {
  color: var(--brand-primary-deep);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.comcap-card-mobile__row strong {
  font-size: 16px;
  color: var(--text-main);
}

.comcap-card-mobile__badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.comcap-card-mobile__actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.comcap-card-mobile__actions .btn {
  width: 100%;
  min-height: 48px;
}

.comcap-card-mobile__history {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
}

.comcap-card-mobile__history-item {
  display: grid;
  gap: 4px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 13px;
}

.comcap-card-mobile__history-item:last-child {
  border-bottom: 0;
}

@media (max-width: 720px) {
  .comcap-modal-overlay {
    align-items: flex-end;
    padding: 10px;
  }

  .comcap-modal {
    width: 100%;
    max-height: calc(100dvh - 20px);
    border-radius: 22px;
  }

  .comcap-checkbox-grid {
    grid-template-columns: 1fr;
  }

  .comcap-modal-header,
  .comcap-modal-body {
    padding: 16px;
  }

  .comcap-modal-header {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .comcap-modal-header .btn,
  .comcap-modal-actions .btn {
    width: 100%;
  }

  .comcap-modal-body .form-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .comcap-check {
    min-height: 54px;
  }

  .comcap-modal-actions {
    flex-direction: column-reverse;
  }

  .comcap-actions {
    flex-direction: column;
  }

  .comcap-btn-action {
    width: 100%;
  }
}

/* ===== COMCAP BOTÕES ===== */

.comcap-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.comcap-actions .btn {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 6px;
  box-shadow: none;
}

.comcap-actions .btn:not(.secondary):not(.danger) {
  background: #2f7d4a;
  color: #fff;
}

.comcap-actions .btn.secondary {
  background: #f1f5f2;
  color: #2f7d4a;
  border: 1px solid #cfe3d6;
}

.comcap-actions .btn.danger {
  background: #fdecec;
  color: #c0392b;
  border: 1px solid #f5c6c6;
}

.comcap-actions .btn:hover {
  opacity: 0.85;
}

/* ===== DASHBOARD TIPOS ===== */

.dash-tipos {
  padding: 22px;
}

.card-tipo {
  min-height: 110px;
  padding: 16px;
  border-radius: 16px;
  transition: 0.2s;
}

.card-tipo:hover {
  transform: translateY(-2px);
}

.tipo-title {
  font-size: 12px;
  font-weight: 800;
  color: #143127;
  margin-bottom: 8px;
}

.tipo-value {
  font-size: 28px;
  font-weight: 900;
  color: #1f6f43;
}

.tipo-sub {
  font-size: 11px;
  color: #6a8174;
}

.grupo-contentores {
  background: linear-gradient(135deg, #e8f7ef, #f6fbf8);
}

.grupo-lixeiras {
  background: linear-gradient(135deg, #edf6fb, #f7fbfd);
}

.grupo-pev {
  background: linear-gradient(135deg, #fff6e6, #fffaf2);
}

.grupo-outros {
  background: linear-gradient(135deg, #f1f5f3, #f7faf9);
}

.total-card {
  text-align: center;
  padding: 18px;
}

.total-card strong {
  font-size: 32px;
  color: #1f6f43;
}

.total-card.destaque {
  background: linear-gradient(135deg, #dff5e6, #f0fbf4);
}

/* ==========================================================================
   RESÍDUOS VOLUMOSOS
   ========================================================================== */

.table-volumosos {
  min-width: 980px;
}

.table-volumosos .linha-sem-nf {
  background: #fff7ed;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid transparent;
  white-space: nowrap;
}

.status-solicitado {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}

.status-coletado {
  background: #d1fae5;
  color: #166534;
  border-color: #86efac;
}

.status-pendente {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}

/* ===== PONTOS HEADER ===== */

.pontos-header {
  align-items: flex-start;
}

.pontos-header-texto {
  flex: 1;
  min-width: 260px;
}

.pontos-header-acoes {
  width: min(100%, 520px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pontos-header-filtros {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.pontos-header-botoes {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.pontos-search,
.pontos-filter {
  width: 100%;
}

.pontos-header-botoes .btn {
  min-width: 160px;
}

/* ===== ZEBRADO TABELA VOLUMOSOS ===== */

.table-volumosos tbody tr:nth-child(even) {
  background: #f3f4f6;
}

.table-volumosos tbody tr:nth-child(odd) {
  background: #ffffff;
}

/* ===== ESPAÇAMENTO VOLUMOSOS ===== */

.volumosos-metrics {
  margin-top: 20px;
  gap: 20px;
}

/* =========================
   DASHBOARD VOLUMES
========================= */

.dashboard-volumes-filter {
  width: min(260px, 100%);
}

#dashboard-volumes.tab-content.active {
  display: block !important;
  visibility: visible !important;
}

#dashboard-volumes {
  min-width: 0;
}

.dashboard-volumes-filter label {
  color: var(--brand-primary-deep);
}

.dashboard-volumes-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.dashboard-volumes-chart-card {
  min-height: 260px;
  display: flex;
  flex-direction: column;
}

.dashboard-volumes-card-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.dashboard-volumes-card-header h3 {
  margin-bottom: 4px;
}

.dashboard-volumes-card-header p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}

.dashboard-volumes-canvas-wrap {
  position: relative;
  height: 165px;
  min-height: 165px;
  width: min(100%, 340px);
  margin: 0 auto;
  flex: 0 0 auto;
}

.dashboard-volumes-canvas-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

.dashboard-volumes-chart-status {
  min-height: 18px;
  margin: 8px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

.dashboard-volumes-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 18px;
  margin: 0 0 18px;
}

.dashboard-volumes-kpi-card {
  min-height: 128px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.dashboard-volumes-kpi-card .tipo-value {
  font-size: 24px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.dashboard-volumes-kpi-card .tipo-sub {
  margin-top: 6px;
  font-weight: 700;
}

@media (max-width: 900px) {
  .dashboard-volumes-filter {
    width: 100%;
  }

  .dashboard-volumes-charts {
    grid-template-columns: 1fr;
  }

  .dashboard-volumes-chart-card {
    min-height: 240px;
  }

  .dashboard-volumes-canvas-wrap {
    height: 150px;
    min-height: 150px;
    width: min(100%, 300px);
  }
}

#tab-equipes .table {
  width: 100%;
  table-layout: fixed;
}

#tab-equipes .table th,
#tab-equipes .table td {
  vertical-align: middle;
}

#tab-equipes .table td:last-child,
#tab-equipes .table th:last-child {
  text-align: right;
  white-space: nowrap;
}

#tab-equipes .table td,
#tab-equipes .table th {
  padding: 14px 16px;
}

#tab-equipes .table tbody tr td[colspan] {
  text-align: center !important;
}

#tab-equipes .btn-excluir-equipe {
  min-width: 96px;
}

/* =========================
   ESGOTO
========================= */

#esgoto .section-header {
  margin-bottom: 18px;
}

#esgoto .card {
  margin-bottom: 18px;
}

#esgoto .form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

#esgoto input,
#esgoto select,
#esgoto textarea {
  width: 100%;
}

#esgoto textarea {
  min-height: 110px;
  resize: vertical;
}

#esgoto .table-volumosos th,
#esgoto .table-volumosos td {
  vertical-align: middle;
}

#esgoto .acoes-coluna {
  white-space: nowrap;
}

#esgoto .volumosos-metrics {
  margin-top: 6px;
}

#esgoto .total-card {
  border-radius: 18px;
  padding: 18px;
}

#esgoto .tipo-title {
  font-size: 13px;
  font-weight: 700;
  opacity: 0.85;
  margin-bottom: 8px;
}

#esgoto .tipo-value {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
}

.form-esgoto {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-esgoto-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  gap: 16px;
  align-items: stretch;
}

.form-esgoto .form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-esgoto .form-group label {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-primary-deep);
}

.form-esgoto .form-group input,
.form-esgoto .form-group select,
.form-esgoto .form-group textarea {
  width: 100%;
  box-sizing: border-box;
}

.form-group-status {
  grid-column: span 1;
}

.form-group-observacoes {
  grid-column: span 2;
}

.form-group-observacoes textarea {
  min-height: 120px;
  resize: vertical;
}

.esgoto-form-acoes {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.esgoto-form-acoes .btn {
  min-height: 48px;
  padding: 0 22px;
}

@media (max-width: 1200px) {
  .form-esgoto-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .form-group-observacoes {
    grid-column: span 2;
  }
}

@media (max-width: 768px) {
  #esgoto .tipo-value {
    font-size: 22px;
  }

  #esgoto .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .form-esgoto-grid {
    grid-template-columns: 1fr;
  }

  .form-group-observacoes,
  .form-group-status {
    grid-column: span 1;
  }

  .esgoto-form-acoes {
    flex-direction: column;
    align-items: stretch;
  }

  .esgoto-form-acoes .btn {
    width: 100%;
  }
}

/* ==========================================================================
   RESÍDUOS ORGÂNICOS
   ========================================================================== */

#organicos .section-header {
  margin-bottom: 18px;
}

#organicos .card {
  margin-bottom: 18px;
}

#organicos .form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.residuos-organicos-tabs {
  display: flex;
  gap: 10px;
  margin: 0 0 20px 0;
  flex-wrap: wrap;
}

.residuos-organicos-tabs .tab-organico.active {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
  color: #ffffff;
  border: 1px solid rgba(31, 111, 67, 0.16);
  box-shadow: 0 14px 24px rgba(31, 111, 67, 0.18);
}

.organicos-tab-panel {
  display: none;
}

.organicos-tab-panel.active {
  display: block;
}

.organicos-card-header {
  align-items: center;
  margin-bottom: 16px;
}

.organicos-card-header h3 {
  margin: 0;
}

.organicos-card-header p {
  margin: 6px 0 0;
}

.organicos-filter-grid {
  align-items: end;
  margin-bottom: 16px;
}

.organicos-filter-action {
  justify-content: flex-end;
}

.organicos-filter-action label {
  visibility: hidden;
}

.organicos-filter-action .btn {
  min-height: 44px;
}

#organicos .organicos-metrics {
  margin-top: 6px;
}

#organicos .total-card {
  border-radius: 18px;
  padding: 18px;
}

#organicos .tipo-title {
  font-size: 13px;
  font-weight: 700;
  opacity: 0.85;
  margin-bottom: 8px;
}

#organicos .tipo-value {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
}

.organicos-placeholder-card {
  min-height: 110px;
  border-style: dashed;
  background: linear-gradient(135deg, #f3f7f4, #fbfdfb);
  box-shadow: none;
}

.organicos-total-card {
  border-color: rgba(31, 111, 67, 0.24);
}

.organicos-total-card .tipo-title,
.organicos-total-card .tipo-value {
  color: var(--brand-primary-deep);
}

#organicos .table-organicos {
  min-width: 900px;
}

#organicos .table-organicos-composteiras {
  min-width: 760px;
}

#organicos .table-volumosos th,
#organicos .table-volumosos td {
  vertical-align: middle;
}

#organicos .acoes-coluna {
  white-space: nowrap;
}

#organicos .acoes-coluna .btn {
  margin-right: 6px;
}

.organicos-modal {
  width: min(680px, 100%);
}

.organicos-modal-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.organicos-modal-open {
  overflow: hidden;
}

@media (max-width: 768px) {
  #organicos .tipo-value {
    font-size: 22px;
  }

  #organicos .form-grid,
  .organicos-modal-grid {
    grid-template-columns: 1fr;
  }

  .residuos-organicos-tabs {
    flex-direction: column;
  }

  .residuos-organicos-tabs .btn,
  .organicos-filter-action .btn,
  .organicos-modal .comcap-modal-actions .btn {
    width: 100%;
  }
}

/* =========================
   RESÍDUOS ESPECIAIS
========================= */

#especiais .section-header {
  margin-bottom: 18px;
}

#especiais .card {
  margin-bottom: 18px;
}

#especiais .form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

#especiais input,
#especiais select,
#especiais textarea {
  width: 100%;
}

#especiais .table-volumosos {
  min-width: 820px;
}

#especiais .table-volumosos th,
#especiais .table-volumosos td {
  vertical-align: middle;
}

#especiais .acoes-coluna {
  white-space: nowrap;
}

#especiais .volumosos-metrics {
  margin-top: 6px;
}

#especiais .total-card {
  border-radius: 18px;
  padding: 18px;
}

#especiais .tipo-title {
  font-size: 13px;
  font-weight: 700;
  opacity: 0.85;
  margin-bottom: 8px;
}

#especiais .tipo-value {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
}

.residuos-especiais-tabs {
  display: flex;
  gap: 10px;
  margin: 0 0 20px 0;
  flex-wrap: wrap;
}

.residuos-especiais-tabs .tab-especial.active {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
  color: #ffffff;
  border: 1px solid rgba(31, 111, 67, 0.16);
  box-shadow: 0 14px 24px rgba(31, 111, 67, 0.18);
}

.especial-check {
  min-height: 44px;
}

.especial-check input {
  width: auto;
  min-height: auto;
}

.especial-mes-wrap.is-hidden {
  display: none !important;
}

.especial-form-acoes > div {
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  #especiais .tipo-value {
    font-size: 22px;
  }

  #especiais .form-grid {
    grid-template-columns: 1fr;
  }

  .residuos-especiais-tabs {
    flex-direction: column;
  }

  .residuos-especiais-tabs .btn,
  .especial-form-acoes .btn {
    width: 100%;
  }
}

/* =========================================================
   MENU MOBILE LIMPO
   ========================================================= */

.btn-menu-mobile {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 3000;
  width: 48px;
  height: 48px;
  padding: 0;
  background: #1f6f43;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 22px;
  line-height: 1;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px rgba(0,0,0,0.18);
}

.overlay-menu {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  z-index: 2998;
  display: none;
}

.overlay-menu.open {
  display: block;
}

/* ===== DESKTOP ===== */

@media (min-width: 901px) {
  body {
    display: block !important;
    padding-left: var(--sidebar-collapsed-width);
  }

  .btn-menu-mobile {
    display: none !important;
  }

  .overlay-menu {
    display: none !important;
  }

  .sidebar,
  .sidebar.desktop-fixed {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: var(--sidebar-collapsed-width) !important;
    min-width: var(--sidebar-collapsed-width) !important;
    height: 100vh !important;
    padding: 18px 10px 14px !important;
    transform: none !important;
    margin-left: 0 !important;
    transition:
      width 0.28s ease,
      min-width 0.28s ease,
      padding 0.28s ease,
      box-shadow 0.28s ease !important;
    will-change: width;
  }

  .sidebar:hover,
  .sidebar:focus-within,
  .sidebar.desktop-fixed:hover,
  .sidebar.desktop-fixed:focus-within {
    width: var(--sidebar-expanded-width) !important;
    min-width: var(--sidebar-expanded-width) !important;
    padding: 18px 14px 14px !important;
    box-shadow: 18px 0 42px rgba(15, 60, 39, 0.22);
  }

  .brand-header {
    justify-content: center;
    padding-left: 6px;
    padding-right: 6px;
    overflow: hidden;
    transition: justify-content var(--transition);
  }

  .sidebar:hover .brand-header,
  .sidebar:focus-within .brand-header {
    justify-content: flex-start;
  }

  .sidebar:not(:hover):not(:focus-within) .usuario-sidebar {
    display: none !important;
  }

  .brand-text,
  .nav-label {
    max-width: 0;
    opacity: 0;
    transform: translateX(-8px);
    transition:
      opacity 0.2s ease,
      max-width 0.28s ease,
      transform 0.28s ease;
    white-space: nowrap;
  }

  .sidebar:hover .brand-text,
  .sidebar:focus-within .brand-text,
  .sidebar:hover .nav-label,
  .sidebar:focus-within .nav-label {
    max-width: 210px;
    opacity: 1;
    transform: translateX(0);
  }

  .sidebar:not(:hover):not(:focus-within) .nav-btn {
    justify-content: center;
    gap: 0;
    padding-inline: 10px;
  }

  .sidebar:not(:hover):not(:focus-within) .nav-icon {
    margin: 0 auto;
  }

  .sidebar:not(:hover):not(:focus-within) .nav-category {
    min-height: 10px;
    margin: 10px 14px 5px;
    position: relative;
  }

  .sidebar:not(:hover):not(:focus-within) .nav-category span {
    max-width: 0;
    opacity: 0;
    transform: translateX(-8px);
  }

  .sidebar:not(:hover):not(:focus-within) .nav-category::before {
    content: "";
    display: block;
    width: 100%;
    height: 1px;
    border-radius: 999px;
    background: rgba(245, 255, 247, 0.16);
  }

  .sidebar:hover .nav-category span,
  .sidebar:focus-within .nav-category span {
    max-width: 210px;
    opacity: 1;
    transform: translateX(0);
  }

  .main-content {
    width: auto !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    padding: 24px 26px 34px !important;
  }

  .header-actions {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 10px !important;
    width: auto !important;
  }

  .pontos-header-botoes {
    flex-direction: row !important;
  }

  .pontos-header-botoes .btn {
    width: auto !important;
    min-width: 160px !important;
  }
}

/* ===== MOBILE / TABLET ===== */

@media (max-width: 900px) {
  body {
    display: block !important;
    padding-left: 0 !important;
  }

  .btn-menu-mobile {
    display: inline-flex !important;
  }

  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: min(300px, calc(100vw - 32px)) !important;
    min-width: min(300px, calc(100vw - 32px)) !important;
    max-width: calc(100vw - 32px) !important;
    height: 100vh !important;
    z-index: 2999 !important;
    transition: transform 0.28s ease !important;
    transform: translateX(-105%) !important;
    padding-top: 68px !important;
    border-right: 1px solid rgba(255,255,255,0.08) !important;
    border-bottom: none !important;
    box-shadow: 12px 0 32px rgba(15, 60, 39, 0.24) !important;
  }

  .sidebar.open {
    transform: translateX(0) !important;
  }

  .main-content {
    width: 100% !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    padding: 72px 12px 18px !important;
  }

  .header-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    padding: 14px !important;
    border-radius: 18px !important;
  }

  .header-context {
    width: 100%;
  }

  .header-context strong {
    font-size: 16px;
    line-height: 1.3;
  }

  .header-actions {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    justify-content: flex-start !important;
  }

  .header-actions > div,
  .header-actions > button {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .section-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .section-header h2 {
    font-size: 22px;
  }

  .grid-2,
  .grid-3,
  .grid-4,
  .dash-grid,
  .dash-cards,
  .form-grid {
    grid-template-columns: 1fr !important;
  }

  .card,
  .table-card {
    padding: 16px;
    border-radius: 18px;
  }

  .pontos-header {
    flex-direction: column;
    align-items: stretch;
  }

  .pontos-header-acoes,
  .pontos-header-texto {
    width: 100%;
  }

  .pontos-header-filtros {
    grid-template-columns: 1fr !important;
  }

  .pontos-header-botoes {
    flex-direction: column !important;
  }

  .pontos-header-botoes .btn {
    width: 100% !important;
    min-width: 0 !important;
  }

  .vistoria-layout {
    grid-template-columns: 1fr !important;
  }

  .vistoria-summary {
    position: static !important;
  }

  .check-item {
    grid-template-columns: 1fr !important;
  }

  .vistoria-foto-box {
    grid-template-columns: 1fr !important;
  }

  .drawer {
    width: 100%;
  }

  .drawer.open {
    right: 0 !important;
  }

  .map-container {
    height: calc(100dvh - 106px);
    min-height: 620px;
  }

  #mapa .map-card {
    padding: 6px;
  }

  .map-header-actions {
    width: 100%;
    justify-content: stretch;
  }

  .map-header-actions select,
  .map-location-btn {
    width: 100%;
  }

  .tabs-equipes {
    flex-direction: column;
  }

  .tabs-equipes .btn {
    width: 100%;
  }

  input,
  select,
  textarea,
  .btn,
  button {
    font-size: 16px;
  }

  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 640px) {
  .main-content {
    padding: 70px 10px 16px !important;
  }

  .card {
    padding: 14px;
  }

  .header-bar {
    padding: 12px !important;
  }

  .section-header h2 {
    font-size: 20px;
  }

  .map-container {
    height: calc(100dvh - 92px);
    min-height: 600px;
  }
}

/* =========================
   PONTOS - RESPONSIVO
========================= */

.pontos-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  flex-wrap: wrap;
}

.pontos-header-texto {
  min-width: 240px;
  flex: 1 1 320px;
}

.pontos-header-acoes {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(100%, 720px);
}

.pontos-header-filtros,
.pontos-header-botoes {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pontos-search,
.pontos-filter {
  min-width: 220px;
  flex: 1 1 220px;
}

.pontos-table-card {
  padding: 18px;
}

.pontos-table-wrap {
  border-radius: 16px;
}

.pontos-table {
  min-width: 1180px;
  table-layout: fixed;
}

.pontos-table th,
.pontos-table td {
  vertical-align: middle;
}

.pontos-table th:nth-child(1) { width: 150px; }
.pontos-table th:nth-child(2) { width: 260px; }
.pontos-table th:nth-child(3) { width: 140px; }
.pontos-table th:nth-child(4) { width: 130px; }
.pontos-table th:nth-child(6) { width: 76px; }
.pontos-table th:nth-child(7) { width: 118px; }
.pontos-table th:nth-child(8) { width: 170px; }

.pontos-table th:nth-child(6),
.pontos-table td:nth-child(6),
.pontos-table th:nth-child(7),
.pontos-table td:nth-child(7) {
  text-align: center;
}

.pontos-table th:nth-child(8),
.pontos-table td:nth-child(8) {
  text-align: right;
}

.pontos-table-actions {
  white-space: nowrap;
}

.pontos-table-actions__group {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
}

.pontos-table-actions__group .btn {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 12px;
  box-shadow: none;
}

.pontos-cards-wrap {
  display: none;
  margin-top: 16px;
}

.pontos-cards-grid {
  display: grid;
  gap: 14px;
}

.ponto-card-mobile {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.ponto-card-mobile__top {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.ponto-card-mobile__title-wrap {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.ponto-card-mobile__title {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  color: var(--brand-primary-deep);
  word-break: break-word;
}

.ponto-card-mobile__predio {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-muted);
  word-break: break-word;
}

.ponto-card-mobile__body {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.ponto-card-mobile__row {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--neutral-bg);
}

.ponto-card-mobile__label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--brand-primary-deep);
}

.ponto-card-mobile__value {
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-color);
  word-break: break-word;
}

.ponto-card-mobile__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pontos-empty-card {
  text-align: center;
}

.pontos-empty-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--brand-primary-deep);
  margin-bottom: 6px;
}

.pontos-empty-text {
  margin: 0;
  color: var(--text-muted);
}

/* =========================
   DRAWER - NOVO VISUAL
========================= */

body.drawer-open {
  overflow: hidden;
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  z-index: 999;
}

.drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(720px, 100%);
  height: 100vh;
  background: #ffffff;
  box-shadow: -20px 0 50px rgba(15, 23, 42, 0.18);
  transform: translateX(100%);
  transition: transform 0.26s ease;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.drawer-header h3 {
  margin: 0;
  font-size: 20px;
  color: var(--brand-primary-deep);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  background:
    radial-gradient(circle at top right, rgba(34, 197, 94, 0.08), transparent 24%),
    linear-gradient(180deg, #f8fbf9 0%, #ffffff 24%);
}

.drawer-stack {
  display: grid;
  gap: 16px;
  padding-bottom: 18px;
}

.drawer-section,
.drawer-hero,
.drawer-photo-preview {
  border-radius: 20px;
  border: 1px solid var(--border-color);
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.drawer-section {
  padding: 16px;
}

.drawer-section-soft {
  background: var(--neutral-bg);
}

.drawer-section__header {
  margin-bottom: 14px;
}

.drawer-section__header h4 {
  margin: 0 0 4px 0;
  color: var(--brand-primary-deep);
  font-size: 18px;
}

.drawer-section__header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
}

.drawer-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.drawer-field {
  display: grid;
  gap: 6px;
}

.drawer-field-full {
  grid-column: 1 / -1;
}

.drawer-field label {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-primary-deep);
}

.drawer-field small {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}

.drawer-field input,
.drawer-field select,
.drawer-field textarea {
  width: 100%;
}

.drawer-field textarea {
  min-height: 120px;
  resize: vertical;
}

.drawer-hero {
  padding: 18px;
  background: linear-gradient(135deg, rgba(18, 94, 55, 0.10), rgba(18, 94, 55, 0.03));
}

.drawer-hero__top {
  display: grid;
  gap: 10px;
}

.drawer-hero__badge {
  display: inline-flex;
}

.drawer-hero h3 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
  color: var(--brand-primary-deep);
}

.drawer-hero p {
  margin: 6px 0 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-muted);
}

.drawer-photo-preview {
  overflow: hidden;
  min-height: 160px;
  background: #f3f5f4;
}

.drawer-photo-preview img {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
}

.drawer-photo-preview__empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  color: var(--text-muted);
  font-weight: 600;
}

.drawer-info-list {
  display: grid;
  gap: 10px;
}

.drawer-info-item {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--neutral-bg);
}

.drawer-info-item strong {
  color: var(--brand-primary-deep);
}

.drawer-info-item span {
  word-break: break-word;
  line-height: 1.5;
}

.drawer-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.drawer-actions-vertical {
  grid-template-columns: 1fr;
}

.drawer-actions-sticky {
  position: sticky;
  bottom: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  padding-top: 6px;
}

@media (min-width: 901px) {
  .drawer.drawer-ficha-ponto {
    width: min(860px, calc(100vw - 96px));
  }

  .drawer.drawer-ficha-ponto .drawer-header {
    padding: 18px 28px;
  }

  .drawer.drawer-ficha-ponto .drawer-body {
    padding: 22px 24px 24px;
  }

  .drawer-ponto-view {
    grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr);
    gap: 16px;
    align-items: stretch;
  }

  .drawer-ponto-view .drawer-hero {
    grid-column: 1 / -1;
    padding: 20px 22px;
  }

  .drawer-ponto-view .drawer-hero__top {
    grid-template-columns: auto 1fr;
    align-items: center;
  }

  .drawer-ponto-view .drawer-photo-preview {
    min-height: 320px;
    height: 100%;
  }

  .drawer-ponto-view .drawer-photo-preview img {
    height: 100%;
    max-height: none;
  }

  .drawer-ponto-view .drawer-photo-preview__empty {
    min-height: 320px;
  }

  .drawer-ponto-view .drawer-section {
    padding: 20px;
  }

  .drawer-ponto-view .drawer-section:not(.drawer-section-soft) {
    height: 100%;
  }

  .drawer-ponto-view .drawer-info-list {
    gap: 8px;
  }

  .drawer-ponto-view .drawer-info-item {
    grid-template-columns: 115px minmax(0, 1fr);
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #f6faf7;
  }

  .drawer-ponto-view .drawer-section-soft,
  .drawer-ponto-view .drawer-actions {
    grid-column: 1 / -1;
  }

  .drawer-ponto-view .drawer-section-soft .drawer-info-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .drawer-ponto-view .drawer-section-soft .drawer-info-item {
    grid-template-columns: 1fr;
  }

  .drawer-ponto-view .drawer-actions-vertical {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* =========================
   MOBILE
========================= */

@media (max-width: 900px) {
  .pontos-header {
    align-items: stretch;
  }

  .pontos-header-acoes {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .pontos-header-filtros,
  .pontos-header-botoes {
    flex-direction: column;
  }

  .pontos-search,
  .pontos-filter,
  .pontos-header-botoes .btn,
  .pontos-header-botoes button {
    width: 100%;
    min-width: 0;
    flex: 0 0 auto;
    min-height: 48px;
  }

  #pontos .card table {
    display: none;
  }

  .pontos-cards-wrap {
    display: block;
  }

  .ponto-card-mobile__actions {
    grid-template-columns: 1fr;
  }

  .drawer {
    width: 100%;
  }

  .drawer-header {
    padding: 14px 14px 12px;
  }

  .drawer-header h3 {
    font-size: 18px;
  }

  .drawer-body {
    padding: 12px;
  }

  .drawer-section,
  .drawer-hero {
    padding: 14px;
    border-radius: 18px;
  }

  .drawer-form-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .drawer-info-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .drawer-actions {
    grid-template-columns: 1fr;
  }

  .drawer-actions .btn {
    width: 100%;
    min-height: 48px;
  }
}

@media (max-width: 480px) {
  .ponto-card-mobile {
    padding: 14px;
    border-radius: 18px;
  }

  .ponto-card-mobile__title {
    font-size: 16px;
  }

  .drawer-hero h3 {
    font-size: 20px;
  }
}

/* =========================
   EDUCACAO AMBIENTAL
========================= */

.educacao-table {
  min-width: 1500px;
}

.educacao-header-acoes {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}

.educacao-centro-filter {
  width: min(260px, 100%);
}

.educacao-modal {
  width: min(980px, calc(100vw - 32px));
}

.educacao-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.educacao-field-full {
  grid-column: 1 / -1;
}

.educacao-texto-coluna {
  min-width: 220px;
  white-space: pre-wrap;
  line-height: 1.5;
}

@media (max-width: 768px) {
  .educacao-header-acoes {
    width: 100%;
    justify-content: stretch;
  }

  .educacao-centro-filter,
  .educacao-header-acoes .btn {
    width: 100%;
  }

  .educacao-form-grid {
    grid-template-columns: 1fr;
  }

  .educacao-field-full {
    grid-column: auto;
  }
}
/* ==========================================================================
   LEAFLET & OPENSTREETMAP CUSTOMIZATION
   ========================================================================== */

.leaflet-container {
  width: 100%;
  height: 100%;
  border-radius: 22px;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  z-index: 1;
}

.leaflet-popup-content-wrapper {
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(15, 60, 39, 0.15);
  padding: 0;
}

.leaflet-popup-content {
  margin: 12px 14px;
}

.marker-wrapper {
  background: transparent;
  border: none;
}

.custom-marker {
  width: 100%;
  height: 100%;
  border: 2px solid #ffffff;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
  /* A transição agora usa transform com segurança, mantendo a suavidade */
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.custom-marker.is-selected {
  transform: scale(1.4); /* O ícone cresce sem sair do lugar matemático */
  border-color: #0f3d26;
  border-width: 3px;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.35);
}

/* Shapes base */
.marker-circle {
  border-radius: 50%;
}

.marker-square {
  border-radius: 4px;
}

/* Cores por Categoria */
.marker-comcap { background: #000000; }
.marker-reciclaveis { background: #41ec9c; }
.marker-vidro { background: #43a434; border-radius: 4px 4px 12px 12px; }
.marker-eletronicos { background: #410eb7; }
.marker-interna { background: #ef4e64; }
.marker-seletiva { background: #1ee803; }
.marker-nao-segregada { background: #686b71; }
.marker-pilha { background: #fc6609; border-radius: 8px 8px 0 0; }
.marker-papeleira { background: #4252fd; }
.marker-container { background: #22c55e; border-radius: 2px; }
.marker-importado { background: #f59e0b; }
.marker-padrao { background: #64748b; }

/* Edificações */
.marker-edificacao {
  background: rgba(203, 213, 225, 0.85);
  border-color: #ffffff;
  box-shadow: none;
}

/* Localização do Usuário */
.user-location-marker {
  background: #3b82f6;
  border: 3px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* Clusters (Overrides opcionais) */
.marker-cluster-small {
  background-color: rgba(31, 111, 67, 0.6);
}
.marker-cluster-small div {
  background-color: rgba(31, 111, 67, 0.9);
  color: white;
  font-family: Inter, sans-serif;
  font-weight: bold;
}
.marker-cluster-medium {
  background-color: rgba(23, 89, 55, 0.6);
}
.marker-cluster-medium div {
  background-color: rgba(23, 89, 55, 0.9);
  color: white;
  font-family: Inter, sans-serif;
  font-weight: bold;
}
.marker-cluster-large {
  background-color: rgba(16, 60, 39, 0.6);
}
.marker-cluster-large div {
  background-color: rgba(16, 60, 39, 0.9);
  color: white;
  font-family: Inter, sans-serif;
  font-weight: bold;
}
