:root { --side-bg: #0b1120; --main-bg: #f4f5f7; --accent: #00c389; --text-dark: #1e293b; --text-light: #94a3b8; }
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }
.login-page { display: flex; width: 100vw; height: 100vh; overflow: hidden; background: #fff; }
.login-left { flex: 1.25; background: var(--side-bg); color: #fff; display: flex; flex-direction: column; justify-content: center; padding: 0 8%; border-right: 3px solid var(--accent); }
.left-badge { color: var(--accent); font-weight: 800; font-size: 12px; letter-spacing: 2px; margin-bottom: 24px; text-transform: uppercase; }
.left-title { font-size: 56px; font-weight: 800; line-height: 1.05; margin-bottom: 24px; letter-spacing: -2px; }
.left-desc { font-size: 18px; color: #94a3b8; line-height: 1.6; max-width: 480px; }
.login-right { flex: 0.9; background: var(--main-bg); display: flex; align-items: center; justify-content: center; padding: 40px; }
.login-card { width: 100%; max-width: 400px; padding: 60px 45px; background: #fff; border-radius: 20px; box-shadow: 0 10px 40px rgba(0,0,0,0.03); text-align: center; }
.login-card h2 { color: var(--accent); font-size: 28px; font-weight: 800; margin-bottom: 6px; letter-spacing: -0.5px; }
.login-card .subtitle { color: #64748b; font-size: 13px; margin-bottom: 40px; font-weight: 500; }
.input-group { margin-bottom: 25px; text-align: left; }
.login-input { width: 100%; padding: 12px 0; border: none; border-bottom: 1px solid #e2e8f0; font-size: 14px; color: #333; outline: none; transition: 0.3s; background: transparent; }
.login-input::placeholder { color: #94a3b8; }
.login-input:focus { border-bottom-color: var(--accent); }
.btn-continue { width: 100%; background: var(--accent); color: #fff; border: none; padding: 16px; border-radius: 12px; font-weight: 700; font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; transition: 0.3s; margin-top: 10px; }
.btn-continue:hover { background: #00a875; transform: translateY(-1px); }
.footer-text { margin-top: 40px; font-size: 10px; color: #cbd5e1; text-transform: uppercase; font-weight: 800; letter-spacing: 0.5px; }

#chart-phys .apexcharts-yaxis text,
#chart-virt .apexcharts-yaxis text,
#chart-pppoe .apexcharts-yaxis text,
#chart-phys .apexcharts-yaxis-label,
#chart-virt .apexcharts-yaxis-label,
#chart-pppoe .apexcharts-yaxis-label {
    fill: #ffffff !important;
    opacity: 1 !important;
}

.maps-drawing {
    cursor: crosshair !important;
}

/* Prevent blank tile flicker: keep tile container opaque + dark background */
#fiber-map .leaflet-container,
#fiber-map {
    background: #0d1117 !important;
}
.leaflet-tile-container {
    will-change: transform;
}
.leaflet-tile {
    /* Fade tiles in instead of snapping — avoids hard-edge flash */
    transition: opacity 0.12s linear !important;
}

.maps-view-mode #fiber-map {
    cursor: grab;
}

.maps-edit-mode #fiber-map {
    box-shadow: inset 0 0 0 2px rgba(16, 185, 129, 0.28), 0 0 0 1px rgba(16, 185, 129, 0.12);
}

.maps-map-toolbar {
    max-width: calc(100% - 420px);
}

.maps-panel-hide-btn,
.maps-panel-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    color: #cbd5e1;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    transition: all 0.2s ease;
}

.maps-panel-hide-btn,
.maps-panel-chip-top,
.maps-panel-chip-bottom {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    color: #cbd5e1;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    transition: all 0.2s ease;
}

.maps-map-toolbar.hidden,
.maps-map-legend.hidden,
.maps-panel-chip.hidden,
.maps-panel-hide-btn.hidden {
    display: none !important;
}

.maps-panel-hide-btn {
    height: 38px;
    min-width: 38px;
    padding: 0 12px;
}

.maps-panel-chip {
    padding: 11px 14px;
    box-shadow: 0 14px 38px rgba(2, 6, 23, 0.32);
    backdrop-filter: blur(16px);
}

.maps-panel-chip-inline {
    margin-inline: auto;
    padding: 11px 14px;
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.12);
}

.maps-panel-chip-top,
.maps-panel-chip-bottom {
    position: absolute;
    right: 22px;
    z-index: 1003;
    padding: 11px 14px;
    box-shadow: 0 14px 38px rgba(2, 6, 23, 0.32);
    backdrop-filter: blur(16px);
}

.maps-panel-chip-top {
    top: 22px;
}

.maps-panel-chip-bottom {
    bottom: 22px;
}

.maps-panel-hide-btn:hover,
.maps-panel-chip:hover {
    background: rgba(16, 185, 129, 0.95);
    border-color: rgba(110, 231, 183, 0.42);
    color: #052e1f;
    box-shadow: 0 12px 34px rgba(16, 185, 129, 0.24);
}

.maps-toolbar-tool {
    background: rgba(15, 23, 42, 0.56);
    color: #cbd5e1;
    padding-inline: 12px;
}

.maps-map-footer {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 48px;
    width: 100%;
}

.maps-map-legend {
    margin-inline: auto;
    max-width: 100%;
}

.maps-editor-drawer:not(.hidden) {
    display: flex;
}

.maps-editor-body {
    scrollbar-color: rgba(148, 163, 184, 0.55) rgba(15, 23, 42, 0.45);
    scrollbar-width: thin;
}

.maps-editor-body::-webkit-scrollbar {
    width: 8px;
}

.maps-editor-body::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.45);
    border-radius: 999px;
}

.maps-editor-body::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.55);
    border-radius: 999px;
}

.maps-toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 14px;
    background: rgba(30, 41, 59, 0.55);
    color: #cbd5e1;
    min-height: 36px;
    padding: 8px 14px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    transition: background 0.18s, color 0.18s, border-color 0.18s, box-shadow 0.18s;
    justify-content: flex-start;
    cursor: pointer;
}
.maps-toolbar-btn i {
    font-size: 13px;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
    color: #64748b;
    transition: color 0.18s;
}
.maps-toolbar-btn:hover {
    background: rgba(51, 65, 85, 0.9);
    border-color: rgba(148, 163, 184, 0.32);
    color: #f1f5f9;
    box-shadow: 0 4px 16px rgba(2, 6, 23, 0.35);
}
.maps-toolbar-btn:hover i {
    color: #94a3b8;
}
.maps-toolbar-btn-active {
    background: rgba(16, 185, 129, 0.18);
    border-color: rgba(16, 185, 129, 0.4);
    color: #6ee7b7;
}
.maps-toolbar-btn-active i {
    color: #34d399;
}
.maps-toolbar-btn-active:hover {
    background: rgba(16, 185, 129, 0.28);
    border-color: rgba(16, 185, 129, 0.55);
    color: #a7f3d0;
    box-shadow: 0 4px 18px rgba(16, 185, 129, 0.2);
}
/* Divider between button groups */
.maps-toolbar-divider {
    height: 1px;
    background: rgba(148, 163, 184, 0.12);
    margin: 2px 0;
    border: none;
}
/* Utility/secondary buttons (refresh, satellite, fullscreen) */
.maps-toolbar-btn.is-secondary {
    background: rgba(15, 23, 42, 0.4);
    border-color: rgba(148, 163, 184, 0.14);
    color: #94a3b8;
    min-height: 33px;
    font-size: 9.5px;
}
.maps-toolbar-btn.is-secondary i {
    color: #64748b;
}
.maps-toolbar-btn.is-secondary:hover {
    background: rgba(30, 41, 59, 0.85);
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.28);
}
.maps-toolbar-btn.is-secondary:hover i {
    color: #94a3b8;
}

#maps-map-shell:fullscreen {
    background: #020617;
    padding: 18px;
}

#maps-map-shell:fullscreen #fiber-map {
    height: calc(100vh - 36px) !important;
    min-height: 0 !important;
}

#maps-map-shell:fullscreen .maps-overlay-panel {
    max-height: calc(100vh - 54px);
}

.leaflet-control-attribution {
    display: none !important;
}

.fiber-route-draft {
    pointer-events: none;
}

.fiber-route-point {
    filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.75));
    cursor: pointer;
}

.maps-endpoint-divicon {
    background: transparent;
    border: 0;
}

.maps-endpoint-marker {
    align-items: center;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    box-shadow: 0 8px 18px rgba(2, 6, 23, 0.34), 0 0 0 3px rgba(15, 23, 42, 0.16);
    color: #e2e8f0;
    display: flex;
    font-size: 12px;
    height: 30px;
    justify-content: center;
    opacity: 0.82;
    width: 30px;
}

.maps-icon-pop {
    background: rgba(132, 204, 22, 0.78);
    border-color: rgba(190, 242, 100, 0.35);
    color: #0f172a;
}

.maps-icon-switch {
    background: rgba(16, 185, 129, 0.68);
    color: #ecfdf5;
}

.maps-icon-router {
    background: rgba(14, 165, 233, 0.68);
    color: #eff6ff;
}

.maps-icon-olt {
    background: rgba(124, 58, 237, 0.68);
    color: #f5f3ff;
}

.maps-icon-radio {
    background: rgba(249, 115, 22, 0.68);
    color: #fff7ed;
}

.maps-icon-server {
    background: rgba(71, 85, 105, 0.72);
    color: #f8fafc;
}

.maps-endpoint-popup .leaflet-popup-content-wrapper,
.maps-endpoint-popup .leaflet-popup-tip {
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(52, 211, 153, 0.2);
    box-shadow: 0 18px 48px rgba(2, 6, 23, 0.42);
    color: #e2e8f0;
}

.maps-endpoint-popup .leaflet-popup-content {
    margin: 0;
}

.maps-endpoint-popup-card {
    min-width: 240px;
    padding: 14px;
}

.maps-endpoint-popup-card p {
    color: #34d399;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.18em;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.maps-endpoint-popup-card h3 {
    color: #f8fafc;
    font-size: 15px;
    font-weight: 900;
    margin-bottom: 12px;
}

.maps-endpoint-popup-card dl {
    display: grid;
    gap: 6px 10px;
    grid-template-columns: 70px 1fr;
}

.maps-endpoint-popup-card dt {
    color: #94a3b8;
    font-size: 11px;
    font-weight: 800;
}

.maps-endpoint-popup-card dd {
    color: #e2e8f0;
    font-size: 12px;
    font-weight: 900;
}

.maps-endpoint-route-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.maps-endpoint-route-row {
    border-top: 1px solid rgba(148, 163, 184, 0.16);
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 9px;
}

.maps-endpoint-route-row:first-child {
    border-top: 0;
    padding-top: 0;
}

.maps-endpoint-route-top {
    align-items: flex-start;
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.maps-endpoint-route-top strong {
    color: #f8fafc;
    display: block;
    font-size: 12px;
    font-weight: 950;
    letter-spacing: 0.02em;
    line-height: 1.25;
}

.maps-endpoint-route-top em {
    border-radius: 999px;
    flex: 0 0 auto;
    font-size: 8px;
    font-style: normal;
    font-weight: 950;
    letter-spacing: 0.08em;
    padding: 3px 6px;
    text-transform: uppercase;
}

.maps-endpoint-route-meta,
.maps-endpoint-route-cable {
    color: #cbd5e1;
    display: block;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.3;
}

.maps-endpoint-route-cable {
    color: #7dd3fc;
}

.maps-endpoint-status-up {
    background: rgba(16, 185, 129, 0.14);
    color: #6ee7b7;
}

.maps-endpoint-status-down {
    background: rgba(239, 68, 68, 0.16);
    color: #fca5a5;
}

.maps-endpoint-status-unknown {
    background: rgba(148, 163, 184, 0.14);
    color: #cbd5e1;
}

.maps-optical-point-divicon {
    background: transparent;
    border: 0;
}

.maps-optical-point-marker {
    align-items: center;
    background: rgba(14, 165, 233, 0.2);
    border: 1px solid rgba(125, 211, 252, 0.42);
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.08), 0 8px 18px rgba(2, 6, 23, 0.34);
    color: #bae6fd;
    display: flex;
    font-size: 11px;
    height: 26px;
    justify-content: center;
    opacity: 0.78;
    width: 26px;
}

.maps-optical-point-marker svg {
    display: block;
    fill: none;
    height: 15px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 15px;
}

.maps-optical-point-image {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: inherit;
    height: auto;
    opacity: 0.94;
    overflow: visible;
    position: relative;
    width: auto;
}

.maps-optical-point-image svg {
    display: block;
    fill: initial;
    height: auto;
    stroke: initial;
    stroke-linecap: initial;
    stroke-linejoin: initial;
    stroke-width: initial;
    width: auto;
}

.maps-cto-svg {
    height: 28px;
    width: 28px;
}

.maps-closure-svg {
    filter: drop-shadow(0 0 5px rgba(100, 116, 139, 0.55)) drop-shadow(0 3px 6px rgba(2, 6, 23, 0.5));
    height: 28px;
    width: 28px;
}

.maps-point-splitter-badge {
    align-items: center;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.96), rgba(245, 158, 11, 0.96));
    border: 1px solid rgba(254, 243, 199, 0.72);
    border-radius: 999px;
    bottom: -4px;
    box-shadow: 0 4px 10px rgba(2, 6, 23, 0.35);
    color: #111827;
    display: inline-flex;
    font-size: 7px;
    font-weight: 900;
    justify-content: center;
    letter-spacing: 0.08em;
    line-height: 1;
    min-width: 18px;
    padding: 3px 4px;
    position: absolute;
    right: -5px;
    text-transform: uppercase;
    white-space: nowrap;
}

.maps-optical-point-pop {
    background: rgba(16, 185, 129, 0.25);
    border-color: rgba(52, 211, 153, 0.52);
    color: #bbf7d0;
}

.maps-optical-point-cto,
.maps-optical-point-ceo {
    background: rgba(245, 158, 11, 0.22);
    border-color: rgba(251, 191, 36, 0.46);
    color: #fde68a;
}

.maps-optical-point-splitter {
    background: rgba(168, 85, 247, 0.22);
    border-color: rgba(216, 180, 254, 0.46);
    color: #e9d5ff;
}

.maps-optical-point-poste {
    background: rgba(148, 163, 184, 0.18);
    border-color: rgba(203, 213, 225, 0.34);
    color: #e2e8f0;
}

.maps-optical-point-equipamento {
    background: rgba(20, 184, 166, 0.22);
    border-color: rgba(94, 234, 212, 0.42);
    color: #ccfbf1;
}

.maps-optical-point-draft {
    background: rgba(56, 189, 248, 0.34);
    border-color: rgba(125, 211, 252, 0.82);
    color: #e0f2fe;
    opacity: 1;
}

.maps-optical-cable-outline,
.maps-optical-cable-draft-outline {
    filter: drop-shadow(0 0 6px rgba(226, 232, 240, 0.18));
    stroke-linecap: round;
}

.maps-optical-cable-outline-selected {
    filter: drop-shadow(0 0 8px rgba(248, 250, 252, 0.28));
}

.maps-optical-cable-line,
.maps-optical-cable-draft {
    filter: drop-shadow(0 0 4px rgba(226, 232, 240, 0.22));
    stroke-linecap: round;
}

.maps-optical-cable-selected {
    filter: drop-shadow(0 0 7px rgba(15, 23, 42, 0.48));
}

.maps-optical-cable-hit-area {
    cursor: pointer;
    stroke-linecap: round;
}

.maps-optical-cable-draft-point {
    cursor: pointer;
    filter: drop-shadow(0 0 7px rgba(245, 158, 11, 0.65));
}

.fiber-route-base,
.fiber-route-link {
    stroke-linecap: round;
}

.fiber-route-base {
    animation: none;
}

.fiber-route-link {
    /* Period = 32px (16+16). Keyframe offset = -64 = exactly 2 periods → seamless loop, no flash. */
    stroke-dasharray: 16 16;
    animation: fiberRouteFlow 1.1s linear infinite;
}

.fiber-route-hit-area {
    cursor: pointer;
    stroke-linecap: round;
}

.fiber-route-mpls-detail {
    pointer-events: none;
    stroke-linecap: round;
    stroke-dasharray: 3 18;
    animation: fiberMPLSFlow 0.85s linear infinite;
    filter: drop-shadow(0 0 4px rgba(56, 189, 248, 0.5));
}

/* Static glow layer — NOT animated, so filter here is safe (no repaint per frame). */
.fiber-route-base-up      { filter: drop-shadow(0 0 5px rgba(16,  185, 129, 0.5)); }
.fiber-route-base-warning { filter: drop-shadow(0 0 5px rgba(249, 115,  22, 0.5)); }
.fiber-route-base-critical{ filter: drop-shadow(0 0 6px rgba(239,  68,  68, 0.55)); }
.fiber-route-base-unknown { filter: drop-shadow(0 0 4px rgba(148, 163, 184, 0.3)); }
.fiber-route-base-down    { filter: none; } /* DOWN has no glow layer */

.fiber-route-flow-line {
    will-change: stroke-dashoffset, stroke-opacity;
}

/* Online routes — filter kept OFF the animated element (causes repaint flicker).
   Glow is handled by the hit-area shadow or accepted as none. */
.fiber-route-flow-up,
.fiber-route-flow-warning,
.fiber-route-flow-critical,
.fiber-route-flow-unknown {
    animation: fiberRouteFlow 1.45s linear infinite;
}

/* Offline routes: solid line that fully disappears and comes back — no filter on animated el */
.fiber-route-flow-down {
    stroke-dasharray: none;
    animation: fiberRouteDownBlink 1s steps(1, end) infinite;
}

@keyframes fiberRouteFlow {
    to {
        stroke-dashoffset: -64;
    }
}

@keyframes fiberMPLSFlow {
    to {
        stroke-dashoffset: -42;
    }
}

@keyframes fiberRouteDownBlink {
    0%, 49% {
        stroke-opacity: 1;
    }
    50%, 100% {
        stroke-opacity: 0;
    }
}

.leaflet-tooltip.fiber-tooltip {
    border: 1px solid rgba(52, 211, 153, 0.24) !important;
    border-radius: 18px !important;
    background: rgba(15, 23, 42, 0.95) !important;
    box-shadow: 0 18px 48px rgba(2, 6, 23, 0.38) !important;
    color: #fff !important;
    padding: 0 !important;
    white-space: normal !important;
}

.fiber-tooltip-card {
    display: block;
    min-width: 280px;
    max-width: 340px;
    padding: 14px;
    font-size: 12px;
    font-weight: 700;
}

.fiber-tooltip-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.fiber-tooltip-head strong {
    color: #f8fafc;
    font-size: 13px;
    font-weight: 900;
}

.fiber-tooltip-head span {
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.fiber-tooltip-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.fiber-tooltip-status-up {
    background: rgba(16, 185, 129, 0.16);
    color: #6ee7b7 !important;
}

.fiber-tooltip-status-down {
    background: rgba(239, 68, 68, 0.16);
    color: #fca5a5 !important;
}

.fiber-tooltip-status-unknown {
    background: rgba(148, 163, 184, 0.16);
    color: #cbd5e1 !important;
}

.fiber-tooltip-status-mpls {
    background: rgba(56, 189, 248, 0.16);
    color: #7dd3fc !important;
}

.fiber-tooltip-grid {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 6px 10px;
    margin-top: 10px;
}

.fiber-tooltip-grid span,
.fiber-tooltip-card small {
    color: #cbd5e1;
}

.fiber-tooltip-grid b {
    color: #f8fafc;
    font-weight: 900;
}

.fiber-tooltip-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.fiber-tooltip-metrics span {
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.16);
    color: #67e8f9;
    padding: 5px 8px;
    font-size: 10px;
    font-weight: 900;
}

.fiber-tooltip-card small {
    display: block;
    margin-top: 9px;
    font-size: 10px;
    font-weight: 800;
}

.leaflet-tooltip.fiber-point-tooltip {
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.92);
    color: #e0f2fe;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.04em;
    padding: 5px 9px;
}

.maps-flow-sample {
    background: repeating-linear-gradient(90deg, #34d399 0 10px, rgba(52, 211, 153, 0.12) 10px 18px);
    background-size: 36px 100%;
    animation: mapsLegendFlow 0.9s linear infinite;
}

@keyframes mapsLegendFlow {
    to {
        background-position: 36px 0;
    }
}

@media (max-width: 1100px) {
    .maps-routes-panel,
    .maps-map-legend {
        display: none !important;
    }

    .maps-map-toolbar {
        left: 20px !important;
        right: 20px !important;
        max-width: none;
        transform: none !important;
    }

    .maps-overlay-panel {
        left: 20px !important;
        right: 20px;
        width: auto !important;
    }

    .maps-map-footer {
        justify-content: center !important;
    }
}

/* Danger toolbar button variant */
.maps-toolbar-btn-danger {
    color: #fca5a5 !important;
    border-color: rgba(239, 68, 68, 0.2) !important;
}
.maps-toolbar-btn-danger i { color: #f87171 !important; }
.maps-toolbar-btn-danger:hover {
    background: rgba(239, 68, 68, 0.15) !important;
    border-color: rgba(239, 68, 68, 0.4) !important;
    color: #fecaca !important;
}

/* Delete mode active state */
.maps-delete-mode-active #fiber-map {
    box-shadow: inset 0 0 0 3px rgba(239, 68, 68, 0.45), 0 0 0 1px rgba(239, 68, 68, 0.2) !important;
    cursor: crosshair !important;
}
.maps-toolbar-btn-delete-active {
    background: rgba(239, 68, 68, 0.2) !important;
    border-color: rgba(239, 68, 68, 0.5) !important;
    color: #fca5a5 !important;
}
.maps-toolbar-btn-delete-active i { color: #f87171 !important; }

/* Bulk delete modal options */
.bulk-delete-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.07);
    background: rgba(255,255,255,0.03);
    cursor: pointer;
    transition: background 0.14s, border-color 0.14s;
    user-select: none;
}
.bulk-delete-option:hover { background: rgba(255,255,255,0.07); }
.bulk-delete-option input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: #ef4444;
    flex-shrink: 0;
    cursor: pointer;
}
.bulk-delete-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}
.bulk-delete-label {
    display: flex; flex-direction: column; gap: 3px;
}
.bulk-delete-label strong { font-size: 13px; font-weight: 800; color: #e2e8f0; }
.bulk-delete-label span  { font-size: 11px; font-weight: 600; color: #64748b; }

/* ============================================================
   KMZ IMPORT MODAL
   ============================================================ */
.kmz-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 48px 16px 24px;
    overflow-y: auto;
}
.kmz-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.82);
    backdrop-filter: blur(6px);
    z-index: 0;
}
.kmz-modal-box {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 680px;
    max-height: 86vh;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #0d1526;
    box-shadow: 0 32px 80px rgba(2, 6, 23, 0.8);
    overflow: hidden;
    color: #e2e8f0;
}
.kmz-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}
.kmz-modal-eyebrow {
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: #f59e0b;
    margin-bottom: 4px;
}
.kmz-modal-title {
    font-size: 18px;
    font-weight: 900;
    color: #f8fafc;
}
.kmz-modal-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    font-size: 14px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}
.kmz-modal-close-btn:hover { background: rgba(255,255,255,0.16); color: #f1f5f9; }

/* Upload step */
.kmz-upload-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 40px 32px;
}
.kmz-drop-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    width: 100%;
    padding: 48px 32px;
    border-radius: 18px;
    border: 2px dashed rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: border-color 0.18s, background 0.18s;
}
.kmz-drop-zone:hover, .kmz-drop-zone.is-drag-over {
    border-color: rgba(245, 158, 11, 0.55);
    background: rgba(245, 158, 11, 0.05);
}
.kmz-select-label {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #cbd5e1;
}
.kmz-parse-error {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid rgba(239, 68, 68, 0.25);
    background: rgba(239, 68, 68, 0.1);
    font-size: 13px;
    font-weight: 700;
    color: #fca5a5;
}

/* Review step */
.kmz-review-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}
.kmz-summary-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
    flex-wrap: wrap;
}
.kmz-chip-btn {
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.07);
    color: #cbd5e1;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.14s;
}
.kmz-chip-btn:hover { background: rgba(255,255,255,0.14); }
.kmz-chip-amber {
    border-color: rgba(245, 158, 11, 0.25);
    background: rgba(245, 158, 11, 0.08);
    color: #fcd34d;
}
.kmz-chip-amber:hover { background: rgba(245,158,11,0.18); }

.kmz-elements-list {
    overflow-y: auto;
    flex: 1;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(148,163,184,0.3) transparent;
}
.kmz-import-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}
.kmz-import-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 14px;
    border: none;
    background: #f59e0b;
    color: #0d1526;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.15s;
}
.kmz-import-btn:hover { background: #fbbf24; }
.kmz-import-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* Element rows */
.kmz-element-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: background 0.12s;
}
.kmz-element-row:hover { background: rgba(255,255,255,0.07); }
.kmz-element-row input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
    accent-color: #f59e0b;
    width: 15px;
    height: 15px;
    cursor: pointer;
}
.kmz-element-icon {
    font-size: 14px;
    flex-shrink: 0;
    width: 18px;
    text-align: center;
    margin-top: 2px;
}
.kmz-element-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.kmz-element-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.kmz-element-name {
    flex: 1;
    min-width: 0;
    font-size: 12px;
    font-weight: 800;
    color: #e2e8f0;
    background: transparent;
    border: none;
    border-bottom: 1px solid transparent;
    outline: none;
    padding: 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: border-color 0.14s;
}
.kmz-element-name:focus {
    white-space: normal;
    overflow: visible;
    border-bottom-color: rgba(245,158,11,0.5);
}
.kmz-element-tag {
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 99px;
    flex-shrink: 0;
}
.kmz-element-tag-line  { background: rgba(249,115,22,0.18); color: #fb923c; }
.kmz-element-tag-point { background: rgba(16,185,129,0.18); color: #34d399; }
.kmz-element-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.kmz-element-select {
    flex: 1;
    min-width: 120px;
    max-width: 180px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.07);
    color: #e2e8f0;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 8px;
    outline: none;
    cursor: pointer;
}
.kmz-element-number {
    width: 64px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.07);
    color: #e2e8f0;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 8px;
    outline: none;
    text-align: center;
}
.kmz-element-number-label {
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
}

/* ============================================================
   BUSCA DE ELEMENTOS
   ============================================================ */
.maps-search-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 14px;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.12s;
}
.maps-search-result-item:hover {
    background: rgba(255, 255, 255, 0.06);
}
.maps-search-result-icon {
    font-size: 13px;
    flex-shrink: 0;
    width: 18px;
    text-align: center;
}
.maps-search-result-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}
.maps-search-result-label {
    font-size: 12px;
    font-weight: 800;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.maps-search-result-sub {
    font-size: 10px;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================================
   RASTREIO DE FIBRA
   ============================================================ */
.fusion-fiber-trace-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: none;
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    font-size: 9px;
    cursor: pointer;
    flex-shrink: 0;
    margin-left: 2px;
    transition: background 0.14s, color 0.14s;
}
.fusion-fiber-trace-btn:hover {
    background: rgba(251, 191, 36, 0.35);
    color: #fde68a;
}
.fusion-fiber-item:hover .fusion-fiber-trace-btn {
    display: inline-flex;
}

.maps-trace-panel {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 1004;
    width: 280px;
    max-height: 50vh;
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    border: 1px solid rgba(251, 191, 36, 0.3);
    background: rgba(15, 23, 42, 0.95);
    box-shadow: 0 20px 60px rgba(2, 6, 23, 0.55), 0 0 0 1px rgba(251,191,36,0.1);
    backdrop-filter: blur(16px);
    overflow: hidden;
    color: #e2e8f0;
}
.maps-trace-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 12px;
    font-weight: 800;
    flex-shrink: 0;
}
.maps-trace-header button {
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    padding: 2px;
    flex-shrink: 0;
}
.maps-trace-header button:hover { color: #e2e8f0; }
.maps-trace-hops {
    overflow-y: auto;
    flex: 1;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.maps-trace-hop {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.maps-trace-hop-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(251, 191, 36, 0.18);
    color: #fbbf24;
    font-size: 10px;
    font-weight: 900;
    flex-shrink: 0;
}
.maps-trace-hop-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.maps-trace-hop-info strong {
    font-size: 12px;
    font-weight: 800;
    color: #f1f5f9;
}
.maps-trace-hop-info span {
    font-size: 10px;
    font-weight: 600;
    color: #64748b;
}

/* ============================================================
   PAINEL DE CAPACIDADE
   ============================================================ */
.maps-capacity-item {
    display: block;
    width: 100%;
    padding: 9px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    text-align: left;
    transition: background 0.14s;
}
.maps-capacity-item:hover {
    background: rgba(255, 255, 255, 0.07);
}
.maps-capacity-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.maps-capacity-item-name {
    font-size: 12px;
    font-weight: 800;
    color: #e2e8f0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    margin-right: 6px;
}
.maps-capacity-item-state {
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}
.maps-capacity-bar-track {
    height: 4px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    margin-bottom: 5px;
}
.maps-capacity-bar-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 0.3s;
}
.maps-capacity-item-numbers {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    font-weight: 700;
}
