/* Mapa Dadge: mapa em toda a área de conteúdo, com painéis por cima. */
.dm { --dm-fundo: #06110c; --dm-painel: rgba(8, 24, 18, .86); --dm-linha: rgba(120, 230, 175, .16); --dm-texto: #eaf6f0; --dm-suave: #9db8aa; --dm-verde: #1dbf73; --dm-claro: #48e29a; --dm-laranja: #ff9d2e;
    position: relative; height: calc(100vh - 57px); min-height: 480px; overflow: hidden; background: radial-gradient(circle at 50% 42%, #0d2c1e 0, #06110c 62%); color: var(--dm-texto); font-family: Inter, system-ui, sans-serif; }
.content-wrapper:has(.dm) { background: var(--dm-fundo, #06110c) !important; }
.content-wrapper:has(.dm) > .content { padding: 0 !important; }
.content-wrapper:has(.dm) .container-fluid { padding: 0; }
body:has(.dm) .main-footer { display: none; }
.dm-tela { position: absolute; inset: 0; }
.dm::before { content: ''; position: absolute; z-index: 2; top: 0; left: 0; bottom: 0; width: 340px; background: linear-gradient(to right, rgba(6, 17, 12, .78), rgba(6, 17, 12, 0)); pointer-events: none; }
.dm-marcas .dm-eu { z-index: 4; }
.dm-marcas .dm-cartao-caixa { z-index: 5; }
.dm-tela canvas { display: block; outline: none; cursor: grab; touch-action: none; }
.dm-tela canvas.a-arrastar { cursor: grabbing; }
.dm-tela canvas:focus-visible { box-shadow: inset 0 0 0 2px var(--dm-claro); }
.dm-marcas { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.dm-marcas > * { position: absolute; top: 0; left: 0; pointer-events: auto; will-change: transform; }

/* Painéis */
.dm-esquerda, .dm-direita, .dm-barra, .dm-controlos { position: absolute; z-index: 3; }
.dm-painel, .dm-tipos, .dm-barra, .dm-controlos, .dm-vista { border: 1px solid var(--dm-linha); border-radius: 12px; background: var(--dm-painel); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 16px 34px -20px rgba(0, 0, 0, .9); }
.dm-esquerda { top: 18px; left: 22px; width: 250px; pointer-events: none; }
.dm-esquerda > * { pointer-events: auto; }
.dm-titulo { pointer-events: none; margin-bottom: .8rem; text-shadow: 0 2px 16px rgba(0, 0, 0, .75); }
.dm-sobretitulo { color: var(--dm-claro); font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.dm-titulo-linha { display: flex; align-items: center; gap: .5rem; }
.dm-titulo h1 { margin: 0; color: #fff; font-family: var(--dn-serifa, Georgia, serif); font-size: 2.05rem; font-weight: 700; line-height: 1.15; }
.dm-titulo p { margin: .15rem 0 0; color: #d5e6dd; font-size: .86rem; line-height: 1.35; }
.dm-icone { pointer-events: auto; flex: none; width: 30px; height: 30px; padding: 0; border: 1px solid var(--dm-linha); border-radius: 8px; background: var(--dm-painel); color: var(--dm-texto); font-size: .72rem; cursor: pointer; }
.dm-icone:hover { border-color: var(--dm-claro); color: var(--dm-claro); }
.dm-tipos { padding: 5px; }
.dm-tipo { display: flex; align-items: center; gap: .6rem; margin: 0; padding: .55rem .6rem; border-radius: 8px; color: var(--dm-suave); font-size: .84rem; font-weight: 600; cursor: pointer; transition: background .16s ease, color .16s ease; }
.dm-tipo:hover { background: rgba(120, 230, 175, .07); }
.dm-tipo i { width: 18px; text-align: center; font-size: .82rem; }
.dm-tipo span { flex: 1; min-width: 0; }
.dm-tipo b { color: inherit; font-weight: 500; opacity: .8; }
.dm-tipo input { appearance: none; -webkit-appearance: none; order: 2; flex: none; width: 18px; height: 18px; margin: 0; border: 1.5px solid rgba(157, 184, 170, .55); border-radius: 5px; background: transparent no-repeat center; cursor: pointer; }
.dm-tipo input:checked { border-color: var(--dm-verde); background-color: var(--dm-verde); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='9'%3E%3Cpath d='M1 4.5l3 3L10 1' fill='none' stroke='%2306110c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.dm-tipo input:focus-visible { outline: 2px solid var(--dm-claro); outline-offset: 2px; }
.dm-tipo:has(input:checked) { color: var(--dm-texto); }
.dm-vista { display: inline-flex; gap: 2px; margin-top: .6rem; padding: 3px; }
.dm-vista button { padding: .38rem .8rem; border: 0; border-radius: 8px; background: transparent; color: var(--dm-suave); font-size: .8rem; font-weight: 700; cursor: pointer; }
.dm-vista button.ativa { background: var(--dm-verde); color: #06110c; }

.dm-direita { top: 18px; right: 22px; bottom: 96px; display: flex; flex-direction: column; gap: 10px; width: 310px; overflow-y: auto; scrollbar-width: none; }
.dm-direita::-webkit-scrollbar { display: none; }
.dm-painel { flex: none; padding: .85rem .95rem; }
.dm-painel h2 { margin: 0 0 .55rem; color: var(--dm-texto); font-size: .9rem; font-weight: 700; }
.dm-painel h2 i { margin-right: .3rem; color: var(--dm-claro); font-size: .8rem; }
.dm-local { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .65rem; }
.dm-local-icone { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: rgba(29, 191, 115, .16); color: var(--dm-claro); }
.dm-local-texto { min-width: 0; }
.dm-local-texto small { display: block; color: var(--dm-suave); font-size: .72rem; }
.dm-local-texto strong { display: block; color: var(--dm-texto); font-size: .9rem; font-weight: 700; line-height: 1.2; }
.dm-usar { padding: .36rem .62rem; border: 1px solid var(--dm-verde); border-radius: 8px; background: transparent; color: var(--dm-claro); font-size: .76rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
.dm-usar:hover { background: rgba(29, 191, 115, .16); }
.dm-usar:disabled { opacity: .6; cursor: wait; }
.dm-local-manual { grid-column: 1 / -1; }
.dm-local-erro { grid-column: 1 / -1; margin: 0; color: #ffc98a; font-size: .74rem; line-height: 1.35; }
.dm-numeros { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; }
.dm-numeros > div + div { border-left: 1px solid var(--dm-linha); }
.dm-numeros strong { display: block; color: var(--dm-claro); font-size: 1.5rem; font-weight: 800; line-height: 1.2; }
.dm-numeros span { color: var(--dm-suave); font-size: .7rem; }
.dm-recentes { flex: 0 1 auto; min-height: 150px; display: flex; flex-direction: column; }
#dm-lista { flex: 0 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.dm-linha { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .48rem .25rem; border: 0; border-radius: 8px; background: none; color: inherit; text-align: left; cursor: pointer; }
.dm-linha:hover { background: rgba(120, 230, 175, .07); }
.dm-linha-icone { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; background: rgba(29, 191, 115, .14); color: var(--dm-claro); font-size: .78rem; }
.dm-linha > span:not(.dm-linha-icone) { flex: 1; min-width: 0; }
.dm-linha strong { display: block; overflow: hidden; color: var(--dm-texto); font-size: .8rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.dm-linha small { color: var(--dm-suave); font-size: .7rem; }
.dm-lista-vazia { margin: 0; padding: .35rem .2rem; color: var(--dm-suave); font-size: .78rem; }
.dm-ver-todos { display: block; margin-top: .45rem; padding: .42rem; border: 1px solid var(--dm-verde); border-radius: 8px; color: var(--dm-claro) !important; font-size: .78rem; font-weight: 700; text-align: center; }
.dm-ver-todos:hover { background: rgba(29, 191, 115, .16); }
.dm-fechar-folha { display: none; }

/* Barra de pesquisa */
.dm-barra { left: 22px; right: 22px; bottom: 18px; display: flex; align-items: center; gap: 6px; padding: 8px; }
.dm-pesquisa { position: relative; flex: 1 1 auto; min-width: 0; }
.dm-pesquisa i { position: absolute; top: 50%; left: .9rem; transform: translateY(-50%); color: var(--dm-suave); font-size: .85rem; }
.dm-pesquisa input { width: 100%; height: 44px; padding: 0 .9rem 0 2.4rem; border: 1px solid var(--dm-linha); border-radius: 8px; background: rgba(255, 255, 255, .04); color: var(--dm-texto); font-size: .9rem; outline: none; }
.dm-pesquisa input::placeholder { color: var(--dm-suave); }
.dm-pesquisa input:focus { border-color: var(--dm-verde); }
.dm select, .dm .dc-gatilho.dc-gatilho.dc-gatilho { height: 44px; padding: 0 2rem 0 .85rem; border: 1px solid var(--dm-linha); border-radius: 8px; background-color: rgba(255, 255, 255, .04) !important; color: var(--dm-texto); font-size: .86rem; }
.dm select { -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%239db8aa' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .8rem center; }
.dm select option { color: #0f1f18; }
.dm .dc-gatilho { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%239db8aa' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") !important; }
.dm-barra select, .dm-barra .dc-gatilho { flex: 0 0 auto; width: 200px; }
.dm-local-manual select, .dm-local-manual .dc-gatilho { width: 100%; height: 36px; font-size: .8rem; }
.dm-procurar { flex: none; height: 44px; padding: 0 1.2rem; border: 0; border-radius: 8px; background: var(--dm-verde); color: #06110c; font-size: .88rem; font-weight: 800; cursor: pointer; white-space: nowrap; }
.dm-procurar:hover { background: var(--dm-claro); }

/* Controlos */
.dm-controlos { right: 348px; bottom: 96px; display: flex; flex-direction: column; gap: 2px; padding: 4px; }
.dm-controlos button { width: 36px; height: 36px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--dm-texto); font-size: .82rem; cursor: pointer; }
.dm-controlos button:hover { background: rgba(120, 230, 175, .12); color: var(--dm-claro); }

.dm-abrir-folha { display: none; }
.dm-nota { position: absolute; z-index: 3; left: 22px; bottom: 92px; width: 250px; margin: 0; padding: .4rem .6rem; border-radius: 8px; background: rgba(6, 17, 12, .78); color: var(--dm-suave); font-size: .72rem; line-height: 1.35; }

/* Pinos */
.dm-pino, .dm-grupo { padding: 0; border: 0; background: none; cursor: pointer; }
.dm-pino { display: block; width: 44px; height: 52px; }
.dm-pino-corpo { position: absolute; top: 0; left: 0; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; overflow: hidden; border: 2px solid var(--dm-cor, #48e29a); border-radius: 50%; background: #0c2a1d; color: var(--dm-cor, #48e29a); font-size: .95rem; box-shadow: 0 0 0 4px rgba(72, 226, 154, .14), 0 0 22px var(--dm-brilho, rgba(72, 226, 154, .65)); transition: transform .16s ease; }
.dm-pino-corpo img { width: 100%; height: 100%; object-fit: cover; }
.dm-pino::after { content: ''; position: absolute; left: 50%; bottom: 0; width: 0; height: 0; border-top: 10px solid var(--dm-cor, #48e29a); border-left: 7px solid transparent; border-right: 7px solid transparent; transform: translateX(-50%); }
.dm-pino:hover .dm-pino-corpo, .dm-pino:focus-visible .dm-pino-corpo { transform: scale(1.12); }
.dm-pino:focus-visible, .dm-grupo:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 50%; }
.dm-c-freelancer { --dm-cor: #48e29a; --dm-brilho: rgba(72, 226, 154, .65); }
.dm-c-servico { --dm-cor: #5cc8ff; --dm-brilho: rgba(92, 200, 255, .6); }
.dm-c-necessidade { --dm-cor: #ffb454; --dm-brilho: rgba(255, 180, 84, .6); }
.dm-c-empresa { --dm-cor: #c79bff; --dm-brilho: rgba(199, 155, 255, .6); }
.dm-c-projeto { --dm-cor: #ff8fb8; --dm-brilho: rgba(255, 143, 184, .6); }
.dm-grupo { display: flex; align-items: center; justify-content: center; width: var(--dm-tam, 46px); height: var(--dm-tam, 46px); border: 2px solid var(--dm-claro, #48e29a); border-radius: 50%; background: radial-gradient(circle, rgba(29, 191, 115, .55), rgba(9, 44, 29, .92)); color: #fff; font-size: .9rem; font-weight: 800; box-shadow: 0 0 0 6px rgba(72, 226, 154, .12), 0 0 30px rgba(72, 226, 154, .7); transition: transform .16s ease; }
.dm-grupo:hover { transform: scale(1.1); }
.dm-eu { width: 22px; height: 22px; border: 3px solid #fff; border-radius: 50%; background: var(--dm-laranja, #ff9d2e); box-shadow: 0 0 22px 6px rgba(255, 157, 46, .8); }
.dm-eu::before { content: ''; position: absolute; inset: -14px; border: 2px solid rgba(255, 157, 46, .7); border-radius: 50%; animation: dm-pulso 2.2s ease-out infinite; }
.dm-eu span { position: absolute; bottom: 30px; left: 50%; padding: .22rem .55rem; border-radius: 8px; background: #d9f7e8; color: #06110c; font-size: .72rem; font-weight: 700; white-space: nowrap; transform: translateX(-50%); }
@keyframes dm-pulso { from { opacity: 1; transform: scale(.55); } to { opacity: 0; transform: scale(1.5); } }
@media (prefers-reduced-motion: reduce) { .dm-eu::before { animation: none; } }

/* Cartão do pino */
.dm-cartao { position: relative; width: 260px; overflow: hidden; border: 1px solid var(--dm-claro); border-radius: 12px; background: rgba(8, 24, 18, .96); color: var(--dm-texto); box-shadow: 0 0 26px rgba(72, 226, 154, .35), 0 18px 36px -14px #000; }
.dm-cartao-fechar { position: absolute; z-index: 1; top: 6px; right: 6px; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 7px; background: rgba(6, 17, 12, .75); color: #fff; font-size: 17px; line-height: 1; cursor: pointer; }
.dm-cartao-imagem { display: block; width: 100%; height: 118px; object-fit: cover; background: #0c2a1d; }
.dm-cartao-corpo { padding: .7rem .8rem .8rem; }
.dm-cartao-tipo { color: var(--dm-claro); font-size: .66rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.dm-cartao h3 { margin: .1rem 0 .2rem; color: #fff; font-size: .98rem; font-weight: 700; line-height: 1.25; }
.dm-cartao h3 i { color: #5cc8ff; font-size: .78rem; }
.dm-cartao p { margin: 0 0 .15rem; color: var(--dm-suave); font-size: .76rem; }
.dm-cartao strong { display: block; margin: .25rem 0 .1rem; color: var(--dm-claro); font-size: .85rem; }
.dm-cartao a { display: block; margin-top: .55rem; padding: .42rem; border-radius: 8px; background: var(--dm-verde); color: #06110c !important; font-size: .8rem; font-weight: 800; text-align: center; }

/* Erro */
.dm-erro { position: absolute; z-index: 5; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.5rem; background: #06110c; text-align: center; }
.dm-erro[hidden] { display: none; }
.dm-erro > i { margin-bottom: .7rem; color: var(--dm-claro); font-size: 2.2rem; }
.dm-erro h2 { margin: 0 0 .3rem; color: #fff; font-size: 1.15rem; font-weight: 700; }
.dm-erro p { max-width: 440px; margin: 0 0 1rem; color: var(--dm-suave); font-size: .88rem; }
.dm-erro div { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; }
.dm-erro a { padding: .45rem .85rem; border: 1px solid var(--dm-verde); border-radius: 8px; color: var(--dm-claro) !important; font-size: .82rem; font-weight: 700; }

/* Portátil: painéis mais estreitos */
@media (max-width: 1279.98px) {
    .dm-esquerda { width: 215px; left: 14px; }
    .dm-nota { left: 14px; width: 215px; }
    .dm-titulo h1 { font-size: 1.7rem; }
    .dm-direita { right: 14px; width: 270px; }
    .dm-barra { left: 14px; right: 14px; }
    .dm-barra select, .dm-barra .dc-gatilho { width: 150px; }
    .dm-controlos { right: 296px; }
    }

/* Telemóvel e tablet: o mapa primeiro; o resto aparece a pedido */
@media (max-width: 991.98px) {
    .dm { height: calc(100vh - 57px - 58px); height: calc(100dvh - 57px - 58px); min-height: 420px; }
    .dm-esquerda { top: 8px; left: 0; right: 0; width: auto; }
    .dm::before { display: none; }
    .dm-titulo { display: none; }
    .dm-tipos { display: flex; gap: 5px; padding: 0 10px; border: 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; overflow-x: auto; scrollbar-width: none; }
    .dm-tipos::-webkit-scrollbar { display: none; }
    .dm-tipo { flex: none; gap: .35rem; padding: .42rem .65rem; border: 1px solid var(--dm-linha); border-radius: 8px; background: var(--dm-painel); font-size: .78rem; }
    .dm-tipo span { flex: none; }
    .dm-tipo input { position: absolute; width: 1px; height: 1px; opacity: 0; }
    .dm-tipo:has(input:checked) { border-color: var(--dm-verde); background: rgba(29, 191, 115, .3); }
    .dm-vista { position: absolute; top: 44px; left: 10px; margin: 0; }
    .dm-vista button { padding: .32rem .6rem; font-size: .74rem; }
    .dm-controlos { top: 44px; right: 10px; bottom: auto; }
    .dm-controlos button { width: 34px; height: 34px; }
        .dm-barra { left: 8px; right: 8px; bottom: 8px; flex-wrap: wrap; padding: 6px; }
    .dm-pesquisa { flex: 1 1 100%; }
    .dm-pesquisa input { height: 42px; }
    .dm-barra select { flex: 1 1 0; width: auto; min-width: 0; height: 40px; }
    .dm-procurar { width: 46px; height: 40px; padding: 0; }
    .dm-procurar span { display: none; }
    .dm-abrir-folha { position: absolute; z-index: 3; left: 10px; bottom: 122px; display: inline-flex; align-items: center; gap: .4rem; padding: .48rem .9rem; border: 1px solid var(--dm-verde); border-radius: 999px; background: var(--dm-painel); color: var(--dm-claro); font-size: .8rem; font-weight: 700; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
    .dm-direita { top: auto; left: 0; right: 0; bottom: 0; z-index: 4; width: auto; max-height: 72%; padding: 14px 10px 10px; border-radius: 14px 14px 0 0; background: #0a1f17; box-shadow: 0 -18px 40px rgba(0, 0, 0, .6); transform: translateY(102%); visibility: hidden; transition: transform .25s ease, visibility .25s; }
    .dm-direita.aberta { transform: none; visibility: visible; }
    .dm-direita .dm-painel { background: rgba(255, 255, 255, .03); -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; }
    .dm-fechar-folha { display: block; align-self: flex-end; flex: none; width: 34px; height: 34px; margin-bottom: -6px; padding: 0; border: 0; border-radius: 8px; background: rgba(255, 255, 255, .07); color: var(--dm-texto); }
    .dm-nota { display: none; }
}
@media (prefers-reduced-motion: reduce) { .dm-direita { transition: none; } }

/* A carregar */
.dm-carregar { position: absolute; z-index: 2; top: 42%; left: 50%; margin: 0; color: var(--dm-suave); font-size: .85rem; transform: translateX(-50%); }
.dm-carregar[hidden] { display: none; }

/* Modo leve e telemóvel: o desfoque por trás dos painéis é o que mais pesa em aparelhos modestos */
.dm-leve .dm-painel, .dm-leve .dm-tipos, .dm-leve .dm-barra, .dm-leve .dm-controlos, .dm-leve .dm-vista, .dm-leve .dm-abrir-folha { -webkit-backdrop-filter: none; backdrop-filter: none; background: #0a1f17; box-shadow: none; }
.dm-leve .dm-pino-corpo, .dm-leve .dm-grupo { box-shadow: none; }
.dm-leve .dm-eu::before { animation: none; }
@media (max-width: 991.98px) {
    .dm-painel, .dm-barra, .dm-controlos, .dm-vista, .dm-abrir-folha { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; background: #0a1f17 !important; }
    .dm-direita .dm-painel { background: rgba(255, 255, 255, .03) !important; }
}

/* Informação */
.dm-tipo-freelancer i { color: #48e29a; }
.dm-tipo-servico i { color: #5cc8ff; }
.dm-tipo-necessidade i { color: #ffb454; }
.dm-tipo-empresa i { color: #c79bff; }
.dm-tipo-projeto i { color: #ff8fb8; }
.dm-linha .dm-linha-icone { background: rgba(255, 255, 255, .06); color: var(--dm-cor, #48e29a); }
.dm-cartao-onde i { color: var(--dm-claro); font-size: .7rem; }
.dm-cartao-nota { color: #ffd27d !important; font-weight: 600; }
.dm-cartao-nota i { font-size: .68rem; }
.dm-cartao-fichas { display: flex; flex-wrap: wrap; gap: 3px; margin: .3rem 0 .1rem; }
.dm-cartao-fichas span { padding: .1rem .4rem; border-radius: 6px; background: rgba(120, 230, 175, .12); color: #cfe9db; font-size: .68rem; font-weight: 600; }
.dm-cartao-precisao { display: block; margin-top: .3rem; color: var(--dm-suave); font-size: .66rem; }
.dm-dica { position: absolute; top: 0; left: 0; z-index: 2; max-width: 240px; padding: .28rem .55rem; border: 1px solid var(--dm-linha); border-radius: 7px; background: rgba(6, 17, 12, .92); color: var(--dm-texto); font-size: .74rem; font-weight: 600; pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-dica[hidden] { display: none; }
.dm-cartao-antes { color: var(--dm-suave); font-size: .72rem; font-weight: 500; }
