/* ============================================
   Design System - App Xico Gomes v3
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700&display=swap');

:root {
  --bg-body: #f4f7fa;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-nav: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-sidebar-hover: #f1f5f9;
  --bg-input: #f8fafc;
  --bg-modal: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --text-sidebar: #64748b;
  --text-sidebar-active: #2563eb;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-light: rgba(37,99,235,0.1);
  --success: #10b981;
  --success-light: rgba(16,185,129,0.1);
  --warning: #f59e0b;
  --warning-light: rgba(245,158,11,0.1);
  --danger: #ef4444;
  --danger-light: rgba(239,68,68,0.1);
  --info: #06b6d4;
  --info-light: rgba(6,182,212,0.1);
  --border: #e2e8f0;
  --border-sidebar: #1e293b;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  
  --sidebar-width: 240px;
  --topbar-height: 60px;
}

[data-theme="dark"] {
  --bg-body: #0b1120;
  --bg-card: rgba(30,41,59,0.7);
  --bg-card-hover: rgba(30,41,59,0.9);
  --bg-nav: rgba(15,23,42,0.95);
  --bg-sidebar: #0f172a;
  --bg-input: #1e293b;
  --bg-modal: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-light: rgba(59,130,246,0.15);
  --border: #334155;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.5);
}

* { margin:0; padding:0; box-sizing:border-box; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.5;
  font-size: 0.875rem;
  min-height: 100vh;
  transition: background-color 0.3s, color 0.3s;
  overflow-x: hidden;
}

[data-theme="dark"] body {
  background: linear-gradient(135deg, #0b1120 0%, #0f172a 50%, #131c31 100%);
}

h1,h2,h3,h4,h5,h6 { font-family:'Outfit',sans-serif; font-weight:600; }

/* --- Layout Structure --- */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  color: var(--text-sidebar);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 1050;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 15px rgba(0,0,0,0.1);
}

.sidebar-header {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}
.sidebar-brand i { color: var(--accent); font-size: 1.5rem; }

.sidebar-menu {
  flex: 1;
  padding: 1.5rem 0;
  overflow-y: auto;
}

.menu-label {
  padding: 0 1.5rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  color: var(--text-sidebar);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  border-left: 3px solid transparent;
  cursor: pointer;
}

.menu-item:hover {
  background: var(--bg-sidebar-hover);
  color: var(--text-primary);
}

.menu-item.active {
  background: transparent;
  color: var(--text-sidebar-active);
  border-left-color: var(--accent);
}

.menu-item i {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name-label {
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.user-role-label {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* --- Main Content Area --- */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: var(--transition);
}

/* --- Topbar --- */
.topbar {
  height: var(--topbar-height);
  background: var(--bg-nav);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(12px);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.5rem;
}

.topbar-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* --- Theme Toggle --- */
.theme-toggle {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 50px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--text-secondary);
  transition: var(--transition);
}
.theme-toggle:hover {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent);
}

/* --- Content Views (Tabs) --- */
.content-area {
  padding: 1.5rem;
  flex: 1;
}

.view-section {
  display: none;
  animation: fadeIn 0.4s ease;
}

.view-section.active {
  display: block;
}

/* --- Stat Cards --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.stat-card .stat-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}
.stat-card .stat-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem;
}
.stat-card .stat-icon.blue { background: var(--accent-light); color: var(--accent); }
.stat-card .stat-icon.green { background: var(--success-light); color: var(--success); }
.stat-card .stat-icon.amber { background: var(--warning-light); color: var(--warning); }
.stat-card .stat-icon.red { background: var(--danger-light); color: var(--danger); }
.stat-card .stat-label {
  font-size: 0.85rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  font-weight: 600;
}
.stat-card .stat-value {
  font-family: 'Outfit',sans-serif;
  font-size: 1.75rem; font-weight: 700;
  line-height: 1;
}
.stat-card .stat-meta {
  font-size: 0.8rem; color: var(--text-secondary); margin-top: 0.5rem;
}
.progress-bar-custom {
  height: 6px; background: var(--bg-input); border-radius: 3px;
  margin-top: 1rem; overflow: hidden;
}
.progress-bar-custom .fill {
  height: 100%; border-radius: 3px;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Section Card --- */
.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.section-card .section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.section-card .section-title {
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.section-card .section-title i { color: var(--accent); }

/* --- Charts --- */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.chart-container { position: relative; height: 300px; width: 100%; }

/* --- Data Table --- */
.table-container {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}

.table-toolbar {
  padding: 1rem 0;
  border-bottom: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  background: transparent;
}

.table-wrapper { 
  overflow-x: auto; 
  width: 100%;
  min-height: 280px;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0.5rem;
  font-size: 0.9rem;
}
.data-table thead th {
  background: transparent;
  color: #94a3b8;
  font-weight: 600;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.5rem 1.5rem;
  border-bottom: none;
  text-align: left;
  white-space: nowrap;
}
[data-theme="dark"] .data-table thead th {
  background: transparent;
  border-bottom: none;
  color: #94a3b8;
}
.data-table tbody tr {
  background: var(--bg-card);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  border-radius: 8px;
  transition: var(--transition);
}
.data-table tbody tr:hover { 
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(0,0,0,0.06); 
}
.data-table tbody td {
  padding: 1rem 1.5rem;
  vertical-align: middle;
  color: #475569;
  font-size: 0.85rem;
  border: none;
}
.data-table tbody td.cell-name {
  white-space: normal;
  min-width: 200px;
}
.data-table tbody td:first-child { border-top-left-radius: 8px; border-bottom-left-radius: 8px; }
.data-table tbody td:last-child { border-top-right-radius: 8px; border-bottom-right-radius: 8px; }
[data-theme="dark"] .data-table tbody td {
  color: #cbd5e1;
}
[data-theme="dark"] .data-table tbody td {
  color: #cbd5e1;
}
.data-table .user-name-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.data-table .user-name-text {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9rem;
  word-break: break-word;
}
.badge-team {
  background: #e0e7ff;
  color: #4f46e5;
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}
.badge-team:hover {
  background: #4f46e5;
  color: #fff;
  transform: scale(1.05);
}
.badge-team-static {
  background: var(--bg-input);
  color: var(--text-muted);
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
  flex-shrink: 0;
}
[data-theme="dark"] .badge-team {
  background: rgba(79, 70, 229, 0.2);
  color: #818cf8;
}
[data-theme="dark"] .badge-team:hover {
  background: #4f46e5;
  color: #fff;
}

/* Combined contact cell */
.cell-contact {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  text-decoration: none;
  white-space: nowrap;
}
.contact-link.whatsapp {
  color: #25d366;
  font-weight: 600;
}
.contact-link.whatsapp:hover { color: #128c7e; }
.contact-link.instagram {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* --- Dropdown Actions (The Three Dots) --- */
.dropdown-action {
  position: relative;
  display: inline-block;
}

.btn-dots {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-dots:hover, .btn-dots:focus {
  background: var(--bg-input);
  color: var(--text-primary);
}

/* Ensure bootstrap dropdown menu looks good */
.dropdown-menu-custom {
  background: var(--bg-modal);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  min-width: 160px;
}

.dropdown-item-custom {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 6px;
  transition: var(--transition);
  text-decoration: none;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
}

.dropdown-item-custom:hover {
  background: var(--bg-input);
  color: var(--accent);
}

.dropdown-item-custom.text-danger:hover {
  color: var(--danger);
  background: var(--danger-light);
}

.dropdown-item-custom i {
  width: 16px;
  text-align: center;
  color: var(--text-secondary);
}
.dropdown-item-custom:hover i { color: inherit; }

/* --- Sublevel (no longer nested — kept for internal table styling only) --- */
.subnivel-container .data-table {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.subnivel-container .data-table thead th {
  background: var(--bg-card);
}

/* --- Buttons --- */
.btn-primary-custom {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  border: none;
  color: #fff;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}
.btn-primary-custom:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(37,99,235,0.3);
  color: #fff;
}
.btn-secondary-custom {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}
.btn-secondary-custom:hover {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent);
}

.badge-whatsapp {
  background: #25d366;
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}
.badge-whatsapp:hover {
  background: #128c7e;
  color: white;
  transform: scale(1.05);
}

/* --- Search Box --- */
.search-box {
  position: relative;
  width: 100%;
  max-width: 400px;
}
.search-box input {
  width: 100%;
  padding: 0.5rem 1rem 0.5rem 2.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.85rem;
  transition: var(--transition);
}
.search-box input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
  background: var(--bg-card);
}
.search-box i {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* --- Modals --- */
.modal-content {
  background: var(--bg-modal) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-lg) !important;
}
.modal-header {
  border-bottom: 1px solid var(--border) !important;
  padding: 1.25rem 1.5rem !important;
}
.modal-header .modal-title {
  font-family: 'Outfit',sans-serif;
  font-weight: 600;
  color: var(--text-primary);
}
.modal-body { padding: 1.5rem !important; }
.modal-footer { border-top: 1px solid var(--border) !important; }
.modal .form-label {
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}
.modal .form-control {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 0.6rem 0.85rem;
  font-size: 0.9rem;
  transition: var(--transition);
}
.modal .form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
  background: var(--bg-card);
}
.modal .btn-close { filter: var(--text-primary); }
[data-theme="dark"] .modal .btn-close { filter: invert(1); }

/* --- Ranking --- */
.ranking-list { list-style: none; padding: 0; }
.ranking-item {
  display: flex;
  align-items: center;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}
.ranking-item:last-child { border-bottom: none; }
.ranking-position {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}
.ranking-position.gold { background: #fef3c7; color: #92400e; box-shadow: 0 2px 5px rgba(245, 158, 11, 0.2); }
.ranking-position.silver { background: #f1f5f9; color: #475569; }
.ranking-position.bronze { background: #fed7aa; color: #9a3412; }
.ranking-position.default { background: var(--bg-input); color: var(--text-muted); }
.ranking-name { flex: 1; font-weight: 600; font-size: 0.9rem; }
.ranking-count {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent);
  background: var(--accent-light);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
}

/* --- Alerts --- */
.alert-custom {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  animation: slideDown 0.3s ease;
}
.alert-custom.success {
  background: var(--success-light);
  color: #065f46;
  border: 1px solid rgba(16,185,129,0.3);
}
.alert-custom.error {
  background: var(--danger-light);
  color: #991b1b;
  border: 1px solid rgba(239,68,68,0.3);
}
[data-theme="dark"] .alert-custom.success { color: #6ee7b7; }
[data-theme="dark"] .alert-custom.error { color: #fca5a5; }

/* --- Login Page --- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 50%, #1a1a2e 100%);
  padding: 1rem;
}

.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: fadeIn 0.5s ease;
}

.login-card.shake {
  animation: shake 0.4s ease;
}

.login-title {
  text-align: center;
  margin-bottom: 2rem;
}
.login-title h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: #0f172a;
  margin-top: 0.5rem;
}
.login-title p {
  color: #64748b;
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.form-group {
  margin-bottom: 1.25rem;
}
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.4rem;
}
.form-group label i {
  margin-right: 0.35rem;
  color: #94a3b8;
}
.form-group input {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.9rem;
  color: #0f172a;
  background: #f8fafc;
  transition: all 0.3s ease;
  font-family: 'Inter', sans-serif;
}
.form-group input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
  background: #fff;
}
.form-group input::placeholder {
  color: #94a3b8;
}

.btn-login {
  width: 100%;
  padding: 0.75rem;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: 'Inter', sans-serif;
  margin-top: 0.5rem;
}
.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(37,99,235,0.35);
}
.btn-login:active {
  transform: translateY(0);
}

/* --- Bairro Chips --- */
.bairro-chip {
  display: inline-flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 0.35rem 0.5rem 0.35rem 0.85rem;
  gap: 0.4rem;
  transition: var(--transition);
}
.bairro-chip:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.bairro-chip-name {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
}
.bairro-chip-name:hover {
  color: var(--accent);
}
.bairro-chip-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.65rem;
  padding: 0.15rem 0.3rem;
  border-radius: 50%;
  transition: var(--transition);
  opacity: 0.4;
  line-height: 1;
}
.bairro-chip:hover .bairro-chip-delete {
  opacity: 1;
}
.bairro-chip-delete:hover {
  color: #fff;
  background: var(--danger);
}

/* --- Animations --- */
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

/* --- Drill-down Breadcrumb --- */
.drilldown-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  flex-wrap: wrap;
}
.breadcrumb-item {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
}
.breadcrumb-item:hover {
  color: var(--accent);
  background: var(--accent-light);
}
.breadcrumb-item.active {
  color: var(--text-primary);
  font-weight: 600;
}
.breadcrumb-sep {
  color: var(--text-muted);
  font-size: 0.6rem;
}

/* --- Toolbar Layout --- */
.toolbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.toolbar-title {
  margin: 0;
  font-family: 'Outfit',sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
}
.toolbar-counter {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* --- Responsive & Mobile --- */

/* Overlay for mobile sidebar */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1040;
  backdrop-filter: blur(2px);
}

@media (max-width: 992px) {
  /* Hide sidebar by default on mobile */
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.show {
    transform: translateX(0);
  }
  
  .sidebar-overlay.show {
    display: block;
  }
  
  .main-wrapper {
    margin-left: 0;
  }
  
  .mobile-toggle {
    display: block; /* Show hamburger menu */
  }
  
  .content-area {
    padding: 1rem;
  }
  
  .charts-grid {
    grid-template-columns: 1fr;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-box {
    max-width: 100%;
  }
  
  .data-table thead th, .data-table tbody td {
    padding: 0.75rem 1rem;
  }
}

/* Print styles */
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .main-wrapper { margin-left: 0; }
  body { background: #fff !important; color: #000 !important; }
}
