/* ==========================================================================
   Mapa da Frota — layout denso, responsivo e performático para frotas grandes
   Escopo: tudo sob .mapa-frota para não vazar estilo p/ outras telas.
   ========================================================================== */

/* Variáveis também no :root para as classes utilitárias (.mf-ponto, .mf-busca, balão)
   funcionarem fora do .mapa-frota — ex.: lista de pontos do mapa individual. */
:root {
    --mf-bg: #f1f5f9;
    --mf-surface: #ffffff;
    --mf-border: #e2e8f0;
    --mf-text: #0f172a;
    --mf-muted: #64748b;
    --mf-verde: #16a34a;
    --mf-ambar: #f59e0b;
    --mf-vermelho: #ef4444;
    --mf-cinza: #94a3b8;
    --mf-azul: #2563eb;
}

.mapa-frota {
    --mf-bg: #f1f5f9;
    --mf-surface: #ffffff;
    --mf-border: #e2e8f0;
    --mf-text: #0f172a;
    --mf-muted: #64748b;
    --mf-verde: #16a34a;
    --mf-ambar: #f59e0b;
    --mf-vermelho: #ef4444;
    --mf-cinza: #94a3b8;
    --mf-azul: #2563eb;
    --mf-painel-w: 380px;

    display: flex;
    height: 100%;
    width: 100%;
    margin: 0;
    overflow: hidden;
    background: var(--mf-bg);
    color: var(--mf-text);
    font-family: inherit;
}

/* ---------- Painel lateral ---------- */
.mf-painel {
    width: var(--mf-painel-w);
    min-width: var(--mf-painel-w);
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--mf-surface);
    border-right: 1px solid var(--mf-border);
    box-shadow: 2px 0 8px rgba(15, 23, 42, 0.04);
    z-index: 5;
}

.mf-tabs {
    display: flex;
    padding: 10px 12px 0;
    gap: 6px;
}

.mf-tab {
    flex: 1;
    text-align: center;
    padding: 8px 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--mf-muted);
    background: var(--mf-bg);
    border: 1px solid var(--mf-border);
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.mf-tab.ativo {
    color: var(--mf-azul);
    background: var(--mf-surface);
    border-bottom-color: var(--mf-surface);
    box-shadow: 0 -2px 0 var(--mf-azul) inset;
}

/* ---------- Resumo / chips de status ---------- */
.mf-resumo {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 12px 4px;
}

.mf-chip {
    flex: 1 1 calc(50% - 6px);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 9px;
    background: var(--mf-bg);
    border: 1px solid var(--mf-border);
    border-radius: 9px;
    cursor: pointer;
    transition: all 0.15s ease;
    min-width: 0;
}

.mf-chip:hover { border-color: var(--mf-cinza); }

.mf-chip.ativo {
    background: #eef2ff;
    border-color: var(--mf-azul);
    box-shadow: 0 0 0 1px var(--mf-azul) inset;
}

/* Total em faixa horizontal no topo do resumo (especificidade extra p/ vencer as media queries) */
.mf-resumo .mf-chip-total {
    flex: 1 1 100%;
    gap: 10px;
}
.mf-chip-total .mf-chip-num { font-size: 17px; }
.mf-chip-total .mf-chip-lbl { font-size: 12px; display: block; }

.mf-chip-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.mf-chip-num {
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
}

.mf-chip-lbl {
    font-size: 11px;
    color: var(--mf-muted);
    line-height: 1.1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mf-dot-verde { background: var(--mf-verde); }
.mf-dot-ambar { background: var(--mf-ambar); }
.mf-dot-vermelho { background: var(--mf-vermelho); }
.mf-dot-cinza { background: var(--mf-cinza); }
.mf-dot-azul { background: var(--mf-azul); }

/* ---------- Busca + filtro ---------- */
.mf-busca {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--mf-border);
}

.mf-busca-input {
    position: relative;
    flex: 1;
}

.mf-busca-input > i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--mf-muted);
    font-size: 13px;
    pointer-events: none;
}

.mf-busca-input input {
    width: 100%;
    height: 36px;
    padding: 0 10px 0 30px;
    font-size: 13px;
    border: 1px solid var(--mf-border);
    border-radius: 9px;
    background: var(--mf-bg);
    outline: none;
    transition: border-color 0.15s ease;
}

.mf-busca-input input:focus { border-color: var(--mf-azul); background: #fff; }

.mf-btn-filtro {
    width: 36px;
    height: 36px;
    border: 1px solid var(--mf-border);
    border-radius: 9px;
    background: var(--mf-bg);
    color: var(--mf-muted);
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
}

.mf-btn-filtro:hover { color: var(--mf-azul); border-color: var(--mf-azul); }
.mf-btn-filtro.com-filtro,
.mf-btn-filtro.ativo { color: var(--mf-azul); border-color: var(--mf-azul); background: #eef2ff; }

/* Painel inline de filtro por departamento (filtra ao vivo) */
.mf-filtro-dept {
    padding: 8px 12px 10px;
    border-bottom: 1px solid var(--mf-border);
    background: #f8fafc;
}
.mf-filtro-dept > label {
    display: block;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--mf-muted);
    margin: 0 0 5px 2px;
}
.mf-filtro-dept-row { display: flex; gap: 6px; align-items: center; }
.mf-filtro-dept-row select {
    flex: 1;
    height: 36px;
    padding: 0 8px;
    font-size: 13px;
    border: 1px solid var(--mf-border);
    border-radius: 9px;
    background: #fff;
    outline: none;
}
.mf-filtro-dept-row select:focus { border-color: var(--mf-azul); }
.mf-filtro-dept-x {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border: 1px solid var(--mf-border);
    border-radius: 9px;
    background: #fff;
    color: var(--mf-cinza);
    cursor: pointer;
}
.mf-filtro-dept-x:hover { color: #ef4444; border-color: #ef4444; }
.mf-filtro-dept-vazio { font-size: 11.5px; color: var(--mf-muted); padding: 6px 2px 0; }

/* ---------- Lista (scroll) ---------- */
.mf-lista {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 8px;
}

.mf-lista::-webkit-scrollbar { width: 8px; }
.mf-lista::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

.mf-vazio {
    text-align: center;
    color: var(--mf-muted);
    font-size: 13px;
    padding: 30px 16px;
}

/* ====== Drawer lateral de pontos (abinha + corpo + título) ====== */
.mf-drawer-tab {
    flex: 0 0 38px;
    align-self: stretch;
    border: none;
    border-right: 1px solid var(--mf-border);
    background: #f8fafc;
    color: #7c3aed;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}
.mf-drawer-tab:active { background: #eef2ff; }

.mf-drawer-body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 10px 12px 12px;
    overflow: hidden;
}
.mf-drawer-head {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
    padding: 0 2px 8px;
}
.mf-drawer-head i { color: #7c3aed; }

/* No drawer a lista preenche a altura disponível (rola dentro) */
.mf-drawer-body .mf-pontos-scroll {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
}

/* ====== Chips de filtro por tipo ====== */
.mf-poi-chips {
    display: flex;
    gap: 8px;
    padding: 4px 0 18px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--mf-border);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.mf-poi-chips::-webkit-scrollbar { display: none; }
.mf-poi-chip {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    padding: 7px 13px;
    border-radius: 999px;
    border: 1px solid var(--mf-border);
    background: var(--mf-bg);
    color: var(--mf-muted);
    white-space: nowrap;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.mf-poi-chip .n { font-size: 10px; opacity: 0.65; font-weight: 600; }
.mf-poi-chip.ativo { background: #eef2ff; border-color: var(--mf-azul); color: var(--mf-azul); }

/* ====== Cabeçalho de seção (categoria) ====== */
.mf-poi-sec {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #ffffff;
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--mf-muted);
    padding: 9px 2px 6px;
    border-bottom: 1px solid var(--mf-border);
}
.mf-poi-sec span { color: var(--mf-cinza); font-weight: 600; }

/* ====== Distância do veículo ====== */
.mf-ponto-meta { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.mf-ponto-dist {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--mf-azul);
}
.mf-ponto-dist i { font-size: 9px; }

/* ====== Lista de pontos de referência (densa, mobile-first) ====== */
.mf-lista-cab {
    font-size: 11px;
    font-weight: 600;
    color: var(--mf-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 8px 2px 7px;
}

/* Área rolável da lista de pontos — altura FIXA (não-vh) p/ o painel não estourar a tela.
   A lista rola dentro desse limite; o painel inteiro fica curto e previsível. */
.mf-pontos-scroll {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    max-height: 320px;
}
@media only screen and (max-width: 768px) {
    .mf-pontos-scroll { max-height: 210px; }
}

.mf-ponto {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 10px;
    border-bottom: 1px solid var(--mf-border);
    cursor: pointer;
    transition: background 0.12s ease;
    -webkit-tap-highlight-color: transparent;
}
.mf-ponto:active { background: #eef2ff; }
@media (hover: hover) { .mf-ponto:hover { background: #f8fafc; } }

.mf-ponto-ava {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}
.mf-ponto-ava img { width: 26px; height: 26px; object-fit: contain; }

.mf-ponto-txt { flex: 1; min-width: 0; }
.mf-ponto-nome {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--mf-text);
    line-height: 1.2;
    /* até 2 linhas em vez de cortar cedo */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}
.mf-ponto-tipo {
    display: inline-block;
    max-width: 100%;
    margin-top: 3px;
    font-size: 10px;
    font-weight: 700;
    color: #7c3aed;
    background: #f5f3ff;
    padding: 1px 7px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    /* sempre 1 linha */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
}
.mf-ponto-go { color: #cbd5e1; font-size: 13px; flex-shrink: 0; }

/* ---------- Card de veículo ---------- */
.mf-card {
    position: relative;
    display: flex;
    gap: 10px;
    padding: 10px 12px 10px 14px;
    margin-bottom: 7px;
    background: var(--mf-surface);
    border: 1px solid var(--mf-border);
    border-radius: 11px;
    cursor: pointer;
    transition: box-shadow 0.15s ease, transform 0.05s ease, border-color 0.15s ease;
    overflow: hidden;
}

.mf-card:hover {
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.10);
    border-color: var(--mf-cinza);
}

.mf-card:active { transform: scale(0.995); }

.mf-card.alerta { border-color: var(--mf-vermelho); background: #fef2f2; }
.mf-card.aviso { border-color: var(--mf-ambar); background: #fffbeb; }

/* Faixa de status à esquerda */
.mf-card::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--mf-cinza);
}
.mf-card.st-movimento::before { background: var(--mf-verde); }
.mf-card.st-ligado::before { background: var(--mf-ambar); }
.mf-card.st-desligado::before { background: var(--mf-vermelho); }
.mf-card.st-offline::before { background: var(--mf-cinza); }

/* Coluna do "medidor" */
.mf-card-medidor {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 52px;
}

.mf-vel {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--mf-cinza);
    background: #fff;
}
.mf-card.st-movimento .mf-vel { border-color: var(--mf-verde); }
.mf-card.st-ligado .mf-vel { border-color: var(--mf-ambar); }
.mf-card.st-desligado .mf-vel { border-color: var(--mf-vermelho); }

.mf-vel-num { font-size: 16px; font-weight: 800; line-height: 1; }
.mf-vel-un { font-size: 8px; color: var(--mf-muted); text-transform: uppercase; letter-spacing: 0.04em; }

.mf-combustivel {
    width: 44px;
    height: 6px;
    margin-top: 5px;
    border-radius: 3px;
    background: #e2e8f0;
    overflow: hidden;
}
.mf-combustivel > span { display: block; height: 100%; background: var(--mf-verde); }
.mf-combustivel.baixo > span { background: var(--mf-vermelho); }

/* Coluna de info */
.mf-card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mf-card-titulo {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
}

.mf-card-titulo .placa {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mf-badge-sat {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #fff;
    background: var(--mf-azul);
    padding: 2px 6px;
    border-radius: 999px;
}

.mf-card-status {
    font-size: 11px;
    font-weight: 600;
}
.mf-card.st-movimento .mf-card-status { color: var(--mf-verde); }
.mf-card.st-ligado .mf-card-status { color: var(--mf-ambar); }
.mf-card.st-desligado .mf-card-status { color: var(--mf-vermelho); }
.mf-card.st-offline .mf-card-status { color: var(--mf-muted); }

.mf-card-linha {
    font-size: 11px;
    color: var(--mf-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mf-card-linha b { color: var(--mf-text); font-weight: 600; }

.mf-card-tel {
    color: var(--mf-azul);
    text-decoration: none;
}

.mf-card-icones {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    margin-top: 3px;
    font-size: 12px;
    color: var(--mf-muted);
}
.mf-card-icones img { max-height: 14px; vertical-align: middle; }
.mf-ic-online { color: var(--mf-verde); }
.mf-ic-offline { color: var(--mf-vermelho); }

/* ---------- Mapa ---------- */
.mf-mapa {
    flex: 1;
    height: 100%;
    position: relative;
    margin: 0;
    padding: 0;
}

.mf-poi-toggle {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 7px;
    height: 40px;
    padding: 0 14px;
    background: #fff;
    border: 1px solid var(--mf-border);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--mf-muted);
}
.mf-poi-toggle.ativo { color: var(--mf-azul); border-color: var(--mf-azul); }

.mf-erro-conexao {
    position: absolute;
    top: 62px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 25;
    background: var(--mf-vermelho);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
}

/* Botão mobile de abrir/fechar a gaveta — escondido no desktop */
.mf-mobile-handle { display: none; }

/* Rótulo de placa abaixo do pin do veículo */
.marker-placa {
    background: #ffffff;
    padding: 1px 6px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.22);
    white-space: nowrap;
    line-height: 1.5;
    letter-spacing: 0.02em;
}

/* ====== Balão (InfoWindow) do veículo ====== */
.mf-balao {
    width: 296px;
    max-width: 78vw;
    font-family: inherit;
    color: #0f172a;
    padding: 2px 14px 2px 2px;
}

.mf-balao-nome {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
    padding-right: 22px;
}

/* Botão de fechar (X) do InfoWindow do Google: menor e encostado no canto */
.gm-style-iw button.gm-ui-hover-effect {
    top: 0 !important;
    right: 0 !important;
    width: 24px !important;
    height: 24px !important;
}
.gm-style-iw button.gm-ui-hover-effect > span {
    width: 16px !important;
    height: 16px !important;
    margin: 4px !important;
}

.mf-balao-sat {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    color: #fff;
    background: #2563eb;
    padding: 1px 6px;
    border-radius: 999px;
    vertical-align: middle;
}

.mf-balao-edit {
    color: #94a3b8;
    font-size: 12px;
    margin-left: 4px;
    text-decoration: none;
}
.mf-balao-edit:hover { color: #2563eb; }

.mf-balao-poitipo {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #7c3aed;
    background: #f5f3ff;
    padding: 3px 9px;
    border-radius: 999px;
    margin: 4px 0 6px;
}

.mf-balao-vel {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 4px 0 8px;
}
.mf-balao-vel .n { font-size: 24px; font-weight: 800; line-height: 1; }
.mf-balao-vel .u { font-size: 12px; color: #64748b; margin-right: 2px; }

.mf-balao-chip {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
    color: #fff;
    white-space: nowrap;
}
.mf-balao-chip.st-movimento { background: #16a34a; }
.mf-balao-chip.st-ligado { background: #f59e0b; }
.mf-balao-chip.st-desligado { background: #ef4444; }
.mf-balao-chip.st-offline { background: #94a3b8; }

.mf-balao-net {
    margin-left: auto;
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.mf-balao-net .fa-circle { font-size: 7px; }
.mf-balao-net.on { color: #16a34a; }
.mf-balao-net.off { color: #94a3b8; }

.mf-balao-row {
    font-size: 12.5px;
    color: #334155;
    margin: 3px 0;
    line-height: 1.35;
}
.mf-balao-row i { color: #94a3b8; width: 15px; text-align: center; }

.mf-balao-tel {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: #2563eb !important;
    text-decoration: none;
    margin: 3px 0;
}
.mf-balao-tel i { width: 15px; text-align: center; }

.mf-balao-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 9px 12px;
    margin: 9px 0;
    padding: 9px 0;
    border-top: 1px solid #eef2f7;
    border-bottom: 1px solid #eef2f7;
}
.mf-balao-grid > div { flex: 1 1 calc(33.333% - 12px); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mf-balao-grid span { font-size: 9.5px; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.04em; }
.mf-balao-grid b { font-size: 12.5px; font-weight: 700; color: #0f172a; white-space: nowrap; }

.mf-balao-acoes {
    display: flex;
    gap: 6px;
    margin: 9px 0 6px;
}
.mf-balao-btn {
    flex: 1;
    height: 34px;
    border: none;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: filter 0.15s ease;
}
.mf-balao-btn.primary { background: #2563eb; color: #fff; }
.mf-balao-btn.ok { background: #16a34a; color: #fff; }
.mf-balao-btn.ghost { flex: 0 0 42px; background: #f1f5f9; color: #475569; }
.mf-balao-btn:hover { filter: brightness(1.07); }

.mf-balao-coord {
    font-size: 10.5px;
    color: #cbd5e1;
    text-align: center;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
}

.mf-balao-alerta {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 8px;
    margin: 6px 0;
}
.mf-balao-alerta.critico { background: #fee2e2; color: #b91c1c; }
.mf-balao-alerta.aviso { background: #fef3c7; color: #b45309; }

/* ====== Chip de alerta no card ====== */
.mf-card-alerta {
    display: flex;
    width: fit-content;
    max-width: 100%;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    margin: 3px 0 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mf-card-alerta.critico { background: #fee2e2; color: #b91c1c; }
.mf-card-alerta.aviso { background: #fef3c7; color: #b45309; }

/* ====== Toasts de alerta ====== */
.mf-toasts {
    position: absolute;
    top: 60px;
    right: 12px;
    z-index: 30;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 272px;
    max-width: 82vw;
    pointer-events: none;
}
.mf-toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.22);
    border-left: 4px solid #94a3b8;
    cursor: pointer;
    animation: mfToastIn 0.2s ease;
}
.mf-toast.critico { border-left-color: #dc2626; }
.mf-toast.aviso { border-left-color: #f59e0b; }
.mf-toast-ic {
    font-size: 15px;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
}
.mf-toast.critico .mf-toast-ic { background: #dc2626; }
.mf-toast.aviso .mf-toast-ic { background: #f59e0b; }
.mf-toast-txt { flex: 1; min-width: 0; }
.mf-toast-lbl { font-size: 12.5px; font-weight: 700; color: #0f172a; line-height: 1.2; }
.mf-toast-veic {
    font-size: 11px;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mf-toast-ver {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 700;
    color: #2563eb;
    padding: 4px 9px;
    border-radius: 6px;
    background: #eff6ff;
}
.mf-toast-x {
    flex-shrink: 0;
    color: #cbd5e1;
    font-size: 12px;
    padding: 2px 1px;
}
.mf-toast-x:hover { color: #64748b; }

@keyframes mfToastIn {
    from { opacity: 0; transform: translateX(22px); }
    to { opacity: 1; transform: translateX(0); }
}

@media only screen and (max-width: 768px) {
    .mf-toasts { top: 54px; right: 8px; width: 240px; }
}

/* ---------- Responsivo: gaveta inferior no mobile ---------- */
@media only screen and (max-width: 768px) {
    .mapa-frota { flex-direction: column-reverse; }

    .mf-mapa { flex: 1; min-height: 200px; }

    .mf-painel {
        width: 100%;
        min-width: 0;
        height: auto;
        max-height: 62vh;
        border-right: none;
        border-top: 1px solid var(--mf-border);
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -4px 14px rgba(15, 23, 42, 0.10);
        transition: max-height 0.25s ease;
    }

    .mf-painel.recolhido { max-height: 40px; }
    .mf-painel.recolhido .mf-lista { display: none; }

    .mf-mobile-handle {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 8px;
        font-size: 12px;
        font-weight: 600;
        color: var(--mf-muted);
        cursor: pointer;
    }
    .mf-mobile-handle::before {
        content: "";
        position: absolute;
        top: 6px;
        left: 50%;
        transform: translateX(-50%);
        width: 38px;
        height: 4px;
        border-radius: 2px;
        background: #cbd5e1;
    }
    .mf-mobile-handle { position: relative; padding-top: 14px; }

    .mf-lista { max-height: 40vh; }

    .mf-poi-toggle { top: 10px; left: 50%; transform: translateX(-50%); height: 36px; padding: 0 10px; font-size: 12px; }

    .mf-chip { flex: 1 1 calc(50% - 6px); }
}

@media only screen and (max-width: 380px) {
    .mf-chip-lbl { display: none; }
    .mf-chip { flex: 1 1 calc(25% - 6px); justify-content: center; }
}
