/* ========================================================
   1. CONFIGURAÇÕES DE CORES GLOBAIS (J3DAY)
   ======================================================== */
:root {
    --j3-bg: #0B2142;
    --j3-surface: #102A4C;
    --j3-surface-soft: #132F57;
    --j3-lime: #BADA55;
    --j3-light-text: #B0BEC5;
}

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: var(--j3-bg) !important;
    color: white;
}

/* Painel Lateral */
.sidebar {
    background-image: linear-gradient(180deg, var(--j3-surface) 0%, var(--j3-surface-soft) 100%) !important;
}

/* Barra do Topo */
.top-row {
    background-color: var(--j3-surface-soft) !important;
    border-bottom: 1px solid var(--j3-lime) !important;
    height: 3.5rem;
    display: flex;
    align-items: center;
}

/* Links do Menu Lateral */
.nav-link {
    color: white !important;
    text-decoration: none !important;
}

    .nav-link:hover {
        color: var(--j3-lime) !important;
    }

/* ========================================================
   2. CORREÇÃO DO MENU DE PERFIL (DROPDOWN)
   ======================================================== */

/* 🎯 MATADOR DE QUADRADO: Remove contornos APENAS do botão principal do perfil */
.user-profile-btn:focus,
.user-profile-btn:active {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* 👤 AJUSTE DO MENU FLUTUANTE */
.dropdown-menu {
    display: none;
    position: absolute;
    background-color: white !important;
    list-style: none !important;
    padding: 0 !important; /* 🎯 Tiramos o espaço extra para o hover não vazar */
    margin-top: 10px !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5) !important;
    border: none !important;
    min-width: 190px;
    z-index: 9999 !important;
    overflow: hidden !important; /* 🎯 A mágica: corta o fundo verde para ele respeitar a borda redonda */
}

    .dropdown-menu.show {
        display: block !important;
    }

    /* Remove pontos de lista de vez */
    .dropdown-menu li, .dropdown-menu ul {
        list-style: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

/* 📏 ALINHAMENTO MILIMÉTRICO DOS ITENS DO MENU */
.dropdown-item {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important; /* 🎯 A mágica: Força todos a começarem exatamente na esquerda */
    width: 100% !important;
    box-sizing: border-box !important; /* 🎯 Garante que o botão e o link calculem o espaço igual */
    padding: 12px 24px !important; /* Margem esquerda fixa para os dois */
    color: #333 !important;
    text-decoration: none !important;
    font-size: 0.95rem !important;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    cursor: pointer !important;
    margin: 0 !important; /* Zera qualquer margem invisível do botão */
}

    .dropdown-item:hover {
        background-color: var(--j3-lime) !important;
        color: #0B2142 !important;
    }

    /* 🎯 Caixinha estrita para os ícones */
    .dropdown-item .bi {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 28px !important; /* Largura fixa. Se o ícone for gordo ou magro, ocupa o mesmo espaço */
        margin-right: 15px !important; /* Distância exata até a primeira letra do texto */
        font-size: 1.2rem !important;
    }

/* Divisor horizontal */
.dropdown-divider {
    border-top: 1px solid #eee !important;
    margin: 4px 0 !important;
}

/* ========================================================
   3. ELEMENTOS DO DASHBOARD E CARDS
   ======================================================== */
.content .card, .main .card {
    background-color: white !important;
    color: #333 !important;
    border-radius: 15px;
    border: none;
    padding: 20px;
}

.main h1, .main h2, .main h3, .main p {
    color: white;
}

.navbar-brand {
    color: white !important;
    font-weight: bold;
    text-decoration: none !important;
}
/* ========================================================
   4. BOTÃO DE PERFIL CUSTOMIZADO (INQUEBRÁVEL)
   ======================================================== */
.user-profile-btn {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    display: flex !important;
    align-items: center !important;
    padding: 0 !important;
    cursor: pointer;
}

.user-info {
    text-align: right;
    margin-right: 12px;
}

.user-company {
    color: var(--j3-lime) !important;
    font-size: 0.7rem !important;
    font-weight: bold !important;
    display: block !important;
    text-transform: uppercase !important;
}

.user-email {
    color: white !important;
    font-size: 0.85rem !important;
    display: block !important;
}

.user-avatar {
    width: 42px !important;
    height: 42px !important;
    border-radius: 50% !important; /* Força ser um círculo perfeito */
    background-color: #2196F3 !important; /* Fundo azul */
    border: 2px solid var(--j3-lime) !important; /* Borda verde lima */
    color: white !important;
    font-weight: bold !important;
    font-size: 1.2rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Animação de Pulsação para Alertas Críticos */
@keyframes pulse-red {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 82, 82, 0.7);
    }

    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(255, 82, 82, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 82, 82, 0);
    }
}

.animate-pulse {
    animation: pulse-red 2s infinite;
}

@media print {
    /* Esconde a sidebar e a top-row na hora de gerar o PDF */
    .sidebar, .top-row, .mud-table-pagination, .mud-button, .navbar {
        display: none !important;
    }

    .main, .content, .mud-container {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        background-color: white !important;
        color: black !important;
    }

    .mud-paper {
        background-color: white !important;
        color: black !important;
        elevation: 0 !important;
        border: 1px solid #ccc !important;
    }

    .text-white, .text-muted {
        color: black !important;
    }
}

/* Cores Dinâmicas de Bateria */
.battery-high {
    color: #BADA55 !important;
}
/* Verde J3day */
.battery-mid {
    color: #F5A623 !important;
}
/* Amarelo */
.battery-low {
    color: #FF5252 !important;
}
/* Vermelho */

.battery-charging {
    animation: pulse-charging 1.5s infinite;
}

@keyframes pulse-charging {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

/* ========================================================
   5. GOOGLE MAPS AUTOCOMPLETE (J3DAY DESIGN)
   ======================================================== */

/* Força os inputs de endereço a manterem a paleta J3day */
.pac-target-input {
    background-color: #132F57 !important;
    color: #FFFFFF !important;
    border: 1px solid #BADA55 !important;
    border-radius: 4px !important;
}

    /* Deixa o texto de fundo (placeholder) cinza claro */
    .pac-target-input::placeholder {
        color: #8FA3B8 !important;
    }

/* Estiliza a caixa flutuante de sugestões do Google */
.pac-container {
    background-color: #102A4C !important;
    border: 1px solid #BADA55 !important;
    border-radius: 0 0 8px 8px !important;
    box-shadow: 0 4px 6px rgba(0,0,0,0.5) !important;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif !important;
    /* 🚀 A MÁGICA DA LARGURA: Força a caixa a ser grande e a fonte maior */
    min-width: 500px !important;
    font-size: 15px !important;
}

/* Estiliza as linhas dos endereços sugeridos */
.pac-item {
    border-top: 1px solid #132F57 !important;
    color: #B0BEC5 !important;
    padding: 10px !important;
    cursor: pointer;
    /* 🚀 A MÁGICA DA LEITURA: Permite que o nome da rua quebre de linha se for gigante, em vez de cortar com "..." */
    white-space: normal !important;
    line-height: 1.5 !important;
}

    /* Efeito ao passar o mouse por cima de uma sugestão */
    .pac-item:hover {
        background-color: #132F57 !important;
    }

/* Destaca a parte do endereço que o motorista já digitou (Highlight) */
.pac-item-query {
    color: #BADA55 !important;
    font-weight: bold !important;
}

/* Deixa o ícone de localização do Google branquinho */
.pac-icon {
    filter: invert(100%) sepia(100%) saturate(0%) hue-rotate(288deg) brightness(102%) contrast(102%) !important;
}

/* Ajusta a logo do Google no rodapé para não ficar com fundo branco */
.pac-logo::after {
    background-color: #102A4C !important;
}