:root {
    --sidebar-bg: #ffffff;
    --sidebar-border: #e2e8f0;
    --text-dark: #0f172a;
    --text-body: #334155;
    --text-muted: #64748b;
    --primary: #cf0e0e;
    --primary-hover: #ad0d0d;
    --primary-soft: #fef2f2;
    --brand-red: #cf0e0e;
    --brand-red-hover: #ad0d0d;
    --brand-red-dark: #700808;
    --brand-red-light: #f12d2d;
    --brand-bg: #f6f6f7;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --sidebar-width: 285px;
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8fafc;
    color: var(--text-dark);
}

.hidden {
    display: none !important;
}

.app-layout {
    display: flex;
    width: 100vw;
    height: 100vh;
    position: relative;
}

/* Backdrop para fechar o menu no celular e tablet */
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 2050;
    transition: opacity 0.22s ease;
}

.sidebar-backdrop.hidden {
    display: none !important;
}

/* Botão Flutuante para Exibir Menu Lateral quando oculto */
.floating-menu-btn {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1100;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid var(--sidebar-border);
    color: var(--text-dark);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.14);
    transition: all 0.2s ease;
}

.floating-menu-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

/* MENU LATERAL LIMPO (Fundo Claro) */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 1050;
    box-shadow: 4px 0 20px rgba(15, 23, 42, 0.04);
    transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed {
    margin-left: calc(var(--sidebar-width) * -1);
}

.sidebar-top {
    padding: 18px 18px 14px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
}

.brand-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: -0.01em;
}

.btn-collapse {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--sidebar-border);
    background: #f8fafc;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.btn-collapse:hover {
    background: #f1f5f9;
    color: var(--text-dark);
}

/* Navegação do Menu Lateral */
.sidebar-menu {
    flex: 1;
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.menu-item-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: var(--text-dark);
    font-size: 13.5px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: all 0.18s ease;
}

.menu-item-btn:hover {
    background: var(--primary-soft);
    border-color: #bfdbfe;
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
}

.menu-item-icon {
    font-size: 18px;
    line-height: 1;
}

.menu-item-text {
    line-height: 1.3;
}

/* Submenu dentro do Menu Lateral */
.menu-item-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 100%;
}

/* Accordion Dropdown CADASTRO */
.menu-accordion-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.accordion-btn {
    justify-content: space-between !important;
}

.accordion-chevron {
    font-size: 11px;
    color: var(--text-muted);
    transition: transform 0.25s ease;
    display: inline-block;
}

.accordion-chevron.open {
    transform: rotate(180deg);
}

.menu-subitems-panel {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding-left: 6px;
    border-left: 2px solid #3b82f6;
    margin-left: 10px;
    margin-top: 2px;
    margin-bottom: 6px;
    animation: fadeIn 0.18s ease;
}

.menu-subitems-panel.hidden {
    display: none !important;
}

.menu-subitem-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px 8px 14px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-body);
    font-size: 12.5px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: all 0.16s ease;
}

.menu-subitem-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
}

.menu-subitem-icon {
    font-size: 14px;
    line-height: 1;
}

.menu-subitem-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12.5px;
}

.badge-pill.mini {
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 800;
    border-radius: 999px;
    flex-shrink: 0;
    letter-spacing: 0.3px;
    line-height: 1.2;
}

.badge-pill-sub {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    background: #f5f3ff;
    color: #6d28d9;
    border: 1px solid #c4b5fd;
}

/* Rodapé discreto da Sidebar */
.sidebar-footer {
    padding: 14px 18px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--text-muted);
}

.status-indicator .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #94a3b8;
}

.status-indicator.online .dot {
    background: var(--success);
}

.status-indicator.loading .dot {
    background: var(--warning);
}

.status-indicator.error .dot {
    background: var(--danger);
}

.btn-link-subtle {
    background: none;
    border: none;
    padding: 0;
    text-align: left;
    font-size: 11.5px;
    color: var(--text-muted);
    text-decoration: underline;
    cursor: pointer;
}

.btn-link-subtle:hover {
    color: var(--primary);
}

/* ÁREA DO MAPA */
.map-wrapper {
    flex: 1;
    height: 100vh;
    position: relative;
}

.map-canvas {
    width: 100%;
    height: 100%;
    background: #e2e8f0;
}

/* Banner de clique no mapa para pegar coordenadas do AP */
.map-pick-banner {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1200;
    background: #0f172a;
    color: #ffffff;
    padding: 10px 18px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

.btn-pick-cancel {
    background: #ef4444;
    color: #fff;
    border: none;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

/* Barra Flutuante Moderna de Viabilidade e Edição do Cabo de Fibra Óptica */
.fiber-route-bar {
    position: absolute;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1100;
    background: rgba(15, 23, 42, 0.94);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    padding: 7px 16px;
    display: flex;
    align-items: center;
    color: #ffffff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.08);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 95vw;
}

.fiber-route-bar.hidden {
    display: none !important;
}

.fiber-bar-mode-container {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
}

.fiber-bar-mode-container.hidden {
    display: none !important;
}

.fiber-route-pill-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    white-space: nowrap;
}

.fiber-bar-badge {
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.fiber-bar-badge.viable {
    background: #059669;
    color: #ecfdf5;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.fiber-bar-badge.inviable {
    background: #dc2626;
    color: #fef2f2;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.fiber-bar-badge.edit {
    background: #2563eb;
    color: #eff6ff;
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.4);
}

.fiber-bar-dist strong {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13.5px;
    color: #6ee7b7;
}

.fiber-bar-dist.exceeded strong {
    color: #fca5a5;
}

.fiber-bar-cto {
    color: #cbd5e1;
    font-size: 12px;
}

.fiber-bar-cto strong {
    color: #ffffff;
    font-family: 'JetBrains Mono', monospace;
}

.fiber-route-pill-actions {
    display: flex;
    align-items: center;
    gap: 7px;
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    padding-left: 12px;
}

.fiber-bar-hint {
    font-size: 11.5px;
    color: #fbbf24;
    white-space: nowrap;
}

.btn-fiber-bar {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-fiber-bar:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.btn-fiber-bar.primary {
    background: #2563eb;
    border-color: #3b82f6;
    color: #ffffff;
}
.btn-fiber-bar.primary:hover {
    background: #1d4ed8;
}

.btn-fiber-bar.secondary {
    background: rgba(100, 116, 139, 0.4);
    border-color: rgba(148, 163, 184, 0.3);
}

.btn-fiber-bar.close {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 2px 6px;
    font-size: 14px;
}
.btn-fiber-bar.close:hover {
    color: #ffffff;
}

/* Alças / Marcadores de Postes e Curvas do Trajeto da Fibra */
.fiber-waypoint-handle {
    width: 14px;
    height: 14px;
    background-color: #ffffff;
    border: 3px solid #059669;
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.5), 0 0 0 3px rgba(16, 185, 129, 0.4);
    cursor: grab;
    transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.fiber-waypoint-handle:hover {
    transform: scale(1.35);
    border-color: #047857;
    background-color: #ecfdf5;
    box-shadow: 0 0 10px rgba(5, 150, 105, 0.8), 0 0 0 4px rgba(16, 185, 129, 0.5);
}

.leaflet-dragging .fiber-waypoint-handle,
.fiber-waypoint-handle:active {
    cursor: grabbing !important;
    transform: scale(1.5);
    border-color: #2563eb;
    box-shadow: 0 0 12px rgba(37, 99, 235, 0.8), 0 0 0 5px rgba(59, 130, 246, 0.5);
}

/* Controles Superiores do Mapa */
.map-top-right-controls {
    position: absolute;
    top: 14px;
    right: 16px;
    z-index: 1250;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    pointer-events: auto;
    transition: all 0.2s ease;
}

/* Botão elegante de recolher / expandir os controles de satélite e filtros */
.btn-toggle-map-controls {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid #cbd5e1;
    color: #334155;
    padding: 6px 12px;
    border-radius: 9px;
    cursor: pointer;
    font-size: 11.5px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
    transition: all 0.2s ease;
    align-self: flex-end;
}

.btn-toggle-map-controls:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #94a3b8;
}

.map-controls-content {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.map-top-right-controls.collapsed .map-controls-content {
    display: none !important;
}

.map-top-right-controls.collapsed .btn-toggle-map-controls {
    background: rgba(15, 23, 42, 0.92);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.map-top-controls {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    pointer-events: auto;
}

.active-ap-chip {
    position: absolute;
    top: 14px;
    left: 76px;
    max-width: calc(100% - 390px);
    z-index: 1200;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 7px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid #cbd5e1;
    font-size: 13px;
    color: var(--text-dark);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
    pointer-events: auto;
    white-space: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    transition: max-width 0.25s cubic-bezier(0.16, 1, 0.3, 1), padding 0.2s ease, top 0.2s ease;
}

.active-ap-chip::-webkit-scrollbar {
    display: none;
}

.active-ap-chip.hidden {
    display: none !important;
}

/* Modo Compacto/Minimizado (Ocultar Detalhes) */
.active-ap-chip.collapsed {
    padding: 6px 12px;
    gap: 8px;
    max-width: fit-content;
}

.active-ap-chip.collapsed .fresnel-mini-legend,
.active-ap-chip.collapsed .btn-chip-report,
.active-ap-chip.collapsed .chip-badge.poi {
    display: none !important;
}

/* Botão Ocultar Ambas as Barras */
.btn-chip-toggle.both-bars {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #1e293b;
    font-weight: 700;
}

.btn-chip-toggle.both-bars:hover {
    background: #e2e8f0;
    color: #0f172a;
    border-color: #94a3b8;
}

/* Em telas menores ou notebooks (<= 1350px): posiciona a barra do AP na linha de baixo (top: 68px) para NUNCA encavalar */
@media (max-width: 1350px) {
    .active-ap-chip {
        top: 68px !important;
        left: 14px !important;
        max-width: calc(100% - 28px) !important;
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.22) !important;
    }
}

.chip-main {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

.chip-main strong {
    font-family: 'JetBrains Mono', monospace;
    color: var(--primary);
    white-space: nowrap;
    font-weight: 700;
}

.chip-title-wrap {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.chip-badge {
    background: #eff6ff;
    color: var(--primary);
    border: 1px solid #bfdbfe;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
}

.chip-badge.poi {
    background: #f5f3ff;
    color: #7c3aed;
    border-color: #ddd6fe;
}

.fresnel-mini-legend {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding-left: 12px;
    border-left: 1px solid #e2e8f0;
    font-size: 12px;
    white-space: nowrap;
}

.leg-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.leg-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.leg-dot.ok { background: #10b981; }
.leg-dot.warn { background: #f59e0b; }
.leg-dot.bad { background: #ef4444; }
.leg-dot.poi {
    background: #8b5cf6;
    border-radius: 2px;
    transform: rotate(45deg);
}

.chip-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

.btn-chip-report {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: var(--primary);
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-chip-report:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.btn-chip-clear {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #b91c1c;
    padding: 5px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-chip-clear:hover {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
}

.btn-chip-toggle {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #475569;
    padding: 5px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 11.5px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-chip-toggle:hover {
    background: #e2e8f0;
    color: #0f172a;
    border-color: #94a3b8;
}

/* Grupo de Filtro de Tecnologia no Canto Superior Direito (Vertical) */
.map-tech-filter-group {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 110px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.14);
    position: relative;
    z-index: 1210;
    pointer-events: auto;
}

.tech-filter-btn {
    padding: 8px 14px;
    background: transparent;
    border: none;
    border-bottom: 1px solid #e2e8f0;
    color: var(--text-body);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
    user-select: none;
    text-align: left;
    width: 100%;
}

.tech-filter-btn .tech-icon {
    font-size: 13px;
    line-height: 1;
}

.tech-filter-btn .tech-label {
    flex: 1;
}

.tech-filter-btn:last-child {
    border-bottom: none;
    border-right: none;
}

.tech-filter-btn:hover {
    background: #f1f5f9;
    color: var(--text-dark);
}

.tech-filter-btn.active {
    background: #0f172a !important;
    color: #ffffff !important;
}

.tech-filter-btn[data-map-tech="radio"].active {
    background: #2563eb !important;
    color: #ffffff !important;
}

.tech-filter-btn[data-map-tech="fiber"].active {
    background: #059669 !important;
    color: #ffffff !important;
}

.tech-filter-btn[data-map-tech="none"].active {
    background: #0284c7 !important;
    color: #ffffff !important;
}

.map-layer-group {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.12);
}

.layer-btn {
    padding: 8px 12px;
    background: transparent;
    border: none;
    color: var(--text-body);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.layer-btn.active {
    background: var(--primary);
    color: #ffffff;
}

/* =========================================================
   POPUP SUAVE (Consultar por Ponto de Acesso & Cadastrar AP)
   ========================================================= */
.popup-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}

.popup-backdrop.open,
.popup-backdrop.active,
.popup-backdrop.visible {
    opacity: 1;
    pointer-events: auto;
}

.popup-window {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    width: 100%;
    max-width: 1020px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.22);
    transform: translateY(10px) scale(0.98);
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.popup-backdrop.open .popup-window,
.popup-backdrop.active .popup-window,
.popup-backdrop.visible .popup-window {
    transform: translateY(0) scale(1);
}

.popup-header {
    padding: 18px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    background: #f8fafc;
}

.popup-header h2 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 3px;
}

.popup-header p {
    font-size: 12.5px;
    color: var(--text-muted);
}

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

.btn-close-popup {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: var(--text-body);
    cursor: pointer;
    font-size: 13px;
}

.btn-close-popup:hover {
    background: #f1f5f9;
}

.status-banner {
    display: none;
    padding: 10px 24px;
    font-size: 12.5px;
}

.status-banner.visible.error {
    display: block;
    background: #fef2f2;
    border-bottom: 1px solid #fecaca;
    color: #b91c1c;
}

.popup-body-grid {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: 0;
    flex: 1;
    overflow: hidden;
}

@media (max-width: 860px) {
    .popup-body-grid {
        grid-template-columns: 1fr;
        overflow-y: auto;
    }
}

.popup-col {
    padding: 18px 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: hidden;
}

.popup-col.form-col {
    border-left: 1px solid #e2e8f0;
    background: #fcfcfd;
    overflow-y: auto;
}

.col-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.col-header label {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-dark);
}

.col-header code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--primary);
    background: #eff6ff;
    padding: 1px 5px;
    border-radius: 4px;
}

.badge-pill {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: var(--text-body);
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.badge-pill.info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: var(--primary);
}

.clean-input {
    width: 100%;
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.clean-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.clean-input[readonly] {
    background: #f1f5f9 !important;
    color: #475569 !important;
}

/* Lista de APs dentro do Popup */
.ap-popup-list {
    flex: 1;
    min-height: 260px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ap-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: var(--text-dark);
    cursor: pointer;
    text-align: left;
    transition: all 0.14s ease;
}

.ap-item:hover {
    border-color: #93c5fd;
    background: #f0f7ff;
}

.ap-item.active {
    border-color: var(--primary);
    background: #eff6ff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
}

.ap-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.ap-item-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ap-item-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-dark);
}

.ap-registered-tag {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
}

.ap-item-sub {
    font-size: 11.5px;
    color: var(--text-muted);
}

.ap-item-count {
    flex-shrink: 0;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: var(--text-body);
    font-size: 11.5px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
}

/* Formulário de Cadastro do AP */
.ap-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-field label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-body);
}

.field-hint {
    font-size: 11px;
    color: var(--text-muted);
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 10px;
}

.pick-coords-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.reuse-select {
    width: auto !important;
    flex: 1;
    min-width: 180px;
    padding: 6px 10px !important;
    font-size: 12px !important;
}

.db-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.linked-hint {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--primary);
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 4px;
    flex-wrap: wrap;
}

/* Botões */
.btn-primary {
    background: var(--primary);
    border: 1px solid var(--primary);
    color: #ffffff;
    padding: 9px 14px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: var(--text-dark);
    padding: 9px 14px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-secondary:hover {
    background: #f1f5f9;
}

.btn-sm {
    padding: 6px 11px;
    font-size: 12px;
}

/* Lista de APs já cadastrados */
.registered-aps-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.registered-aps-list {
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.reg-ap-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 7px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    font-size: 12px;
}

.saved-viab-row {
    transition: all 0.15s ease;
}

.saved-viab-row:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    transform: translateX(2px);
}

.reg-ap-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.reg-ap-info strong {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-dark);
}

.reg-ap-info small {
    font-size: 11px;
    color: var(--text-muted);
}

.reg-ap-actions {
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-mini {
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: var(--text-dark);
    cursor: pointer;
}

.btn-mini:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    color: var(--primary);
}

.btn-mini.danger:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #dc2626;
}

.empty-state, .empty-state-sm {
    padding: 24px 12px;
    text-align: center;
    color: var(--text-muted);
    font-size: 12.5px;
}

.empty-state-sm {
    padding: 12px;
    font-size: 12px;
}

/* =========================================================
   MARCADORES NO MAPA COMPACTOS (Para não poluir o mapa)
   ========================================================= */
.ap-tower-pin {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.ap-tower-badge {
    position: absolute;
    bottom: 26px;
    background: rgba(15, 23, 42, 0.94);
    color: #ffffff;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9.5px;
    font-weight: 700;
    padding: 1.5px 6px;
    border-radius: 5px;
    border: 1px solid #38bdf8;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.ap-tower-pin:hover .ap-tower-badge {
    opacity: 1;
}

.ap-tower-circle {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0284c7, #1e3a8a);
    border: 1.5px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    transition: transform 0.15s ease;
}

.ap-tower-pin:hover .ap-tower-circle {
    transform: scale(1.18);
}

/* Torrezinha Simples Compacta quando há mais de 1 AP na mesma localização */
.multi-tower-pin {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
}

.multi-tower-icon-wrap {
    position: relative;
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background: #0f172a;
    border: 1.5px solid #f59e0b;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease;
}

.multi-tower-pin:hover .multi-tower-icon-wrap {
    transform: scale(1.18);
}

.multi-tower-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ef4444;
    color: #ffffff;
    font-size: 8.5px;
    font-weight: 800;
    min-width: 15px;
    height: 15px;
    padding: 0 3px;
    border-radius: 999px;
    border: 1.5px solid #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.multi-tower-label {
    position: absolute;
    top: 26px;
    background: rgba(15, 23, 42, 0.94);
    color: #fbbf24;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9.5px;
    font-weight: 700;
    padding: 1.5px 6px;
    border-radius: 5px;
    border: 1px solid rgba(245, 158, 11, 0.55);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.multi-tower-pin:hover .multi-tower-label {
    opacity: 1;
}

/* Popup quando clica na Torrezinha com múltiplos APs */
.tower-site-popup {
    font-family: 'Inter', sans-serif;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tower-popup-header {
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 6px;
}

.tower-popup-header h4 {
    font-size: 13.5px;
    font-weight: 800;
    color: var(--text-dark);
}

.tower-popup-header small {
    font-size: 11px;
    color: var(--text-muted);
}

.btn-macro-tower {
    width: 100%;
    padding: 9px 12px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
    transition: opacity 0.15s ease;
}

.btn-macro-tower:hover {
    opacity: 0.94;
}

.tower-ap-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 210px;
    overflow-y: auto;
}

.tower-ap-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 9px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.tower-ap-card-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.tower-ap-card-info strong {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11.5px;
    color: var(--text-dark);
}

.tower-ap-card-info small {
    font-size: 10.5px;
    color: var(--text-muted);
}

.btn-view-single-ap {
    padding: 5px 9px;
    border-radius: 6px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.btn-view-single-ap:hover {
    background: var(--primary);
    color: #ffffff;
}

.btn-edit-single-ap {
    padding: 5px 8px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #475569;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-edit-single-ap:hover {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1d4ed8;
    transform: scale(1.08);
}

.client-map-pin {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #2563eb;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
    color: #ffffff;
    font-size: 9px;
    cursor: pointer;
    transition: transform 0.12s ease;
}

.client-map-pin:hover {
    transform: scale(1.3);
}

.client-map-pin.fresnel-ok {
    background: #10b981;
}

.client-map-pin.fresnel-warn {
    background: #f59e0b;
}

.client-map-pin.fresnel-bad {
    background: #ef4444;
}

/* Popup no Mapa */
.leaflet-popup-content-wrapper {
    background: #ffffff;
    color: var(--text-dark);
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22);
}

.leaflet-popup-tip {
    background: #ffffff;
}

.client-popup {
    font-family: 'Inter', sans-serif;
    min-width: 255px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.client-popup-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-dark);
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 5px;
}

.client-popup-row {
    font-size: 12px;
    color: var(--text-body);
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.client-popup-row span.lbl {
    color: var(--text-muted);
    font-weight: 500;
}

.client-popup-row code {
    font-family: 'JetBrains Mono', monospace;
    color: var(--primary);
    font-size: 11.5px;
}

.popup-fresnel-box {
    margin-top: 4px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 11.5px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.popup-fresnel-box.ok {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.popup-fresnel-box.warn {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.popup-fresnel-box.bad {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.btn-popup-fresnel {
    margin-top: 4px;
    width: 100%;
    padding: 7px 10px;
    border-radius: 7px;
    border: none;
    background: var(--primary);
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.btn-popup-fresnel:hover {
    background: var(--primary-hover);
}

/* =========================================================
   MODAL DE GRÁFICO DO RAIO DE FRESNEL (CONTROLES & EXPORTAÇÃO)
   ========================================================= */
.fresnel-window {
    max-width: 880px;
}

.fresnel-modal-body {
    padding: 16px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
}

/* ==========================================================================
   CARD EXECUTIVO LIMPO DE VIABILIDADE (RÁDIO & FIBRA)
   ========================================================================== */
.clean-viab-summary-card {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
    border-radius: 12px;
    padding: 16px;
    align-items: stretch;
}

.clean-viab-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #edf2f7;
    gap: 6px;
    min-height: 100px;
}

.clean-col-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #64748b;
}

.clean-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 800;
    padding: 6px 14px;
    border-radius: 9999px;
    letter-spacing: 0.2px;
    transition: all 0.2s ease;
}

.clean-status-pill.status-ok {
    background: #ecfdf5;
    color: #047857;
    border: 1.5px solid #a7f3d0;
}

.clean-status-pill.status-warn {
    background: #fffbeb;
    color: #b45309;
    border: 1.5px solid #fde68a;
}

.clean-status-pill.status-bad {
    background: #fef2f2;
    color: #b91c1c;
    border: 1.5px solid #fecaca;
}

.clean-big-value {
    font-size: 26px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.clean-big-value.highlight-height {
    color: #cf0e0e;
}

.clean-col-sub {
    font-size: 11.5px;
    color: #64748b;
    font-weight: 500;
}

.clean-btn-apply {
    margin-top: 4px;
    background: linear-gradient(135deg, #cf0e0e 0%, #ad0d0d 100%);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 5px 11px;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(207, 14, 14, 0.25);
    transition: all 0.18s ease;
}

.clean-btn-apply:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(207, 14, 14, 0.35);
}

/* Barra de simulação discreta */
.clean-sim-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    padding: 9px 16px;
    font-size: 13px;
}

.clean-sim-title {
    font-weight: 700;
    color: #334155;
    font-size: 12.5px;
}

.clean-sim-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.clean-sim-item .sim-label {
    font-weight: 600;
    color: #475569;
    font-size: 12px;
}

.clean-sim-clearance {
    padding-left: 8px;
    border-left: 1px solid #cbd5e1;
}

.clean-sim-clearance strong {
    font-size: 14px;
    color: #047857;
}

/* Botões de Ação Principais */
.clean-actions-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 2px 0;
}

.btn-clean-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-clean-action.btn-whatsapp {
    background: #10b981;
    color: #ffffff;
    border: none;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.btn-clean-action.btn-whatsapp:hover {
    background: #059669;
    transform: translateY(-1px);
}

/* Container do Estudo Topográfico e Gráfico de Fresnel (Aberto Diretamente) */
.fresnel-chart-wrapper,
.fresnel-advanced-details {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 4px;
}

.fresnel-advanced-summary {
    display: none;
}

.fresnel-metrics-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
    gap: 10px;
    flex-shrink: 0;
}

.fresnel-metric {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 4px;
}

.fresnel-metric.editable-metric {
    background: #ffffff;
    border-color: #cbd5e1;
}

.fresnel-metric.highlight-client {
    border-color: #93c5fd;
    background: #f8fbff;
}

.fresnel-metric .m-lbl {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
}

.fresnel-metric strong {
    font-size: 14px;
    color: var(--text-dark);
}

.height-stepper {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

.step-btn {
    width: 26px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #f1f5f9;
    color: var(--text-dark);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.step-btn:hover {
    background: #e2e8f0;
}

.height-input {
    width: 100%;
    height: 28px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #ffffff !important;
    color: #0f172a !important;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    outline: none;
}

.height-input:focus {
    border-color: var(--primary);
}

/* Barra de Altura Ideal Recomendada no Cliente */
.fresnel-ideal-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    font-size: 12.5px;
    color: #1e3a8a;
    flex-wrap: wrap;
}

.fresnel-ideal-bar.is-ok {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.ideal-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-ideal-apply {
    background: var(--primary);
    color: #ffffff;
    border: none;
    padding: 6px 12px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.btn-ideal-apply:hover {
    background: var(--primary-hover);
}

.fresnel-tech-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.fresnel-tech-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tech-badge {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 3px 8px;
    color: #334155;
    font-size: 11.5px;
}

.tech-badge strong {
    color: #0f172a;
}

.fresnel-tech-actions {
    display: flex;
    gap: 6px;
}

.fresnel-chart-container {
    position: relative;
    background: #090e1a;
    border: 1px solid #1e293b;
    border-radius: 12px;
    padding: 0;
    width: 100%;
    height: auto;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

#fresnel-svg {
    width: 100%;
    height: auto;
    aspect-ratio: 880 / 350;
    min-height: 320px;
    display: block;
    cursor: crosshair;
}

.fresnel-chart-tooltip {
    position: absolute;
    top: 14px;
    left: 14px;
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid #38bdf8;
    border-radius: 6px;
    padding: 6px 12px;
    color: #f8fafc;
    font-size: 11.5px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    pointer-events: none;
    z-index: 10;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    transition: opacity 0.15s ease;
}

/* Rodapé de Exportação dos 2 Relatórios (Cliente Individual & AP Geral) */
.fresnel-export-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding-top: 4px;
    flex-shrink: 0;
}

@media (max-width: 720px) {
    .fresnel-export-bar {
        grid-template-columns: 1fr;
    }
}

.export-group {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.export-group-title {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-body);
}

.export-btns {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Config Window */
.config-window {
    max-width: 540px;
}

.config-body {
    padding: 18px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.config-footer {
    padding: 14px 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* =========================================================
   PONTO DE INTERESSE (VIABILIDADE) DIFERENCIADO DOS ATIVOS
   ========================================================= */
.poi-viability-pin {
    position: relative;
    width: 20px;
    height: 20px;
    border-radius: 5px;
    transform: rotate(45deg);
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    border: 2px solid #ffffff;
    box-shadow: 0 3px 10px rgba(109, 40, 217, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease;
}

.poi-viability-pin span {
    transform: rotate(-45deg);
    font-size: 9px;
    line-height: 1;
    color: #ffffff;
}

.poi-viability-pin:hover {
    transform: rotate(45deg) scale(1.25);
}

/* Marcador de Cliente Vizinho (Mais Próximo na Viabilidade) */
.neighbor-client-pin {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #0ea5e9;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(14, 165, 233, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    color: #ffffff;
    transition: transform 0.12s ease;
}

.neighbor-client-pin:hover {
    transform: scale(1.3);
}

/* Barra de Decisão de Viabilidade no Modal de Fresnel */
.viability-decision-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    background: #f5f3ff;
    border: 1px solid #c4b5fd;
    color: #4c1d95;
    font-size: 12.5px;
    flex-wrap: wrap;
}

.viability-decision-bar.is-saved {
    background: #ecfdf5;
    border-color: #6ee7b7;
    color: #065f46;
}

.viab-decision-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.poi-badge-lg {
    background: #7c3aed;
    color: #ffffff;
    font-size: 10.5px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.03em;
}

.viab-decision-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-save-poi {
    background: #7c3aed;
    color: #ffffff;
    border: none;
    padding: 7px 13px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.btn-save-poi:hover {
    background: #6d28d9;
}

.btn-discard-poi {
    background: #ffffff;
    color: #dc2626;
    border: 1px solid #fca5a5;
    padding: 7px 12px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.btn-discard-poi:hover {
    background: #fef2f2;
}

.btn-whatsapp {
    background: #16a34a;
    border: 1px solid #16a34a;
    color: #ffffff;
    padding: 9px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.btn-whatsapp:hover {
    background: #15803d;
}

.ap-poi-tag {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    background: #f5f3ff;
    color: #6d28d9;
    border: 1px solid #c4b5fd;
}

.ap-fiber-tag {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #6ee7b7;
}

.badge-pill.fiber-pill {
    background: #ecfdf5;
    color: #047857;
    border-color: #6ee7b7;
}

.fiber-info-banner {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 10px;
    padding: 10px 14px;
    color: #065f46;
    font-size: 12.5px;
    line-height: 1.45;
}

.fiber-info-banner strong {
    display: block;
    font-size: 13px;
    margin-bottom: 3px;
    color: #064e3b;
}

.fiber-info-banner p {
    margin: 0;
    color: #047857;
}

.fiber-actions-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.btn-fiber {
    background: #059669 !important;
    border-color: #059669 !important;
    color: #ffffff !important;
}

.btn-fiber:hover {
    background: #047857 !important;
    border-color: #047857 !important;
}

.btn-danger-outline {
    border-color: #fca5a5 !important;
    color: #dc2626 !important;
    background: #ffffff !important;
}

.btn-danger-outline:hover {
    background: #fef2f2 !important;
}

.cto-row-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    transition: all 0.15s ease;
}

.cto-row-card:hover {
    border-color: #6ee7b7;
    background: #f0fdf4;
}

.cto-row-card.saved {
    border-color: #34d399;
    background: #f0fdf4;
}

.cto-row-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1;
}

.cto-row-title {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
}

.cto-row-sub {
    font-size: 11.5px;
    color: #64748b;
}

.cto-row-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* Marcador de CTO no Mapa (Caixinha quadrada preta maior que o ícone do cliente) */
.cto-map-pin {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
}

.cto-map-label {
    position: absolute;
    bottom: 28px;
    background: rgba(15, 23, 42, 0.94);
    color: #ffffff;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9.5px;
    font-weight: 700;
    padding: 1.5px 6px;
    border-radius: 4px;
    white-space: nowrap;
    border: 1px solid #475569;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
    pointer-events: none;
}

.cto-map-box {
    position: relative;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: #111827;
    border: 2px solid #ffffff;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cto-map-pin:hover .cto-map-box {
    transform: scale(1.16);
    border-color: #38bdf8;
}

/* Abas de modo na tela de Consultar Viabilidade */
.viab-mode-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.viab-tab-btn {
    border: none;
    background: transparent;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
    padding: 8px 10px;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.viab-tab-btn.active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.fiber-study-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-shrink: 0;
}

/* =========================================================
   JANELA DE VIABILIDADE EM 2 ETAPAS LIMPAS E RESPONSIVAS
   ========================================================= */
.popup-window.viability-window {
    width: min(640px, 95vw);
    max-width: 640px;
    max-height: 92vh;
}

.viability-body-single {
    display: flex;
    flex-direction: column;
    padding: 18px 20px;
    overflow-y: auto;
    max-height: calc(92vh - 76px);
    background: #f8fafc;
}

.viab-step-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
}

.viab-step-panel.hidden {
    display: none !important;
}

.viab-step-panel .form-row-2 {
    align-items: end;
}

.viab-client-coords-actions {
    justify-content: flex-start;
    gap: 10px;
}

.viab-step1-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 2px;
}

.viab-step2-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    padding: 8px 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.viab-client-summary-chip {
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    padding: 5px 10px;
    border-radius: 999px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.viab-ap-coords-bar {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: center;
}

.viab-ap-coords-bar .reuse-select {
    width: 100% !important;
    min-width: 0;
}

.viab-inline-check-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    min-height: 38px;
}

.viab-check-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    font-size: 12.5px;
    color: var(--text-dark);
    cursor: pointer;
}

.viab-save-cto-box {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    margin-top: 2px;
}

.viab-save-cto-box.already-saved {
    background: #f0fdf4;
    border-color: #86efac;
    color: #15803d;
}

.btn-block-responsive {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 11px 16px;
    font-size: 13px;
    line-height: 1.35;
}

@media (max-width: 640px) {
    .viability-body-single {
        padding: 14px;
    }

    .viab-step-panel .form-row-2 {
        grid-template-columns: 1fr;
    }

    .viab-mode-tabs {
        grid-template-columns: 1fr;
    }

    .viab-ap-coords-bar {
        grid-template-columns: 1fr;
    }

    .viab-step2-topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .viab-client-summary-chip {
        text-align: center;
    }
}

/* =========================================================================
   NOVA JANELA EM 2 ETAPAS: CONSULTAR POR PONTO DE ACESSO & SELEÇÃO DE APS
   ========================================================================= */
.popup-window.ap-modal-window {
    width: min(940px, 96vw);
    max-width: 940px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.ap-step {
    display: none;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    padding: 16px 24px 20px 24px;
    overflow-y: auto;
}

.ap-step.active {
    display: flex !important;
}

.ap-selection-header-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.ap-selection-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.ap-filter-pills {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-pill {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    padding: 4px 11px;
    font-size: 11.5px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.filter-pill:hover {
    border-color: #94a3b8;
    background: #e2e8f0;
}

.filter-pill.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

.filter-pill.active span {
    background: rgba(255, 255, 255, 0.28);
    color: #ffffff;
}

.filter-pill span {
    background: #e2e8f0;
    border-radius: 10px;
    padding: 1px 6px;
    font-size: 10.5px;
}

.ap-batch-select-btns {
    display: flex;
    gap: 6px;
}

.ap-popup-list.ap-full-list {
    min-height: 300px;
    max-height: 390px;
}

.ap-item-check-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 6px;
    flex-shrink: 0;
}

.ap-item-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

.ap-step1-bottom-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
    margin-top: 10px;
    flex-wrap: wrap;
}

.ap-selected-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-link-sm {
    background: none;
    border: none;
    color: #2563eb;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    padding: 4px;
}

.btn-link-sm:hover {
    color: #1d4ed8;
}

/* ETAPA 2: CONFIGURAÇÃO DOS APS */
.ap-step2-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}

.smart-location-box {
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 14px;
    padding: 13px 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.smart-location-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 11px;
}

.smart-location-icon {
    font-size: 20px;
    line-height: 1;
}

.smart-location-title-wrap strong {
    font-size: 13.5px;
    color: #0f172a;
    display: block;
}

.smart-location-title-wrap p {
    font-size: 12px;
    color: #64748b;
    margin: 2px 0 0 0;
}

.smart-location-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 10px;
    width: 100%;
}

.btn-smart-choice {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 11px;
    border-radius: 9px;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    cursor: pointer;
    text-align: left;
    transition: all 0.18s ease;
    min-width: 0;
    overflow: hidden;
}

.btn-smart-choice:hover {
    border-color: #3b82f6;
    background: #eff6ff;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.12);
}

.btn-smart-choice.is-suggested {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    box-shadow: 0 3px 8px rgba(59, 130, 246, 0.15);
}

.btn-smart-choice .choice-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.btn-smart-choice .choice-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.btn-smart-choice .choice-main-title {
    font-size: 12px;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-smart-choice.is-suggested .choice-main-title {
    color: #1d4ed8;
}

.btn-smart-choice .choice-sub {
    font-size: 10px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.smart-subdrawer {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed #cbd5e1;
}

.smart-subdrawer-inner label {
    font-size: 11.5px;
    font-weight: 600;
    color: #334155;
    display: block;
    margin-bottom: 6px;
}

.subdrawer-action-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.batch-height-toolbar {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.batch-height-field {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: #334155;
    flex-wrap: wrap;
}

.batch-height-input {
    width: 75px;
    padding: 5px 8px;
    font-size: 13px;
    text-align: center;
    font-weight: 700;
}

.selected-aps-cards-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 2px;
    margin-bottom: 12px;
}

.selected-ap-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    transition: border-color 0.15s ease;
}

.selected-ap-card:hover {
    border-color: #94a3b8;
}

.selected-ap-card.saved {
    border-left: 4px solid #10b981;
}

.selected-ap-card.suggested {
    border-left: 4px solid #3b82f6;
}

.selected-ap-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.selected-ap-card-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
}

.selected-ap-card-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr 100px auto auto;
    gap: 8px;
    align-items: center;
}

.selected-ap-card-inputs .input-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.selected-ap-card-inputs .input-wrap label {
    font-size: 10.5px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
}

.selected-ap-card-inputs input {
    font-size: 12px;
    padding: 5px 8px;
}

.ap-step2-actions-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
    flex-wrap: wrap;
}

@media (max-width: 680px) {
    .selected-ap-card-inputs {
        grid-template-columns: 1fr 1fr;
    }
    .tower-suggestion-box {
        flex-direction: column;
        align-items: stretch;
    }
    .location-reuse-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Identificação visual de portas nos clientes da CTO */
.client-port-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #059669;
    color: #ffffff;
    font-size: 9px;
    font-weight: 800;
    padding: 1px 3.5px;
    border-radius: 4px;
    border: 1px solid #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    line-height: 1;
    white-space: nowrap;
    z-index: 5;
}

.cto-client-pin {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1.5px solid #059669;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    font-size: 11px;
}

/* ==========================================================================
   RESPONSIVIDADE COMPLETA MULTI-DISPOSITIVOS (CELULAR, TABLET, NOTEBOOK, DESKTOP)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. SMARTPHONES & TELAS COMPACTAS (Até 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    /* Menu Lateral como Drawer deslizante sobre o mapa */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(325px, 92vw);
        min-width: unset;
        height: 100vh;
        height: 100dvh;
        z-index: 2100;
        box-shadow: 4px 0 28px rgba(15, 23, 42, 0.3);
        transform: translateX(0);
        transition: transform 0.26s cubic-bezier(0.4, 0, 0.2, 1);
        margin-left: 0 !important;
    }

    .sidebar.collapsed {
        transform: translateX(-100%) !important;
    }

    .map-wrapper {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
    }

    /* Botão flutuante de abrir menu */
    .floating-menu-btn {
        top: 12px;
        left: 12px;
        padding: 8px 14px;
        font-size: 13px;
        min-height: 42px;
        border-radius: 10px;
        z-index: 1100;
        box-shadow: 0 4px 14px rgba(15, 23, 42, 0.2);
    }

    /* Controles do topo direito (Satélite e Filtros) */
    .map-top-right-controls {
        top: 12px;
        right: 12px;
        gap: 6px;
    }

    .map-layer-group {
        border-radius: 8px;
    }

    .layer-btn {
        padding: 6px 10px;
        font-size: 11px;
    }

    .map-tech-filter-group.vertical {
        flex-direction: row !important;
        width: auto !important;
        min-width: unset !important;
        gap: 3px !important;
        padding: 3px !important;
        border-radius: 8px !important;
        background: rgba(15, 23, 42, 0.90) !important;
        border: 1px solid rgba(255, 255, 255, 0.15) !important;
    }

    .tech-filter-btn {
        padding: 4px 8px !important;
        font-size: 10.5px !important;
        gap: 4px !important;
        border-radius: 6px !important;
    }

    .tech-filter-btn .tech-label {
        font-size: 10.5px !important;
    }

    /* Chip de AP ativo no mapa no celular: posicionado confortavelmente no rodapé para nunca colidir com os botões superiores */
    .active-ap-chip {
        top: auto !important;
        bottom: 16px !important;
        left: 10px !important;
        right: 10px !important;
        transform: none !important;
        max-width: calc(100vw - 20px) !important;
        width: auto !important;
        font-size: 12px;
        padding: 8px 12px;
        border-radius: 12px;
        display: flex !important;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        z-index: 1200;
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.28);
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(8px);
        border: 1px solid #cbd5e1;
    }

    .active-ap-chip .chip-main {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 11.5px;
        flex: 1;
        min-width: 0;
    }

    .fresnel-mini-legend {
        display: none !important;
    }

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

    .btn-chip-report {
        padding: 6px 10px;
        font-size: 11px;
        font-weight: 700;
        border-radius: 6px;
        flex-shrink: 0;
        white-space: nowrap;
    }

    .btn-chip-clear {
        padding: 6px 10px;
        font-size: 11px;
        font-weight: 700;
        border-radius: 6px;
        flex-shrink: 0;
        white-space: nowrap;
    }

    .btn-chip-clear {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
        font-size: 15px !important;
        font-weight: 800 !important;
        border-radius: 8px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: #fee2e2 !important;
        color: #dc2626 !important;
        border: 1px solid #fca5a5 !important;
        cursor: pointer !important;
        flex-shrink: 0 !important;
        padding: 0 !important;
        line-height: 1 !important;
    }

    /* Barra flutuante de trajeto de fibra óptica */
    .fiber-route-bar {
        top: auto;
        bottom: 12px;
        left: 8px;
        right: 8px;
        transform: none;
        max-width: calc(100vw - 16px);
        flex-direction: column;
        align-items: stretch;
        padding: 10px 12px;
        border-radius: 14px;
        gap: 8px;
    }

    .fiber-route-pill-info {
        justify-content: space-between;
        font-size: 11.5px;
        flex-wrap: wrap;
        gap: 6px;
    }

    .fiber-route-pill-actions {
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.15);
        padding-left: 0;
        padding-top: 8px;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 6px;
    }

    .fiber-bar-hint {
        display: none !important;
    }

    /* Banner de clique no mapa para captura de coordenadas */
    .map-pick-banner {
        top: 12px;
        left: 10px;
        right: 10px;
        transform: none;
        max-width: calc(100vw - 20px);
        font-size: 11.5px;
        padding: 8px 12px;
        justify-content: space-between;
        gap: 8px;
    }

    /* Popups e Janelas Modais */
    .popup-backdrop {
        padding: 8px;
        align-items: flex-end; /* Abre encostado embaixo como bottom-sheet no celular */
    }

    .popup-window,
    .popup-window.viability-window,
    .popup-window.fresnel-window {
        width: 100% !important;
        max-width: 100vw !important;
        max-height: 94vh !important;
        max-height: 94dvh !important;
        border-radius: 16px 16px 10px 10px !important;
    }

    .clean-viab-summary-card {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        padding: 12px !important;
    }

    .clean-viab-col {
        min-height: 80px !important;
        padding: 8px 10px !important;
    }

    .clean-big-value {
        font-size: 22px !important;
    }

    .clean-sim-bar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
    }

    .clean-sim-item {
        justify-content: space-between !important;
    }

    .clean-sim-clearance {
        border-left: none !important;
        border-top: 1px dashed #cbd5e1 !important;
        padding-left: 0 !important;
        padding-top: 6px !important;
    }

    .clean-actions-row {
        flex-direction: column !important;
        width: 100% !important;
    }

    .btn-clean-action {
        width: 100% !important;
        justify-content: center !important;
    }

    .popup-header {
        padding: 12px 14px;
        gap: 8px;
    }

    .popup-header h2 {
        font-size: 15px;
    }

    .popup-header p {
        font-size: 11.5px;
    }

    .popup-body-grid {
        grid-template-columns: 1fr !important;
        overflow-y: auto !important;
        max-height: calc(94dvh - 130px);
    }

    .popup-col {
        padding: 12px 14px;
        gap: 10px;
    }

    .popup-col.form-col {
        border-left: none;
        border-top: 1px solid #e2e8f0;
        background: #ffffff;
    }

    /* Quebras de linhas em formulários */
    .form-row-2,
    .form-row-3,
    .form-row-coords,
    .popup-form-row {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }

    .pick-coords-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .smart-location-buttons {
        grid-template-columns: 1fr !important;
    }

    .btn-smart-choice {
        padding: 9px 12px;
    }

    .subdrawer-action-row {
        flex-direction: column;
        align-items: stretch;
    }

    .batch-height-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .selected-ap-card-inputs {
        grid-template-columns: 1fr 1fr !important;
        gap: 6px !important;
    }

    .ap-step1-bottom-bar,
    .ap-step2-actions-footer,
    .popup-footer,
    .viab-step-actions,
    .config-footer {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 8px;
    }

    .popup-footer .btn-primary,
    .popup-footer .btn-secondary,
    .viab-step-actions button,
    .ap-step2-actions-footer button,
    .config-footer button {
        width: 100%;
        min-height: 42px;
        justify-content: center;
        display: flex;
        align-items: center;
        font-size: 13.5px;
    }

    /* Ajuste para inputs em telas de toque (evita zoom indesejado no iOS) */
    .clean-input,
    .input-field {
        font-size: 15px !important;
    }

    /* Abas de viabilidade e resultados */
    .viab-tabs-header {
        display: flex;
        gap: 6px;
    }

    .viab-tab-btn {
        flex: 1;
        padding: 8px 6px;
        font-size: 11.5px;
        text-align: center;
        justify-content: center;
    }

    .viab-results-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    /* Gráfico de Fresnel */
    .fresnel-export-bar {
        grid-template-columns: 1fr !important;
        gap: 8px;
    }

    .fresnel-controls-grid {
        grid-template-columns: 1fr !important;
        gap: 8px;
    }

    /* Leaflet popup mais compacto */
    .leaflet-popup-content-wrapper {
        border-radius: 10px;
    }

    .client-popup {
        min-width: 210px;
        max-width: 270px;
        font-size: 11.5px;
    }
}

/* --------------------------------------------------------------------------
   2. SMARTPHONES PEQUENOS (Até 480px)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
    .sidebar {
        width: min(320px, 92vw);
    }

    .sidebar-top {
        padding: 14px 14px 10px;
    }

    .sidebar-menu {
        padding: 10px 8px;
        gap: 6px;
    }

    .menu-item-btn {
        padding: 10px 12px;
        font-size: 12.5px;
    }

    .menu-subitem-btn {
        padding: 7px 8px 7px 12px;
        font-size: 12px;
        gap: 7px;
    }

    .selected-ap-card-inputs {
        grid-template-columns: 1fr !important;
    }

    .map-top-right-controls {
        top: 8px;
        right: 8px;
    }

    .floating-menu-btn {
        top: 8px;
        left: 8px;
    }

    .active-ap-chip {
        top: auto !important;
        bottom: 14px !important;
        left: 8px !important;
        right: 8px !important;
    }
}

/* --------------------------------------------------------------------------
   3. TABLETS (769px a 1024px)
   -------------------------------------------------------------------------- */
@media (min-width: 769px) and (max-width: 1024px) {
    :root {
        --sidebar-width: 285px;
    }

    .popup-window {
        max-width: 90vw;
        max-height: 90vh;
    }

    .popup-body-grid {
        grid-template-columns: 1fr 1fr;
    }

    .smart-location-buttons {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }

    .selected-ap-card-inputs {
        grid-template-columns: 1fr 1fr 90px auto auto;
    }

    .form-row-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --------------------------------------------------------------------------
   4. NOTEBOOKS & TELAS MÉDIAS (1025px a 1366px)
   -------------------------------------------------------------------------- */
@media (min-width: 1025px) and (max-width: 1366px) {
    :root {
        --sidebar-width: 290px;
    }

    .popup-window {
        max-width: 960px;
        max-height: 86vh;
    }

    .popup-body-grid {
        grid-template-columns: 1fr 1.15fr;
    }
}

/* --------------------------------------------------------------------------
   5. DESKTOPS AMPLOS & WIDESCREEN (Acima de 1366px)
   -------------------------------------------------------------------------- */
@media (min-width: 1367px) {
    :root {
        --sidebar-width: 300px;
    }

    .popup-window {
        max-width: 1040px;
        max-height: 88vh;
    }
}

/* ==========================================================================
   TELA DE LOGIN MODERNA & ELEGANTE: E-LINK MAPAS (TEMA CLARO OFICIAL)
   ========================================================================== */
.login-screen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #F6F6F7 0%, #FFFFFF 50%, #ECEFF4 100%);
    background-attachment: fixed;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overflow-y: auto;
}

.login-screen-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.login-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    box-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.08), 0 0 25px rgba(207, 14, 14, 0.04);
    width: 100%;
    max-width: 420px;
    padding: 32px 28px 26px;
    box-sizing: border-box;
    animation: loginCardFadeIn 0.35s ease-out;
    position: relative;
}

@keyframes loginCardFadeIn {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-brand {
    text-align: center;
    margin-bottom: 24px;
}

.login-logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70px;
    margin-bottom: 10px;
}

.login-brand-img {
    max-height: 76px;
    max-width: 210px;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.login-brand-img:hover {
    transform: scale(1.02);
}

.login-logo-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 14px;
}

.btn-upload-logo {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 600;
    color: #475569;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    padding: 4px 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-upload-logo:hover {
    background: #e2e8f0;
    color: #0f172a;
    border-color: #94a3b8;
}

.btn-reset-logo {
    display: inline-flex;
    align-items: center;
    font-size: 11.5px;
    font-weight: 600;
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 999px;
    padding: 4px 10px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-reset-logo:hover {
    background: #fee2e2;
    color: #991b1b;
}

.login-title {
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: 0.5px;
    margin: 0 0 4px;
}

.login-subtitle {
    font-size: 13px;
    color: #64748b;
    margin: 0;
    font-weight: 500;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.login-label {
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    letter-spacing: 0.4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.login-input {
    width: 100%;
    box-sizing: border-box;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 16px; /* 16px impede o zoom indesejado no iOS Safari */
    color: #0f172a;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
}

.login-input:focus {
    border-color: #cf0e0e;
    box-shadow: 0 0 0 3px rgba(207, 14, 14, 0.15);
    background: #ffffff;
}

.login-input::placeholder {
    color: #94a3b8;
    font-size: 14px;
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper .login-input {
    padding-right: 44px;
}

.btn-pwd-eye {
    position: absolute;
    right: 10px;
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 17px;
    padding: 6px;
    border-radius: 6px;
    transition: color 0.15s ease;
}

.btn-pwd-eye:hover {
    color: #0f172a;
}

.btn-login-submit {
    background: linear-gradient(135deg, #cf0e0e 0%, #ad0d0d 100%);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 13px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 20px -4px rgba(207, 14, 14, 0.35);
    transition: all 0.2s ease;
    margin-top: 6px;
}

.btn-login-submit:hover {
    background: linear-gradient(135deg, #e01414 0%, #cf0e0e 100%);
    transform: translateY(-1px);
    box-shadow: 0 10px 24px -4px rgba(207, 14, 14, 0.45);
}

.btn-login-submit:active {
    transform: translateY(0);
}

.btn-login-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.login-alert {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-alert.hidden {
    display: none;
}

/* Sidebar Logo Img */
.sidebar-logo-img {
    height: 38px;
    max-width: 170px;
    object-fit: contain;
    vertical-align: middle;
}

/* Responsividade Mobile & Tablet */
@media (max-width: 768px) {
    .login-screen-overlay {
        padding: 14px;
        align-items: center;
    }
    .login-card {
        padding: 26px 20px 22px;
        border-radius: 16px;
        max-width: 100%;
        box-shadow: 0 12px 30px -8px rgba(15, 23, 42, 0.1);
    }
    .login-brand {
        margin-bottom: 20px;
    }
    .login-brand-img {
        max-height: 60px;
        max-width: 180px;
    }
    .login-title {
        font-size: 22px;
    }
    .login-subtitle {
        font-size: 12px;
    }
    .login-input {
        padding: 11px 13px;
        font-size: 16px;
    }
    .btn-login-submit {
        padding: 13px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .login-screen-overlay {
        padding: 10px;
    }
    .login-card {
        padding: 22px 16px 18px;
    }
    .login-brand-img {
        max-height: 52px;
        max-width: 160px;
    }
    .login-title {
        font-size: 20px;
    }
}

/* ==========================================================================
   CARD DO USUÁRIO LOGADO NO MENU LATERAL (SIDEBAR)
   ========================================================================== */
.sidebar-user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    margin: 6px 12px 10px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.user-avatar {
    width: 34px;
    height: 34px;
    background: #e2e8f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role-badge {
    font-size: 10.5px;
    font-weight: 700;
    color: #2563eb;
    background: #dbeafe;
    padding: 1px 6px;
    border-radius: 4px;
    display: inline-block;
    align-self: flex-start;
    margin-top: 2px;
    text-transform: uppercase;
}

.user-role-badge.viabilidade {
    color: #059669;
    background: #d1fae5;
}

.btn-sidebar-logout {
    background: transparent;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    color: #64748b;
    font-size: 11.5px;
    font-weight: 600;
    padding: 5px 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-sidebar-logout:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
}

/* Ocultar elementos para perfis restritos */
.role-hidden {
    display: none !important;
}

/* ==========================================================================
   ESTILOS PARA GESTÃO DE USUÁRIOS E PERFIS DE ACESSO
   ========================================================================== */
.crud-edit-box {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.crud-edit-box.hidden {
    display: none;
}

.crud-edit-box h3 {
    margin: 0 0 14px;
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 8px;
}

.modern-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.modern-table th {
    background: #f1f5f9;
    color: #475569;
    font-weight: 700;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 12px;
    border-bottom: 2px solid #e2e8f0;
}

.modern-table td {
    padding: 11px 12px;
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
    vertical-align: middle;
}

.modern-table tr:hover td {
    background: #f8fafc;
}

.badge-role {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 700;
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

.badge-role.admin {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #93c5fd;
}

.badge-role.viab {
    background: #ecfdf5;
    color: #047857;
    border-color: #a7f3d0;
}

.badge-status-active {
    background: #dcfce7;
    color: #15803d;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
}

.badge-status-inactive {
    background: #fee2e2;
    color: #b91c1c;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
}

.btn-table-action {
    background: transparent;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-table-action:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.btn-table-action.delete:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
}

/* ==========================================================================
   MATRIZ DE PERMISSÕES SIM / NÃO
   ========================================================================== */
.permissions-matrix-container {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    margin-top: 14px;
}

.matrix-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 10px;
}

.matrix-header h4 {
    margin: 0;
    font-size: 13.5px;
    font-weight: 700;
    color: #1e293b;
}

.matrix-quick-actions {
    display: flex;
    gap: 8px;
}

.permissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.perm-category-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.perm-cat-title {
    font-size: 12.5px;
    font-weight: 800;
    color: #334155;
    border-bottom: 1px solid #cbd5e1;
    padding-bottom: 6px;
    margin-bottom: 4px;
}

.perm-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12.5px;
    color: #475569;
    cursor: pointer;
    padding: 5px 6px;
    border-radius: 6px;
    transition: background 0.15s ease;
    user-select: none;
}

.perm-toggle-row:hover {
    background: #e2e8f0;
}

.perm-toggle-row input[type="checkbox"] {
    display: none;
}

/* Switch Toggle Visual SIM / NÃO */
.toggle-pill {
    position: relative;
    width: 48px;
    height: 24px;
    background: #cbd5e1;
    border-radius: 12px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.toggle-pill::before {
    content: 'NÃO';
    position: absolute;
    right: 5px;
    top: 5px;
    font-size: 9px;
    font-weight: 800;
    color: #64748b;
    line-height: 14px;
}

.toggle-pill::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    top: 3px;
    left: 3px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

.perm-toggle-row input[type="checkbox"]:checked + .toggle-pill {
    background: #10b981;
}

.perm-toggle-row input[type="checkbox"]:checked + .toggle-pill::before {
    content: 'SIM';
    left: 7px;
    right: auto;
    color: #ffffff;
}

.perm-toggle-row input[type="checkbox"]:checked + .toggle-pill::after {
    left: 27px;
}

/* =========================================================================
   SISTEMA DE NOTIFICAÇÕES TOAST (GLOBAL & DISCRETO)
   ========================================================================= */

.app-toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: 420px;
    width: calc(100vw - 48px);
}

.app-toast {
    pointer-events: auto;
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55), 0 0 16px rgba(2, 132, 199, 0.2);
    color: #f8fafc;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateY(0);
    opacity: 1;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(-16px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.app-toast.fade-out {
    opacity: 0;
    transform: translateY(-12px) scale(0.95);
}

.app-toast.success {
    border-color: rgba(16, 185, 129, 0.6);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(6, 78, 59, 0.92));
}

.app-toast.info {
    border-color: rgba(56, 189, 248, 0.6);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(12, 74, 110, 0.92));
}

.app-toast.warning {
    border-color: rgba(245, 158, 11, 0.6);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(120, 53, 15, 0.92));
}

.app-toast.error {
    border-color: rgba(239, 68, 68, 0.6);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(127, 29, 29, 0.92));
}

.app-toast-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.app-toast-message {
    flex: 1;
}

.app-toast-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 15px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    border-radius: 4px;
    transition: color 0.15s;
}

.app-toast-close:hover {
    color: #ffffff;
}

@media (max-width: 640px) {
    .app-toast-container {
        top: 12px;
        right: 8px;
        left: 8px;
        width: calc(100vw - 16px);
        max-width: calc(100vw - 16px);
    }
}

/* =========================================================================
   MODAL: LOCALIZAR CLIENTE & ROTA DE ATENDIMENTO
   ========================================================================= */
.locate-client-window {
    width: min(680px, 95vw);
    max-width: 680px;
    max-height: 90vh;
}

.locate-client-body {
    display: flex;
    flex-direction: column;
    padding: 16px 20px 20px;
    background: #f8fafc;
    overflow-y: hidden;
    max-height: calc(90vh - 78px);
}

.locate-search-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.locate-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.locate-search-icon {
    position: absolute;
    left: 14px;
    font-size: 16px;
    color: #64748b;
    pointer-events: none;
}

.locate-search-input {
    width: 100%;
    padding: 12px 42px 12px 42px !important;
    font-size: 14px !important;
    background: #ffffff !important;
    border: 2px solid #cbd5e1 !important;
    border-radius: 10px !important;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
}

.locate-search-input:focus {
    border-color: #0284c7 !important;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.18) !important;
    outline: none;
}

.locate-clear-input {
    position: absolute;
    right: 12px;
    background: #e2e8f0;
    border: none;
    color: #475569;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.locate-clear-input:hover {
    background: #cbd5e1;
    color: #0f172a;
}

.locate-results-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11.5px;
    color: #64748b;
    padding: 0 2px;
}

.locate-badge-total {
    background: #e0f2fe;
    color: #0369a1;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10.5px;
}

.locate-clients-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    max-height: 440px;
    min-height: 180px;
    padding-right: 4px;
}

.locate-client-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.18s ease;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.locate-client-card:hover {
    border-color: #38bdf8;
    background: #f0f9ff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.1);
}

.locate-client-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 0;
}

.locate-client-name {
    font-size: 13.5px;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.locate-client-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    color: #64748b;
    flex-wrap: wrap;
}

.locate-client-meta code {
    background: #f1f5f9;
    padding: 1px 6px;
    border-radius: 4px;
    color: #0369a1;
    font-weight: 600;
    font-size: 11px;
}

.locate-client-address {
    font-size: 11.5px;
    color: #475569;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.badge-tech-mini {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10.5px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 999px;
}

.badge-tech-mini.radio {
    background: #e0f2fe;
    color: #0284c7;
    border: 1px solid #bae6fd;
}

.badge-tech-mini.fiber {
    background: #dcfce7;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.btn-locate-action {
    background: #0284c7;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.btn-locate-action:hover {
    background: #0369a1;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}

/* =========================================================================
   HUD FLUTUANTE DE DESLOCAMENTO & ROTA DO CLIENTE NO MAPA
   ========================================================================= */
.client-route-hud {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: min(560px, calc(100vw - 28px));
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 16px;
    padding: 14px 18px;
    z-index: 1250;
    box-shadow: 0 12px 36px rgba(15, 23, 42, 0.38);
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: auto;
    color: #ffffff;
    animation: slideUpHud 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.client-route-hud.hidden {
    display: none !important;
}

@keyframes slideUpHud {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.route-hud-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    padding-bottom: 10px;
}

.route-hud-title-box {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 0;
}

.route-hud-badge {
    align-self: flex-start;
    background: #0284c7;
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.5px;
    padding: 2px 7px;
    border-radius: 4px;
}

.route-hud-client-name {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.route-hud-client-meta {
    font-size: 11.5px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 6px;
}

.route-hud-client-meta code {
    background: rgba(255, 255, 255, 0.1);
    color: #38bdf8;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 11px;
}

.route-hud-address {
    font-size: 11.5px;
    color: #cbd5e1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-route-hud-close {
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: #cbd5e1;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.btn-route-hud-close:hover {
    background: #ef4444;
    color: #ffffff;
}

.route-hud-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 10px;
    padding: 8px 12px;
}

.route-metric-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.route-metric-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
}

.route-metric-val {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
}

.route-metric-val.timer {
    color: #38bdf8;
    font-family: 'JetBrains Mono', monospace;
}

.route-metric-val.timer.running {
    color: #4ade80;
    animation: timerPulse 1.5s infinite;
}

@keyframes timerPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.route-hud-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-route-action {
    flex: 1;
    min-width: 130px;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid transparent;
    transition: all 0.15s ease;
}

.btn-route-action.primary {
    background: #0284c7;
    color: #ffffff;
}

.btn-route-action.primary:hover {
    background: #0369a1;
}

.btn-route-action.success {
    background: #16a34a;
    color: #ffffff;
}

.btn-route-action.success:hover {
    background: #15803d;
}

.btn-route-action.external.gmaps {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-route-action.external.gmaps:hover {
    background: #4285F4;
    border-color: #4285F4;
}

.btn-route-action.external.waze {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-route-action.external.waze:hover {
    background: #33ccff;
    color: #000;
    border-color: #33ccff;
}

/* Marcador Pulsante do Cliente Destino no Mapa */
.destination-client-pin {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #ef4444;
    border: 3px solid #ffffff;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
}

.destination-pulse-ring {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid #ef4444;
    top: -11px;
    left: -11px;
    animation: destPulse 1.8s infinite cubic-bezier(0.2, 0.8, 0.2, 1);
    pointer-events: none;
}

@keyframes destPulse {
    0% {
        transform: scale(0.6);
        opacity: 0.9;
    }
    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

@media (max-width: 640px) {
    .client-route-hud {
        bottom: 12px;
        width: calc(100vw - 16px);
        padding: 12px 14px;
        border-radius: 14px;
    }

    .route-hud-metrics {
        grid-template-columns: 1fr 1fr 1fr;
        padding: 6px 10px;
    }

    .btn-route-action {
        min-width: calc(50% - 4px);
        padding: 8px 10px;
        font-size: 11.5px;
    }
}

/* ==========================================================================
   11. MODO OFFLINE, MONITORAMENTO DE EQUIPE (GPS) & INSTALAÇÃO PWA/APK
   ========================================================================== */

/* Indicador Flutuante de Modo Online / Offline */
.network-status-chip {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: #f59e0b;
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4);
    letter-spacing: 0.3px;
    pointer-events: auto;
    transition: all 0.25s ease;
}

.network-status-chip.online {
    background: #10b981;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
}

.network-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ffffff;
    animation: netPulse 1.4s infinite alternate ease-in-out;
}

@keyframes netPulse {
    from { opacity: 0.4; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1.2); }
}

/* Modal Bloqueador de GPS Obrigatório */
.gps-mandatory-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.gps-mandatory-card {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 32px 28px;
    max-width: 440px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.gps-card-icon {
    font-size: 54px;
    line-height: 1;
    margin-bottom: 16px;
    display: inline-block;
    animation: gpsBounce 1.5s infinite alternate ease-in-out;
}

@keyframes gpsBounce {
    from { transform: translateY(0); }
    to { transform: translateY(-8px); }
}

.gps-card-title {
    font-size: 22px;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 12px;
}

.gps-card-desc {
    font-size: 13.5px;
    color: #94a3b8;
    line-height: 1.55;
    margin: 0 0 20px;
}

.gps-card-steps {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px 16px;
    text-align: left;
    margin-bottom: 24px;
}

.gps-card-steps .step-item {
    font-size: 12.5px;
    color: #cbd5e1;
    margin-bottom: 6px;
}

.gps-card-steps .step-item:last-child {
    margin-bottom: 0;
}

.btn-gps-authorize {
    width: 100%;
    padding: 14px 20px;
    background: #10b981;
    color: #ffffff;
    font-size: 14.5px;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    transition: all 0.2s ease;
}

.btn-gps-authorize:hover {
    background: #059669;
    transform: translateY(-1px);
}

.gps-error-msg {
    margin-top: 14px;
    font-size: 12px;
    color: #f87171;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 8px;
    padding: 8px 12px;
}

/* Modal de Monitoramento de Equipe em Tempo Real (Radar) */
.team-tracking-window {
    max-width: 820px;
    width: 95%;
}

.btn-refresh-pill {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn-refresh-pill:hover {
    background: rgba(255, 255, 255, 0.15);
}

.team-tracking-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.team-tracking-toolbar .search-box-wrap {
    flex: 1;
    min-width: 240px;
}

.team-summary-chips {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chip-metric {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
}

.chip-metric.online {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.team-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
    max-height: 420px;
    overflow-y: auto;
    padding-right: 4px;
}

.team-card {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.2s ease;
}

.team-card:hover {
    border-color: #38bdf8;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.team-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.team-card-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.team-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #0284c7;
    color: #fff;
    font-weight: 800;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.team-name {
    font-size: 13.5px;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0;
}

.team-role {
    font-size: 11.5px;
    color: #94a3b8;
    margin: 0;
}

.team-battery {
    font-size: 12px;
    font-weight: 700;
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    padding: 2px 8px;
    border-radius: 6px;
}

.team-battery.low {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.team-card-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: #94a3b8;
}

.team-card-body strong {
    color: #e2e8f0;
}

.team-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-center-tecnico {
    width: 100%;
    padding: 7px 12px;
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-center-tecnico:hover {
    background: #38bdf8;
    color: #0f172a;
}

/* Marcador de Técnico no Mapa (Estilo com Bonequinho e Raio Azul Pulsante ao Redor) */
.custom-tech-pin-wrapper {
    background: transparent !important;
    border: none !important;
    overflow: visible !important;
}

.tech-tracker-pin {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0284c7, #0369a1);
    border: 3.5px solid #ffffff;
    box-shadow: 0 4px 16px rgba(2, 132, 199, 0.65), 0 0 0 2px rgba(2, 132, 199, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 25px;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
    user-select: none;
}

.tech-tracker-pin:hover {
    transform: scale(1.15);
    z-index: 5000 !important;
}

/* Raio Azul Pulsante ao Redor (Radar) */
.tech-tracker-pulse {
    position: absolute;
    width: 82px;
    height: 82px;
    border-radius: 50%;
    border: 3px solid #38bdf8;
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.85), inset 0 0 10px rgba(56, 189, 248, 0.35);
    top: -20px;
    left: -20px;
    animation: techPulseBlue 2s infinite cubic-bezier(0.2, 0.8, 0.2, 1);
    pointer-events: none;
}

@keyframes techPulseBlue {
    0% {
        transform: scale(0.55);
        opacity: 0.95;
    }
    60% {
        opacity: 0.45;
    }
    100% {
        transform: scale(1.55);
        opacity: 0;
    }
}

/* Técnico ONLINE: mantém o bonequinho e o raio azul pulsante brilhante */
.tech-tracker-pin.online {
    background: linear-gradient(135deg, #0284c7, #026cb0) !important;
    border-color: #ffffff !important;
    box-shadow: 0 4px 18px rgba(2, 132, 199, 0.75) !important;
}

/* Técnico OFFLINE: mantém o mesmo bonequinho azul, indicando última parada no crachá */
.tech-tracker-pin.offline {
    background: linear-gradient(135deg, #0284c7, #026cb0) !important;
    border-color: #fca5a5 !important;
    box-shadow: 0 4px 16px rgba(220, 38, 38, 0.45) !important;
}

.tech-tracker-pin.offline .tech-tracker-pulse {
    border-color: rgba(239, 68, 68, 0.6);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
    animation: techPulseOffline 2.5s infinite ease-out;
}

@keyframes techPulseOffline {
    0% { transform: scale(0.6); opacity: 0.8; }
    100% { transform: scale(1.35); opacity: 0; }
}

/* Etiqueta Flutuante com Nome do Técnico */
.tech-tracker-nametag {
    position: absolute;
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.95);
    color: #ffffff;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.2);
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.2px;
}

.tech-tracker-nametag.online {
    border-color: rgba(56, 189, 248, 0.6);
}

.tech-tracker-nametag.offline {
    border-color: rgba(239, 68, 68, 0.6);
    background: rgba(69, 10, 10, 0.95);
}

/* Card de Navegação Turn-by-Turn GPS em Tempo Real (Estilo Google Maps) */
.gps-nav-guidance-card {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1300;
    width: min(540px, calc(100vw - 24px));
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 12px 16px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #ffffff;
    pointer-events: auto;
    transition: all 0.25s ease;
}

.gps-nav-guidance-card.hidden {
    display: none !important;
}

.gps-maneuver-box {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.gps-maneuver-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #0284c7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.4);
}

.gps-maneuver-icon-wrap.arrive {
    background: #10b981;
}

.gps-maneuver-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.gps-maneuver-dist {
    font-size: 19px;
    font-weight: 800;
    color: #38bdf8;
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.gps-maneuver-street {
    font-size: 13.5px;
    font-weight: 600;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.gps-nav-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.btn-gps-nav-control {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #ffffff;
    border-radius: 10px;
    padding: 7px 11px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s ease;
}

.btn-gps-nav-control:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-gps-nav-control.active {
    background: #0284c7;
    border-color: #38bdf8;
}

.btn-gps-nav-control.muted {
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.05);
}

/* Modal de Instalação do Aplicativo (APK / PWA) */
.install-app-window {
    max-width: 520px;
    width: 95%;
}

.install-app-hero {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 20px;
}

.app-icon-preview {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.hero-text h3 {
    margin: 0 0 4px;
    font-size: 17px;
    color: #ffffff;
    font-weight: 800;
}

.hero-text p {
    margin: 0;
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.4;
}

.install-methods {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.method-card {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 16px;
}

.method-card h4 {
    margin: 0 0 8px;
    font-size: 14px;
    color: #ffffff;
    font-weight: 700;
}

.method-card p {
    margin: 0 0 12px;
    font-size: 12.5px;
    color: #94a3b8;
    line-height: 1.45;
}

.install-steps {
    margin: 0;
    padding-left: 20px;
    font-size: 12.5px;
    color: #cbd5e1;
    line-height: 1.6;
}

.highlight-radar {
    background: rgba(16, 185, 129, 0.1) !important;
    border: 1px solid rgba(16, 185, 129, 0.25) !important;
}

.highlight-radar:hover {
    background: rgba(16, 185, 129, 0.2) !important;
}


