/* ═══════════════════════════════════════════════════════════════
   Radar de Preços — Admin UI
   ═══════════════════════════════════════════════════════════════ */

/* ── Variáveis ── */
:root {
  --primary:        #3b82f6;
  --primary-dark:   #2563eb;
  --primary-light:  #eff6ff;
  --success:        #22c55e;
  --danger:         #ef4444;
  --warning:        #f59e0b;
  --info:           #06b6d4;

  --bg:             #f0f4f8;
  --surface:        #ffffff;
  --surface-2:      #f8fafc;

  --sidebar-w:      260px;
  --sidebar-w-mini: 68px;
  --sidebar-bg:     #0f172a;
  --sidebar-text:   #94a3b8;
  --sidebar-hover:  rgba(255,255,255,.06);
  --sidebar-active: rgba(59,130,246,.18);

  --text:           #1e293b;
  --text-muted:     #64748b;
  --border:         #e2e8f0;
  --radius:         10px;
  --radius-lg:      14px;
  --shadow-sm:      0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow:         0 4px 16px rgba(0,0,0,.08);
  --shadow-lg:      0 8px 32px rgba(0,0,0,.12);

  --transition:     .2s ease;
}

/* ── Tema Escuro ── */
body.dark {
  --bg:        #0b1120;
  --surface:   #131f35;
  --surface-2: #1a2944;
  --text:      #e2e8f0;
  --text-muted:#64748b;
  --border:    #1e3050;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
  --shadow:    0 4px 16px rgba(0,0,0,.4);
}
body.dark .topbar           { background: #131f35; border-color: #1e3050; }
body.dark tbody tr:hover    { background: rgba(255,255,255,.03); }
body.dark .btn-ghost        { border-color: #1e3050; color: var(--text-muted); }
body.dark .btn-ghost:hover  { background: rgba(255,255,255,.06); }
body.dark .badge-gray,
body.dark .badge-secondary  { background: #1e3050; color: #64748b; }
body.dark .log-meta         { background: #0b1120; }
body.dark .form-control     { background: #1a2944; border-color: #1e3050; color: var(--text); }
body.dark .form-control:focus { border-color: var(--primary); background: #1e3050; }
body.dark .modal            { background: #131f35; }
body.dark .toast            { background: #131f35; border-color: #1e3050; }
body.dark .stat-card        { background: #131f35; border-color: #1e3050; }
body.dark .mfa-digits input { background: #0b1120; color: #e2e8f0; border-color: #1e3050; }
body.dark select.form-control option { background: #131f35; }

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ═══════════════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════════════ */
.layout { display: flex; min-height: 100vh; }

/* ── Overlay mobile ── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 99;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

/* ══════════════════════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-x: hidden;
  overflow-y: auto;
  transition: width var(--transition), transform var(--transition);
  scrollbar-width: thin;
  scrollbar-color: #1e293b transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 4px; }

/* ── Logo ── */
.sidebar-logo {
  padding: 1.25rem 1rem 1.25rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
  font-size: .975rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: .625rem;
  white-space: nowrap;
  overflow: hidden;
  flex-shrink: 0;
  letter-spacing: -.01em;
}
.sidebar-logo .logo-icon { font-size: 1.3rem; flex-shrink: 0; }
.sidebar-logo .logo-text { transition: opacity var(--transition), width var(--transition); }

/* ── Nav ── */
.sidebar-nav { padding: .75rem 0; flex: 1; }

.nav-section {
  padding: 1rem 1.25rem .3rem;
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #334155;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--transition);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem 1rem .6rem 1.25rem;
  min-height: 44px;
  color: var(--sidebar-text);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  border-left: 3px solid transparent;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1px .5rem 1px 0;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  text-decoration: none;
  font-size: .85rem;
  white-space: nowrap;
  overflow: hidden;
  position: relative;
}
.nav-item .icon {
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  font-size: 1rem;
  opacity: .8;
  transition: opacity var(--transition);
}
.nav-item .label { transition: opacity var(--transition), width var(--transition); overflow: hidden; }
.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item:hover .icon { opacity: 1; }
.nav-item.active {
  background: var(--sidebar-active);
  color: #93c5fd;
  border-left-color: var(--primary);
  font-weight: 600;
}
.nav-item.active .icon { opacity: 1; }

/* ── Footer ── */
.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,.06);
  font-size: .8rem;
  color: #334155;
  display: flex;
  align-items: center;
  gap: .6rem;
  white-space: nowrap;
  overflow: hidden;
  flex-shrink: 0;
}
.sidebar-footer .footer-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: .75rem; font-weight: 700; flex-shrink: 0;
}
.sidebar-footer .footer-name { transition: opacity var(--transition); overflow: hidden; }

/* ── Sidebar colapsada ── */
.sidebar.collapsed {
  width: var(--sidebar-w-mini);
}
.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-section,
.sidebar.collapsed .nav-item .label,
.sidebar.collapsed .footer-name {
  opacity: 0;
  pointer-events: none;
  width: 0;
}
.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: .65rem 0;
  margin-right: 0;
  border-radius: 0;
  border-left-color: transparent;
}
.sidebar.collapsed .nav-item.active {
  border-left-color: var(--primary);
}
.sidebar.collapsed .nav-item .icon {
  width: 100%;
  margin: 0;
  font-size: 1.1rem;
}
.sidebar.collapsed .sidebar-footer { justify-content: center; padding: 1rem 0; }
.sidebar.collapsed .sidebar-logo   { justify-content: center; padding: 1.25rem 0; }

/* Tooltip ao colapsar */
.sidebar.collapsed .nav-item { position: relative; }
.sidebar.collapsed .nav-item:hover::after {
  content: attr(data-title);
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: #1e293b;
  color: #e2e8f0;
  padding: .35rem .7rem;
  border-radius: 6px;
  font-size: .8rem;
  white-space: nowrap;
  pointer-events: none;
  z-index: 200;
  box-shadow: var(--shadow);
  border: 1px solid #334155;
}

/* ══════════════════════════════════════════════════════════════
   MAIN CONTENT
   ══════════════════════════════════════════════════════════════ */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--transition);
  min-width: 0;
}
.main-content.expanded { margin-left: var(--sidebar-w-mini); }

/* ── Topbar ── */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: .75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.topbar-left { display: flex; align-items: center; gap: .875rem; min-width: 0; }

.sidebar-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition);
  font-size: 1rem;
}
.sidebar-toggle:hover { background: var(--bg); color: var(--text); }

.topbar-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-right { display: flex; align-items: center; gap: .625rem; flex-shrink: 0; }

/* Separador ── */
.topbar-sep {
  width: 1px; height: 22px;
  background: var(--border);
  display: inline-block;
}

/* ── Page content ── */
.page-content { padding: 1.5rem; flex: 1; max-width: 100%; }

/* ══════════════════════════════════════════════════════════════
   CARDS
   ══════════════════════════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: .875rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: .5rem;
}
.card-title { font-size: .975rem; font-weight: 600; }

/* ── Stat cards ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.stat-icon { font-size: 1.6rem; margin-bottom: .25rem; }
.stat-value { font-size: 1.85rem; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: .78rem; color: var(--text-muted); font-weight: 500; }
.stat-card.primary .stat-value { color: var(--primary); }
.stat-card.success .stat-value { color: var(--success); }
.stat-card.warning .stat-value { color: var(--warning); }
.stat-card.danger  .stat-value { color: var(--danger); }

/* ══════════════════════════════════════════════════════════════
   TABLE
   ══════════════════════════════════════════════════════════════ */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .85rem; }
table  { width: 100%; border-collapse: collapse; font-size: .85rem; }

thead th {
  text-align: left;
  padding: .625rem .875rem;
  border-bottom: 2px solid var(--border);
  color: var(--text-muted);
  font-weight: 600;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
  background: var(--surface-2);
}
thead th:first-child { border-radius: var(--radius) 0 0 0; }
thead th:last-child  { border-radius: 0 var(--radius) 0 0; }
tbody td {
  padding: .7rem .875rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }

/* ══════════════════════════════════════════════════════════════
   BADGES
   ══════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .2rem .6rem;
  border-radius: 20px;
  font-size: .73rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-success   { background: #dcfce7; color: #15803d; }
.badge-danger    { background: #fee2e2; color: #b91c1c; }
.badge-warning   { background: #fef9c3; color: #92400e; }
.badge-info      { background: #e0f2fe; color: #0369a1; }
.badge-gray      { background: #f1f5f9; color: #475569; }
.badge-secondary { background: #f1f5f9; color: #475569; }

/* ── Log badges ── */
.log-badge { display:inline-flex; align-items:center; padding:.15rem .5rem; border-radius:5px; font-size:.68rem; font-weight:700; letter-spacing:.05em; }
.log-info  { background:#e0f2fe; color:#0369a1; }
.log-warn  { background:#fef9c3; color:#92400e; }
.log-error { background:#fee2e2; color:#b91c1c; }
.log-debug { background:#f1f5f9; color:#64748b; }
.log-meta  { font-size:.75rem; color:var(--text-muted); background:var(--bg); border-radius:6px; padding:.4rem .6rem; margin:.35rem 0 0; white-space:pre-wrap; word-break:break-all; max-height:120px; overflow-y:auto; border:1px solid var(--border); }

/* ══════════════════════════════════════════════════════════════
   FORMS
   ══════════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 1.1rem; }
.form-group label {
  display: block;
  margin-bottom: .4rem;
  font-weight: 500;
  font-size: .83rem;
  color: var(--text);
}
.form-control {
  width: 100%;
  padding: .55rem .875rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: .875rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
  font-family: inherit;
  line-height: 1.5;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
.form-control::placeholder { color: #94a3b8; }
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .75rem center; padding-right: 2.25rem; }
.form-hint { font-size: .775rem; color: var(--text-muted); margin-top: .3rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.form-actions { display: flex; gap: .75rem; margin-top: 1.25rem; flex-wrap: wrap; }
.error-msg { color:var(--danger); font-size:.85rem; margin-top:.5rem; display:none; }

/* ══════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1.1rem;
  border-radius: var(--radius);
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  border: none;
  transition: background var(--transition), box-shadow var(--transition), transform .1s;
  text-decoration: none;
  white-space: nowrap;
  font-family: inherit;
  line-height: 1.4;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 1px 3px rgba(59,130,246,.4); }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 3px 8px rgba(59,130,246,.4); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(.92); }
.btn-danger  { background: var(--danger); color: #fff; }
.btn-danger:hover  { filter: brightness(.92); }
.btn-warning { background: var(--warning); color: #fff; }
.btn-ghost   { background: transparent; color: var(--text-muted); border: 1.5px solid var(--border); }
.btn-ghost:hover { background: var(--bg); color: var(--text); border-color: #cbd5e1; }
.btn-sm { padding: .3rem .7rem; font-size: .78rem; border-radius: 7px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ══════════════════════════════════════════════════════════════
   PAGINATION
   ══════════════════════════════════════════════════════════════ */
.pagination { display: flex; align-items: center; gap: .4rem; margin-top: 1rem; justify-content: center; flex-wrap: wrap; }
.pagination button { min-width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius); }
.pagination .page-info { color: var(--text-muted); font-size: .83rem; padding: 0 .5rem; }

/* ══════════════════════════════════════════════════════════════
   SEARCH BAR
   ══════════════════════════════════════════════════════════════ */
.search-bar { display: flex; gap: .75rem; margin-bottom: 1rem; flex-wrap: wrap; align-items: center; }
.search-bar .form-control { max-width: 280px; }

/* ══════════════════════════════════════════════════════════════
   TOAST
   ══════════════════════════════════════════════════════════════ */
#toast-container { position: fixed; top: 1rem; right: 1rem; z-index: 9999; display: flex; flex-direction: column; gap: .5rem; pointer-events: none; }
.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: .875rem 1.1rem;
  box-shadow: var(--shadow-lg);
  font-size: .85rem;
  min-width: 260px;
  max-width: 340px;
  animation: toastIn .25s cubic-bezier(.22,1,.36,1);
  pointer-events: all;
  display: flex;
  align-items: flex-start;
  gap: .625rem;
}
.toast.success { border-left: 4px solid var(--success); }
.toast.error   { border-left: 4px solid var(--danger); }
.toast.info    { border-left: 4px solid var(--info); }
@keyframes toastIn {
  from { transform: translateX(110%) scale(.95); opacity: 0; }
  to   { transform: translateX(0)    scale(1);   opacity: 1; }
}

/* ══════════════════════════════════════════════════════════════
   MODAL
   ══════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(3px);
  animation: fadeIn .15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn .2s cubic-bezier(.22,1,.36,1);
  border: 1px solid var(--border);
}
@keyframes modalIn {
  from { transform: translateY(20px) scale(.97); opacity: 0; }
  to   { transform: translateY(0)    scale(1);   opacity: 1; }
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.modal-title  { font-size: 1.05rem; font-weight: 600; }
.modal-close  { background: none; border: none; cursor: pointer; font-size: 1.25rem; color: var(--text-muted); line-height: 1; padding: .25rem; border-radius: 6px; transition: background var(--transition); }
.modal-close:hover { background: var(--bg); }

/* ══════════════════════════════════════════════════════════════
   MISC
   ══════════════════════════════════════════════════════════════ */
.section        { display: none; }
.section.active { display: block; }
.empty-state    { text-align: center; padding: 3rem 1rem; color: var(--text-muted); font-size: .9rem; }
.loading        { text-align: center; padding: 2rem; color: var(--text-muted); }
.text-muted     { color: var(--text-muted); }
.text-right     { text-align: right; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.align-center { align-items: center; }
.gap-1 { gap: .5rem; }
.chart-wrapper { position: relative; height: 260px; }

/* ══════════════════════════════════════════════════════════════
   MAPA
   ══════════════════════════════════════════════════════════════ */
#map { width: 100%; height: 520px; border-radius: 0 0 var(--radius-lg) var(--radius-lg); z-index: 1; }

/* Remove linhas brancas entre tiles do Leaflet */
.leaflet-tile-pane {
  will-change: transform;
}
.leaflet-tile {
  transform: translate3d(0, 0, 0);
  image-rendering: auto;
}
.leaflet-tile-container img {
  width: 256.5px !important;
  height: 256.5px !important;
}

.map-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  z-index: 1000 !important;
  border-radius: 0 !important;
  margin: 0 !important;
}
.map-fullscreen #map { height: calc(100vh - 57px) !important; border-radius: 0 !important; }

.marker-pin {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,.9);
  box-shadow: 0 2px 6px rgba(0,0,0,.35);
  position: relative;
}
.marker-pin.fresh   { background: #16a34a; }
.marker-pin.warning { background: #d97706; }
.marker-pin.stale   { background: #dc2626; }
.marker-pin.no_data { background: #94a3b8; }

.marker-pin.fresh::after {
  content: '';
  position: absolute; inset: -5px;
  border-radius: 50%;
  background: rgba(22,163,74,.35);
  animation: pulse-green 1.6s ease-out infinite;
}
@keyframes pulse-green {
  0%   { transform: scale(1);   opacity: .7; }
  70%  { transform: scale(2.3); opacity: 0;  }
  100% { transform: scale(1);   opacity: 0;  }
}
.marker-pin.warning::after {
  content: '';
  position: absolute; inset: -5px;
  border-radius: 50%;
  background: rgba(217,119,6,.3);
  animation: pulse-yellow 2.2s ease-out infinite;
}
@keyframes pulse-yellow {
  0%   { transform: scale(1);   opacity: .6; }
  70%  { transform: scale(2.1); opacity: 0;  }
  100% { transform: scale(1);   opacity: 0;  }
}

.map-legend {
  display: flex; gap: 1.25rem; flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: .75rem 1rem;
  margin-bottom: 1rem;
  font-size: .83rem;
  align-items: center;
  box-shadow: var(--shadow-sm);
}
.legend-item { display: flex; align-items: center; gap: .4rem; }
.legend-dot {
  width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.legend-dot.fresh   { background: #16a34a; }
.legend-dot.warning { background: #d97706; }
.legend-dot.stale   { background: #dc2626; }
.legend-dot.no_data { background: #94a3b8; }

.map-stats {
  display: flex; gap: .875rem; flex-wrap: wrap; margin-bottom: 1rem;
}
.map-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .45rem .875rem;
  font-size: .83rem;
  display: flex; align-items: center; gap: .4rem;
  box-shadow: var(--shadow-sm);
}
.map-stat strong { font-size: 1rem; }

/* ══════════════════════════════════════════════════════════════
   RESPONSIVO
   ══════════════════════════════════════════════════════════════ */

/* Tablet */
@media (max-width: 1024px) {
  :root { --sidebar-w: 220px; }
  .stats-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

/* Mobile */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-w) !important;
    box-shadow: var(--shadow-lg);
    z-index: 200;
  }
  .sidebar-overlay { z-index: 199; }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  /* No mobile, nunca recolhe para ícone — sempre full ou fechado */
  .sidebar.collapsed { width: var(--sidebar-w) !important; }
  .sidebar.collapsed .logo-text,
  .sidebar.collapsed .nav-section,
  .sidebar.collapsed .nav-item .label,
  .sidebar.collapsed .footer-name { opacity: 1; pointer-events: auto; width: auto; }
  .sidebar.collapsed .nav-item {
    justify-content: flex-start;
    padding: .6rem 1rem .6rem 1.25rem;
    margin-right: .5rem;
    border-radius: 0 var(--radius) var(--radius) 0;
  }
  .sidebar.collapsed .nav-item .icon { width: 20px; font-size: 1rem; }
  .sidebar.collapsed .sidebar-footer  { justify-content: flex-start; padding: 1rem 1.25rem; }
  .sidebar.collapsed .sidebar-logo    { justify-content: flex-start; padding: 1.25rem 1rem 1.25rem 1.25rem; }

  .main-content { margin-left: 0 !important; }

  .topbar { padding: .625rem 1rem; }
  .topbar-title { font-size: .9rem; }

  .page-content { padding: 1rem; }

  .stats-grid { grid-template-columns: 1fr 1fr; gap: .75rem; }
  .stat-value { font-size: 1.5rem; }

  .card { padding: 1rem; border-radius: var(--radius); }
  .modal { padding: 1.25rem; border-radius: var(--radius-lg) var(--radius-lg) 0 0; align-self: flex-end; max-height: 85vh; }
  .modal-overlay { align-items: flex-end; padding: 0; }

  #map { height: 380px; }
  .map-stats { gap: .5rem; }
  .map-stat  { padding: .375rem .75rem; font-size: .78rem; }

  .search-bar .form-control { max-width: 100%; }
  .form-grid { grid-template-columns: 1fr; }

  #toast-container { top: auto; bottom: 1rem; right: .75rem; left: .75rem; }
  .toast { min-width: unset; max-width: 100%; }

  .topbar-sep { display: none; }
}

@media (max-width: 420px) {
  .stats-grid { grid-template-columns: 1fr; }
  .btn-sm { font-size: .75rem; padding: .28rem .6rem; }
}
