﻿:root {
    --bg-dark: #0f111a;
    --bg-panel: #1e2633; /* slightly lighter panel for contrast */
    --bg-hover: #2a3545; /* hover background */
    --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.5);
    --text-primary: #e2e8f0;
    --text-secondary: #cbd5e1; /* lighter secondary for readability */
    --border-color: #2e364f;
    --danger: #ef4444;
    --success: #10b981;
    --modal-bg: var(--bg-panel);
    --modal-text: var(--text-primary);
}

[data-theme="light"] {
    --bg-dark: #f1f5f9;
    --bg-panel: #ffffff;
    --bg-hover: #e2e8f0;
    --accent: #2563eb;
    --accent-glow: rgba(37, 99, 235, 0.2);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --border-color: #cbd5e1;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    overflow: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Header Start */
.app-header {
    background-color: var(--bg-panel);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    z-index: 1000;
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
    flex: 0 1 420px;
    min-width: 0;
    max-width: 420px;
}
.search-container { z-index: 5; }

.search-icon {
    position: absolute;
    left: 14px;
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
    pointer-events: none;
    opacity: 0.8;
}

#search-input {
    width: 100%;
    padding-left: 42px;
    padding-right: 42px;
}

.search-clear-btn {
    position: absolute;
    right: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    border-bottom: 1px solid rgba(200,200,220,0.05);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: flex-end;
    flex-wrap: nowrap;
    min-width: 0;
    margin-left: auto;
}

.mobile-only {
    display: none !important;
}

.header-metrics-bar {
    display: flex;
    align-items: stretch;
    gap: 12px;
    flex-wrap: wrap;
}

.metric-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 148px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.82), rgba(15, 23, 42, 0.68));
    box-shadow: 0 14px 34px rgba(2, 6, 23, 0.18);
}

.metric-chip-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    flex: 0 0 auto;
}

.metric-chip-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.metric-label {
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    line-height: 1.1;
}

.metric-value {
    color: var(--accent);
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
}

.header-search {
    max-width: 400px;
}

.header-filters {
    display: flex;
    align-items: center;
    justify-content: space-between;
    align-items: stretch;
    padding: 12px 20px;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.94), rgba(17, 24, 39, 0.88)),
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.16), transparent 45%);
    gap: 12px;
    flex-wrap: wrap;
    border-top: 1px solid rgba(148, 163, 184, 0.08);
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.filter-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.86), rgba(15, 23, 42, 0.68));
    box-shadow: 0 18px 45px rgba(2, 6, 23, 0.2);
    backdrop-filter: blur(10px);
}

.filter-panel--criteria {
    min-width: 0;
    flex: 1;
}

.filter-panel--actions {
    justify-content: center;
    min-width: 320px;
    max-width: 360px;
}

.filter-panel-heading {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.filter-panel-heading strong {
    color: var(--text-primary);
    font-size: 12.5px;
    line-height: 1.25;
    letter-spacing: 0.01em;
    font-weight: 600;
    opacity: 0.86;
}

.filter-panel--actions .filter-panel-heading {
    display: none;
}

.filter-panel-kicker {
    color: #7dd3fc;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.filter-group {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
    gap: 8px;
    width: 100%;
}

.filter-stack {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.filter-label {
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding-left: 2px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
    letter-spacing: 1px;
    white-space: nowrap;
}

.btn-theme {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 36px; height: 36px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-theme:hover {
    color: var(--text-primary);
    border-color: var(--text-primary);
}
/* Header ghost buttons */
.btn-header-ghost {
    display: inline-flex; align-items: center; gap: 6px;
    height: 34px; padding: 0 14px; border-radius: 7px;
    border: 1px solid var(--border-color); background: transparent;
    color: var(--text-secondary); font-family: 'Inter', sans-serif;
    font-size: 12.5px; font-weight: 600; cursor: pointer;
    white-space: nowrap; transition: all 0.18s ease; letter-spacing: 0.3px;
}
.btn-header-ghost:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--accent); }
.btn-header-success { color: var(--success); border-color: rgba(16,185,129,0.35); }
.btn-header-success:hover { background: rgba(16,185,129,0.1); border-color: var(--success); }
.btn-header-gold { color: #f59e0b; border-color: rgba(245,158,11,0.35); }
.btn-header-gold:hover { background: rgba(245,158,11,0.1); border-color: #f59e0b; }
.header-divider { width: 1px; height: 22px; background: var(--border-color); margin: 0 2px; }


.btn-success {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    padding: 0 16px;
    border-radius: 6px;
    border: none;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    background: var(--success);
    color: #fff;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.18);
}

.filter-select, .filter-input-small, #search-input {
    background: rgba(15, 23, 42, 0.82);
    border: 1px solid rgba(148, 163, 184, 0.18);
    color: var(--text-primary);
    height: 42px;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    outline: none;
    transition: all 0.3s ease;
    padding: 0 14px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.filter-field {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrapper {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
}

.field-icon {
    position: absolute;
    left: 12px;
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
    pointer-events: none;
}

.filter-select {
    min-width: 160px;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%2394a3b8" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>');
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-left: 38px;
    padding-right: 38px;
}
.filter-select--state { min-width: 220px; }
.filter-select--ddd   { min-width: 140px; }

/* Light theme input overrides */
[data-theme="light"] .filter-select,
[data-theme="light"] .filter-input-small,
[data-theme="light"] #search-input { background-color: #fff; border-color: #cbd5e1; color: #0f172a; }
[data-theme="light"] .filter-select:focus,
[data-theme="light"] #search-input:focus { border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37,99,235,0.18); }
[data-theme="light"] .header-filters {
    background:
        linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(241, 245, 249, 0.96)),
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.08), transparent 42%);
}
[data-theme="light"] .filter-panel {
    background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,252,0.94));
    border-color: rgba(148, 163, 184, 0.22);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
}
[data-theme="light"] .filter-panel-kicker {
    color: #0369a1;
}
[data-theme="light"] .btn-filter-aux {
    background: #fff7ed;
    border-color: rgba(251, 191, 36, 0.3);
    color: #b45309;
}
[data-theme="light"] .filter-active-badges {
    background: linear-gradient(180deg, rgba(248,250,252,0.96), rgba(241,245,249,0.92));
}
[data-theme="light"] .filter-badge {
    background: rgba(37, 99, 235, 0.08);
    border-color: rgba(37, 99, 235, 0.14);
    color: #1d4ed8;
}


.filter-input-small {
    width: 100px;
    text-align: left;
    padding-left: 38px;
}

#search-input {
    width: 100%;
    padding-left: 38px;
}

.filter-select:focus, .filter-input-small:focus, #search-input:focus {
    border-color: rgba(96, 165, 250, 0.72);
    background: rgba(15, 23, 42, 0.95);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18), inset 0 1px 2px rgba(0,0,0,0.2);
}

.btn-primary, .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 42px;
    background: var(--accent);
    color: var(--text-primary);
    border: none;
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 600;
    padding: 0 18px;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.2s, border-color 0.2s;
}

.btn-primary i[data-lucide], .btn-secondary i[data-lucide] {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.btn-primary span, .btn-secondary span {
    display: flex;
    align-items: center;
}

.btn-primary:hover, .btn-secondary:hover, .btn-success:hover, .btn-theme:hover {
    transform: translateY(-1px);
}

.btn-primary:hover {
    background: #2563eb;
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.22);
}

.filter-help-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid rgba(59, 130, 246, 0.35);
    background: rgba(37, 99, 235, 0.12);
    color: #93c5fd;
    cursor: pointer;
    transition: all 0.18s ease;
    vertical-align: middle;
}

.filter-help-trigger:hover,
.filter-help-trigger.is-open {
    background: rgba(37, 99, 235, 0.2);
    border-color: rgba(96, 165, 250, 0.55);
    color: #dbeafe;
}

.filter-help-trigger i[data-lucide] {
    width: 11px;
    height: 11px;
}

.filter-help-tooltip {
    position: fixed;
    z-index: 12000;
    display: none;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(96, 165, 250, 0.18);
    background: rgba(15, 23, 42, 0.96);
    color: #e2e8f0;
    font-size: 12px;
    line-height: 1.45;
    box-shadow: 0 18px 40px rgba(2, 6, 23, 0.42);
    backdrop-filter: blur(14px);
    pointer-events: none;
}

.filter-help-tooltip.is-visible {
    display: block;
}

.btn-secondary {
    background: rgba(30, 41, 59, 0.78);
    border: 1px solid rgba(148, 163, 184, 0.16);
}

.btn-filter-aux {
    width: 100%;
    height: 42px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.78);
    border-color: rgba(148, 163, 184, 0.18);
    color: #fbbf24;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
    gap: 8px;
    padding: 0 12px;
}

.btn-filter-main {
    min-width: 0;
    grid-column: span 2;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #eff6ff;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.24);
    font-size: 12.5px;
}

.btn-filter-secondary {
    color: var(--text-primary);
    font-size: 12.5px;
}

.btn-filter-export {
    min-width: 0;
    font-size: 12.5px;
}

.btn-filter-aux,
.btn-filter-secondary,
.btn-filter-export {
    width: 100%;
    justify-content: center;
}

.filter-active-badges {
    display: none;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px 20px 12px;
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.88), rgba(15, 23, 42, 0.72));
    border-top: 1px solid rgba(148, 163, 184, 0.08);
}

.filter-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px 8px 12px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.14);
    border: 1px solid rgba(96, 165, 250, 0.22);
    color: #dbeafe;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.filter-badge button {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.12);
    color: inherit;
    cursor: pointer;
    line-height: 1;
    font-size: 13px;
    padding: 0;
}

.filter-badge button:hover {
    background: rgba(255,255,255,0.22);
}

.filter-clear-all {
    margin-left: auto;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.55);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.18s ease;
}

.filter-clear-all:hover {
    color: var(--text-primary);
    border-color: rgba(96, 165, 250, 0.34);
    background: rgba(30, 41, 59, 0.9);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.drawer-action-hint {
    margin: 0 0 12px;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.5;
}

.actions-mobile {
    display: none;
}

/* Status */
.status-indicator {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
}

.status-indicator.mt-2 {
    margin-top: 8px;
}

.pulse {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--success);
    border-radius: 50%;
    margin-right: 8px;
    box-shadow: 0 0 8px var(--success);
    animation: pulse-anim 2s infinite;
}

@keyframes pulse-anim {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes splash-load {
    0% { transform: translateX(-100%); width: 30%; }
    50% { width: 50%; }
    100% { transform: translateX(300%); width: 30%; }
}

@media (max-width: 600px) {
    .hidden-mobile { display: none !important; }
}

/* Main Area */
.app-main {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

.map-section {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
}

#map {
    flex: 1;
    background-color: #0c0e14;
    z-index: 1;
}

.map-overlay-info {
    position: absolute;
    top: 80px; /* Moved down to avoid overlapping zoom controls */
    left: 20px;
    background: var(--bg-panel);
    opacity: 0.95;
    border: 1px solid var(--border-color);
    padding: 16px 20px;
    border-radius: 10px;
    z-index: 900;
    pointer-events: none;
    min-width: 220px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.map-overlay-info h3 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.map-overlay-info p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.map-controls-bottom {
    position: absolute;
    bottom: 24px;
    right: 24px;
    z-index: 900;
}

/* Sidebar */
.sidebar-section {
    width: 380px;
    background-color: var(--bg-panel);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-header h2 {
    font-size: 1.05rem;
    font-weight: 600;
}

.badge {
    background-color: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* Analytics */
.sidebar-analytics {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-dark);
}

.analytics-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
}

.analytics-card h4 {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.mini-list {
    list-style: none;
    font-size: 12px;
}

.mini-list li {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid rgba(46, 54, 79, 0.5);
}

.mini-list li:last-child {
    border-bottom: none;
}

.mini-list .city-name {
    color: var(--text-primary);
}

.mini-list .city-count {
    color: var(--accent);
    font-weight: 600;
}

.empty-list {
    color: rgba(148, 163, 184, 0.5);
    font-style: italic;
}

/* List */
.provider-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    text-align: center;
    padding: 0 24px;
    gap: 16px;
    opacity: 0.7;
    margin-top: 40px;
}

.empty-state svg {
    margin-bottom: 8px;
}

.provider-card {
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    padding: 14px;
    border-radius: 8px;
    transition: border-color 0.2s;
    cursor: default;
}

.provider-card:hover {
    border-color: rgba(59, 130, 246, 0.4);
}

.provider-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    gap: 8px;
}

.provider-name {
    font-weight: 600;
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-primary);
}

.provider-asn {
    font-family: monospace;
    font-size: 11px;
    background: rgba(45, 55, 72, 0.8);
    padding: 4px 6px;
    border-radius: 4px;
    color: #cbd5e1;
    white-space: nowrap;
}

.provider-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    font-size: 11.5px;
    color: var(--text-secondary);
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 6px;
}
.detail-full {
    grid-column: 1 / -1;
    margin-top: 2px;
}

/* Cluster Customization */
.marker-cluster-custom {
    background-color: rgba(59, 130, 246, 0.6);
    border-radius: 20px;
    font-family: 'Inter';
    color: var(--text-primary);
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

/* Marca o ultimo cluster em que o usuario clicou, para ele lembrar onde ja
   olhou. So o mais recente fica marcado (ver markClusterAsLastActivated). */
.marker-cluster-custom.marker-cluster-active {
    background-color: rgba(245, 158, 11, 0.75);
    border-color: rgba(255, 255, 255, 0.85);
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.65);
}

/* Painel para escolher uma empresa dentro de um cluster pequeno (varias
   empresas no mesmo ponto geografico). Position:fixed e centralizado na
   tela, com backdrop proprio - nao depende do sistema de popup do Leaflet
   (que fica sujeito a corte nas bordas do mapa e a travar aberto). */
.cluster-list-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(3, 8, 20, 0.55);
    backdrop-filter: blur(2px);
    padding: 24px;
}

.cluster-list-panel {
    width: min(320px, 100%);
    max-height: min(420px, 80vh);
    display: flex;
    flex-direction: column;
    background: var(--bg-panel);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.cluster-list-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.cluster-list-panel-header strong {
    font-size: 13px;
    color: var(--text-primary);
}

.cluster-list-panel-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 999px;
    background: var(--bg-hover);
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.cluster-list-panel-close:hover {
    color: var(--text-primary);
    background: var(--accent-glow);
}

.cluster-list-panel-search {
    padding: 12px 12px 10px;
    flex-shrink: 0;
}

.cluster-list-panel-search input {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-dark);
    color: var(--text-primary);
    font: inherit;
    font-size: 12px;
}

.cluster-list-panel-search input:focus {
    outline: none;
    border-color: var(--accent);
}

.cluster-list-panel-empty {
    margin: 0 10px 10px;
}

.cluster-list-panel-items {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    gap: 4px;
    padding: 10px;
    overflow-y: auto;
}

.cluster-list-panel-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 100%;
    padding: 9px 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: var(--bg-hover);
    color: var(--text-primary);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.cluster-list-panel-item:hover,
.cluster-list-panel-item:focus-visible {
    border-color: var(--accent);
    background: var(--accent-glow);
    outline: none;
}

.cluster-list-panel-item-name {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
}

.cluster-list-panel-item-meta {
    font-size: 11px;
    color: var(--text-secondary);
}

.cluster-list-panel-remaining {
    padding: 8px 16px 14px;
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
    flex-shrink: 0;
}

/* Painel "empilhado" com detalhes de um ASN vizinho, aberto por cima do
   modal do dossie (sem fechar o dossie). Reaproveita o mesmo padrao visual
   da lista de cluster, so com z-index maior para garantir a sobreposicao. */
.bgp-asn-quickview-backdrop {
    z-index: 10000;
}

.bgp-asn-quickview-panel {
    max-height: min(360px, 80vh);
}

.bgp-asn-quickview-body {
    padding: 4px 16px 16px;
    overflow-y: auto;
}

.bgp-asn-quickview-name {
    margin: 6px 0 12px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

.bgp-asn-quickview-footnote {
    margin-top: 12px;
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.bgp-asn-quickview-action {
    width: 100%;
    margin-top: 14px;
    justify-content: center;
}

.bgp-country-flag {
    width: 18px;
    height: auto;
    border-radius: 2px;
    vertical-align: middle;
    margin-right: 6px;
}

.dossier-linked-asn-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.dossier-linked-asn-chip {
    padding: 4px 10px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--bg-hover);
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11.5px;
    font-weight: 700;
}

button.dossier-linked-asn-chip {
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

button.dossier-linked-asn-chip:hover {
    border-color: var(--accent);
    background: var(--accent-glow);
}

.dossier-linked-asn-chip.is-static {
    opacity: 0.6;
    cursor: default;
}

.leaflet-div-icon.city-marker {
    background: var(--accent);
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
}

.clear-icon-container {
    background: transparent;
    border: none;
}

.beacon-marker {
    position: relative;
    color: var(--accent);
}

.beacon-pulse {
    position: absolute;
    top: 50%; left: 50%;
    width: 20px; height: 20px;
    background: var(--accent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
    animation: beacon-anim 2s infinite ease-out;
}

@keyframes beacon-anim {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(2.5); opacity: 0; }
}

/* Tooltips */
.leaflet-container {
    background: #0f111a !important;
}

.leaflet-tooltip.glass-tooltip {
    background: rgba(26, 29, 45, 0.95) !important;
    border: 1px solid var(--border-color) !important;
    color: white !important;
    backdrop-filter: blur(8px) !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    font-family: 'Inter', sans-serif !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4) !important;
}
.leaflet-tooltip-top.glass-tooltip:before,
.leaflet-tooltip-bottom.glass-tooltip:before,
.leaflet-tooltip-left.glass-tooltip:before,
.leaflet-tooltip-right.glass-tooltip:before {
    border-top-color: rgba(26, 29, 45, 0.95) !important;
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .app-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        align-items: stretch;
        padding: 12px;
        gap: 10px;
    }
    .header-top {
        flex-wrap: wrap;
        gap: 12px;
    }
    .header-actions {
        justify-content: flex-end;
        width: 100%;
        margin-left: 0;
    }
    .search-container {
        flex: none;
        width: 100%;
        max-width: none;
        min-width: 0;
    }
    .header-filters {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-panel--actions {
        min-width: 0;
        max-width: none;
        width: 100%;
    }
}

@media (max-width: 768px) {
    #btn-minimize-filters,
    .side-drawer {
        display: none !important;
    }
    .app-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        row-gap: 10px;
        position: relative;
        z-index: 1200;
        background: rgba(15, 23, 42, 0.96);
        backdrop-filter: blur(14px);
    }
    #search-input {
        font-size: 12px;
    }
    .header-actions {
        display: none;
    }
    .mobile-only {
        display: none !important;
    }
    #btn-login-mobile {
        min-width: 0;
        padding: 0 12px;
    }
    #btn-login-mobile-label {
        display: none;
    }
    #btn-login-mobile i {
        margin-right: 0 !important;
    }
    #btn-export-csv {
        min-width: 0;
        padding: 0 12px;
    }
    #btn-export-csv span {
        display: none;
    }
    #btn-export-csv i {
        margin-right: 0 !important;
    }
    .header-metrics-bar {
        display: none;
    }
    .app-main,
    .map-canvas-area {
        position: relative;
        min-width: 0;
    }
    .sidebar-section {
        position: absolute;
        top: 0;
        right: 0;
        height: 100%;
        transform: translateX(100%);
    }
    
    .sidebar-section.open {
        transform: translateX(0);
        box-shadow: -5px 0 25px rgba(0,0,0,0.5);
    }
    
    .actions-mobile {
        display: block;
        margin-left: auto;
    }
    
    #toggle-sidebar {
        background: var(--bg-hover);
        border: 1px solid var(--border-color);
        color: var(--text-primary);
        border-radius: 6px;
        padding: 5px 8px;
        cursor: pointer;
    }
    
    .map-overlay-info {
        top: 10px;
        right: 10px;
        left: auto;
        min-width: 160px;
        padding: 10px 12px;
    }
    .map-overlay-info h3 {
        font-size: 0.9rem;
    }
    .header-filters {
        padding: 12px;
        gap: 10px;
    }
    #btn-open-selection-help {
        display: none !important;
    }
    #map-stats-overlay {
        top: 92px !important;
        left: 12px !important;
        right: 12px !important;
        width: auto !important;
        padding: 14px 16px !important;
        z-index: 850 !important;
        pointer-events: none;
    }
    .floating-filters {
        z-index: 860 !important;
    }
    .filter-panel {
        padding: 14px;
        border-radius: 12px;
        gap: 12px;
    }
    .filter-group,
    .filter-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-actions {
        display: grid;
        grid-template-columns: 1fr;
    }
    .filter-stack,
    .filter-select,
    .filter-select--state,
    .filter-select--ddd,
    .btn-filter-main,
    .btn-filter-secondary,
    .btn-filter-export {
        width: 100%;
        min-width: 0;
    }
    .btn-filter-aux {
        width: 100%;
    }
    .filter-active-badges {
        padding: 10px 14px 14px;
    }
    .filter-panel-heading strong {
        font-size: 13px;
    }
    .filter-panel-kicker,
    .filter-label {
        font-size: 10px;
    }
    .modal-box-provider {
        width: calc(100% - 16px);
        max-width: none;
        max-height: calc(100vh - 16px);
        border-radius: 14px;
    }
    .modal-header {
        padding: 20px 18px 16px;
    }
    .modal-body {
        padding: 18px;
        max-height: calc(100vh - 180px);
    }
    .modal-grid {
        grid-template-columns: 1fr;
    }
    .modal-insight-banner {
        flex-direction: column;
        align-items: stretch;
    }
    .modal-meta-strip {
        gap: 8px;
    }
    .modal-meta-pill {
        width: 100%;
        justify-content: space-between;
    }
}

/* Modal & Branding */
.sidebar-footer {
    padding: 16px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    font-size: 11px;
    color: var(--text-secondary);
    background: var(--bg-dark);
}
.sidebar-footer a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s;
}
.sidebar-footer a:hover {
    color: var(--accent);
    text-decoration: underline;
}
.sidebar-footer strong {
    color: inherit;
}

.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(10, 11, 16, 0.90);
    opacity: 0.95;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s;
}
.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}
.modal-box {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 680px;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.modal-box-provider {
    max-width: 1040px;
    border-radius: 18px;
    box-shadow: 0 28px 70px rgba(2, 6, 23, 0.58);
}
.modal-header {
    background: linear-gradient(135deg, rgba(26,29,45,1) 0%, rgba(15,17,26,1) 100%);
    padding: 30px 30px 20px 30px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.modal-header-provider {
    gap: 16px;
    padding-bottom: 24px;
}
.modal-header-provider .modal-subtitle {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.modal-header h3 {
    margin: 0; 
    font-size: 1.5rem; 
    color: #ffffff;
    font-weight: 700;
}
.modal-quality-note {
    margin: 0;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.45;
    max-width: 680px;
}
.modal-subtitle {
    color: var(--accent);
    font-size: 0.85rem;
    font-family: monospace;
    font-weight: 600;
    text-transform: uppercase;
}
.modal-close-btn {
    position: absolute;
    top: 20px; right: 24px;
    background: rgba(255,255,255,0.05); 
    border: 1px solid var(--border-color); 
    color: var(--text-secondary);
    width: 32px; height: 32px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s;
}
.modal-close-btn:hover { 
    color: var(--text-primary); 
    background: var(--danger);
    border-color: var(--danger);
}
.modal-body {
    padding: 20px 24px 24px;
    max-height: 74vh;
    overflow-y: auto;
    background: var(--bg-dark);
}
.modal-header-provider::after {
    content: "";
    position: absolute;
    inset: auto 30px 0 30px;
    height: 1px;
    background: linear-gradient(90deg, rgba(96, 165, 250, 0.24), rgba(148, 163, 184, 0.04));
}
.modal-meta-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.modal-meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 11px;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(148, 163, 184, 0.14);
    color: var(--text-secondary);
    font-size: 11px;
    letter-spacing: 0.03em;
}
.modal-meta-pill strong {
    color: var(--text-primary);
}
.modal-insight-banner {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    padding: 14px 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(15, 23, 42, 0.82));
    border: 1px solid rgba(96, 165, 250, 0.18);
}
.modal-insight-banner strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text-primary);
    font-size: 13px;
    letter-spacing: 0.03em;
}
.modal-insight-banner p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.45;
}
.modal-insight-banner--warning {
    margin-bottom: 16px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(15, 23, 42, 0.82));
    border-color: rgba(245, 158, 11, 0.22);
}
.modal-insight-pill {
    white-space: nowrap;
    align-self: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    color: #dbeafe;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Tabs Styling for Modal */
.modal-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 14px;
    gap: 12px;
    padding: 0;
    flex-wrap: wrap;
}
.modal-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 6px 0;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.modal-tab-btn:hover {
    color: var(--text-primary);
}
.modal-tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
.modal-tab-content {
    display: none;
}
.modal-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}
.modal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.modal-info-card {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.88), rgba(15, 23, 42, 0.72));
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(96, 165, 250, 0.12);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.modal-info-card:hover {
    box-shadow: 0 12px 24px rgba(2, 6, 23, 0.22);
    border-color: rgba(59, 130, 246, 0.26);
}
.modal-info-card strong {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.modal-info-card strong svg {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent);
    padding: 3px;
    border-radius: 5px;
    width: 18px !important;
    height: 18px !important;
    flex-shrink: 0;
}
.modal-info-card span {
    display: block;
    font-size: 13.5px;
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1.55;
    word-break: break-word;
}
.modal-info-card.full-width {
    grid-column: 1 / -1;
}
.modal-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: var(--accent);
    padding: 40px;
    text-align: center;
}

.modal-empty-state {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px;
    color: var(--text-secondary);
    text-align: center;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
}

/* Dossie: BGP tab compaction */
.bgp-flow-container {
    display: grid;
    gap: 14px;
}

.bgp-card-grid,
.bgp-reach-grid {
    display: grid;
    gap: 10px;
}

.bgp-reach-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.reach-column .stack-grid,
.flow-layer .data-grid {
    max-height: 320px;
    overflow: auto;
    padding-right: 4px;
}

.flow-connector-pulse {
    display: block;
}

.bgp-core-compact .noc-core-node {
    min-height: auto;
    padding: 14px 16px;
}

.bgp-core-compact .core-asn-value {
    font-size: 1.2rem;
    line-height: 1.35;
    word-break: break-word;
}

.bgp-topology-grid {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) 320px minmax(280px, 1fr);
    gap: 16px;
    align-items: stretch;
}

.bgp-card-scroll {
    max-height: 360px;
    overflow: auto;
    padding-right: 4px;
}

@media (max-width: 980px) {
    .bgp-topology-grid {
        grid-template-columns: 1fr;
    }
    .bgp-reach-grid {
        grid-template-columns: 1fr;
    }
}

.qsa-list {
    margin: 4px 0 0 16px;
    padding: 0;
    color: var(--text-secondary);
}

.qsa-list li {
    margin-bottom: 6px;
    font-size: 12.5px;
}

.qsa-list li span {
    display: inline;
    color: var(--text-secondary);
    opacity: 0.8;
    font-size: 11px;
    font-weight: 400;
}

.premium-lock-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 280px;
    padding: 32px 24px;
    border: 1px dashed rgba(96, 165, 250, 0.22);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.82), rgba(15, 23, 42, 0.68));
    text-align: center;
}

.leaflet-interactive:focus { outline: none !important; } 
.ibge-state-poly { outline: none !important; } 
svg path { outline: none !important; }

.catalog-mode-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-start;
    min-width: 0;
    margin: 0;
    z-index: 6;
    flex: 0 1 auto;
}

.catalog-mode-help {
    flex: 0 0 auto;
}

.catalog-mode-help.filter-help-trigger {
    width: 18px;
    min-width: 18px;
    height: 18px;
    padding: 0;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1;
}

.catalog-mode-toggle .catalog-mode-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 124px;
    height: 38px;
    padding: 0 14px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 10px;
    background: rgba(30, 41, 59, 0.78);
    color: var(--noc-text);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.18s ease;
}

.catalog-mode-toggle .catalog-mode-btn i[data-lucide] {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0.9;
}

.catalog-mode-toggle .catalog-mode-btn span {
    line-height: 1;
}

.catalog-mode-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--noc-text);
    line-height: 1;
    white-space: nowrap;
}

.catalog-mode-toggle .catalog-mode-btn:hover {
    background: rgba(40, 51, 69, 0.88);
    border-color: rgba(148, 163, 184, 0.24);
    color: #dbeafe;
}

.catalog-mode-toggle .catalog-mode-btn.is-active {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.32), rgba(16, 185, 129, 0.22));
    border-color: rgba(96, 165, 250, 0.58);
    color: #f8fbff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.16);
}

.catalog-mode-toggle .catalog-mode-btn.is-active span {
    color: #f8fbff;
}

/* Botao unico + menu para telas de celular: os 3 botoes cheios competiam
   por espaco com a caixa de busca no header mobile. */
.catalog-mode-mobile-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 10px;
    background: rgba(30, 41, 59, 0.78);
    color: var(--noc-text);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}

.catalog-mode-mobile-trigger i[data-lucide] {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0.9;
}

.catalog-mode-mobile-trigger-label {
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.catalog-mode-mobile-trigger[aria-expanded="true"] {
    border-color: rgba(96, 165, 250, 0.58);
    color: #dbeafe;
}

.catalog-mode-menu-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px;
}

.catalog-mode-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: var(--bg-hover);
    color: var(--text-primary);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.catalog-mode-menu-item i[data-lucide] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.85;
}

.catalog-mode-menu-item-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.catalog-mode-menu-item-text strong {
    font-size: 13px;
}

.catalog-mode-menu-item-text small {
    font-size: 11px;
    color: var(--text-secondary);
}

.catalog-mode-menu-item:hover,
.catalog-mode-menu-item:focus-visible {
    border-color: var(--accent);
    background: var(--accent-glow);
    outline: none;
}

.catalog-mode-menu-item.is-active {
    border-color: var(--accent);
    background: rgba(59, 130, 246, 0.16);
}

@media (max-width: 1280px) {
    /* .app-header vira display:grid (enterprise.css, @media min-width:769px)
       com uma coluna 1fr para este seletor. Sem min-width:0/width:auto aqui,
       o item nao consegue encolher abaixo do seu conteudo dentro do track,
       o que e a causa raiz do antigo bug de sobreposicao com o botao de
       exportar (ver o ajuste em grid-template-columns em enterprise.css). */
    .catalog-mode-toggle {
        width: auto;
        max-width: none;
        min-width: 0;
        margin: 0;
    }
}

@media (max-width: 900px) {
    /* Regra unica para o seletor de modo do catalogo em telas estreitas.
       Antes havia duas regras conflitantes (900px e 768px) disputando o
       mesmo seletor com a mesma especificidade, o que deixava o layout
       inconsistente conforme a largura exata do dispositivo. */
    .catalog-mode-toggle {
        display: grid !important;
        grid-template-columns: 30px repeat(3, minmax(0, 1fr));
        align-items: stretch;
        gap: 6px;
        width: 100%;
        max-width: none;
        min-width: 0;
        justify-content: stretch;
        overflow: visible;
        padding-bottom: 0;
    }
    .catalog-mode-help {
        width: 24px;
        min-width: 24px;
        height: 24px;
        align-self: center;
        justify-self: center;
    }
    .search-container {
        z-index: 5;
    }

    .catalog-mode-toggle .catalog-mode-btn {
        min-width: 0;
        width: 100%;
        padding: 0 6px;
        border-radius: 10px;
        min-height: 40px;
        justify-content: center;
        gap: 4px;
    }

    .catalog-mode-label {
        font-size: 10px;
        letter-spacing: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .catalog-mode-toggle .catalog-mode-btn i[data-lucide] {
        width: 13px;
        height: 13px;
        flex-shrink: 0;
    }
    /* Quando so tem o botao-menu compacto (celular), a grade de 4 colunas
       pensada para os 3 botoes cheios deixa espaco vazio sobrando; troca
       para um flex simples so nesse estado. */
    .catalog-mode-toggle:has(.catalog-mode-mobile-trigger) {
        display: flex !important;
        align-items: center;
        width: auto;
    }
    #map-stats-overlay {
        top: 92px !important;
        left: 12px !important;
        right: 12px !important;
        width: auto !important;
        padding: 14px 16px !important;
        z-index: 850 !important;
        pointer-events: none;
    }
}

@media (max-width: 420px) {
    /* Em telas muito estreitas o rotulo de texto nao cabe ao lado do
       icone sem quebrar o botao; mostramos so o icone com title/aria
       para manter a acessibilidade sem estourar a largura. */
    .catalog-mode-toggle .catalog-mode-btn {
        padding: 0 2px;
    }
    .catalog-mode-toggle .catalog-mode-label {
        display: none;
    }
    .catalog-mode-toggle .catalog-mode-btn i[data-lucide] {
        width: 16px;
        height: 16px;
    }
}
