/* ============================================================
   ESTILOS GERAIS E ESTRUTURA
   ============================================================ */
html,
body {
    height: 100%;
}

body {
    /* Fundo com Imagem Real e overlay escuro combinando com o LEAN TRACKER */
    background: linear-gradient(rgba(15, 23, 42, 0.75), rgba(15, 23, 42, 0.75)),
                url('../images/fundo-lean.png') no-repeat center center fixed;
    background-size: cover;
    height: 100%;
}

/* --- Ajustes de leitura para o fundo escuro --- */
body .container-fluid > .row > [class*="col-"] > h3,
body .container-fluid > .row > [class*="col-"] > h4,
body .container-fluid > .row > [class*="col-"] > h5,
body .container-fluid > .row > [class*="col-"] > p,
body .container-fluid > .row > [class*="col-"] > label,
body .container-fluid > .row > [class*="col-"] > div > label,
body .container-fluid > .row > [class*="col-"] > .d-flex > h3,
body .container-fluid > .row > [class*="col-"] > .d-flex > h4,
body .container-fluid > .row > [class*="col-"] > .d-flex > h5,
body .container-fluid > .row > [class*="col-"] > .d-flex > label {
    color: #ffffff !important;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.8);
}

.container-fluid {
    background-size: 100% 100%;
    background-attachment: fixed;



}

/* ============================================================
   BARRA DE NAVEGAÇÃO (NAVBAR) - Vermelho Engesig
   ============================================================ */
.navbar {
    background-color: #fcfafa !important;
    /* Cor sólida para maior nitidez */
    margin-bottom: 2px;
    border: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.navbar-light .navbar-nav .nav-link {
    color: #1a85e2 !important;
    /* Texto branco fica melhor no fundo vermelho */
    font-weight: 600;
    transition: color 0.3s ease;

    /* Efeito ao passar o mouse nos links */
    .navbar-light .navbar-nav .nav-link:hover {
        color: #0d4d82 !important;
        /* Azul mais escuro no hover */

    }

    /* ============================================================
   COMPONENTES E CARDS
   ============================================================ */
    .card {
        border: none;
        border-radius: 17px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.07);
        overflow: hidden;
    }

    .card-body {
        width: 80%;
    }

    .card-header {
        background-color: rgba(226, 35, 26, 0.05);
        /* Leve toque de vermelho no fundo */
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        color: #296fe9;
        font-weight: bold;
    }

    /* ============================================================
   BOTÕES MODERNOS - PADRONIZAÇÃO TOTAL
   ============================================================ */
    .btn-primary,
    .btn-info,
    .btn-danger,
    button {
        background-color: #1a85e2 !important;
        border: none !important;
        color: white !important;

        /* Força todos a terem a mesma largura e altura */
        min-width: 110px;
        height: 34px;

        /* Alinhamento central para ícone e texto */
        display: inline-flex;
        justify-content: center;
        align-items: center;
        gap: 10px;
        /* Espaço entre ícone e texto */

        /* Estética */
        padding: 0 15px !important;
        border-radius: 10px !important;
        font-weight: 500;
        font-size: 13px;
        transition: all 0.3s ease;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        cursor: pointer;
        white-space: nowrap;
        /* Impede que o texto quebre linha */
    }

    /* Garante que o ícone não mude o tamanho do botão */
    .btn-primary i,
    button i {
        font-size: 16px;
        margin: 0;
    }

    .btn-primary:hover,
    .btn-info:hover,
    .btn-danger:hover,
    button:hover {
        background-color: #2988d6 !important;
        transform: translateY(-2px);
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
    }

    /* ============================================================
   ANIMAÇÕES E ESTADOS (AGRUPADOS PARA ECONOMIZAR ESPAÇO)
   ============================================================ */
    @keyframes fa-blink {
        0% {
            opacity: 1;
        }

        50% {
            opacity: 0.5;
        }

        100% {
            opacity: 0;
        }
    }

    /* Aplica o pisca para todos os IDs de setup de uma vez */
    [id^="estado-setup"],
    [id^="aestado-setup"],
    [id^="pestado-setup"],
    .fa-blink {
        animation: fa-blink 1.0s linear infinite;
        width: 100%;
        font-size: 18px;
        font-weight: bold;
    }

    #nome-operador {
        width: 100%;
        font-size: 18px;
        font-weight: bold;
    }

    /* ============================================================
   UTILITÁRIOS E CLASSES DE CORES
   ============================================================ */
    .verde {
        background-color: #6FEC6B;
    }

    .azul {
        background-color: #96B7DC;
    }

    .vermelho {
        background-color: #2794ee;
    }

    /* Atualizado para o vermelho oficial */
    .amarelo {
        background-color: #E9DB60;
    }

    .canvasChart,
    .canvasRing {
        max-width: 100%;
    }

    .tableSelected {
        background-color: #FFD480 !important;
        color: black !important;
    }

    .bigIcon {
        font-size: 120px;
        color: #043573;
    }

    .formErrorMsg {
        font-size: 10px;
        color: red;
    }

    .bigInput {
        resize: none;
    }

    .indicator-square {
        max-width: 100%;
        max-height: 100%;
        background-color: white;
        border-radius: 15%;
        width: 50px;
        height: 25px;
        border: 1px solid blanchedalmond;
    }

    .carousel-indicators li {
        width: 100px;
        height: 10px;
        border-radius: 10%;
    }

    .carousel-indicators {
        bottom: -50px;
    }

    .carousel-control-prev,
    .carousel-control-next {
        height: 300px;
        width: 20px;
    }

    select.form-control {
        -moz-appearance: none;
        -webkit-appearance: none;
        appearance: none;
        border-radius: 5px;
        border: 1px solid #ddd;
    }

    /* ============================================================
   ESTILO DOS CAMPOS DE LOGIN E SENHA
   ============================================================ */
    .form-control {
        height: 48px;
        border-radius: 8px;
        border: 1px solid #ddd;
        padding: 10px 15px;
        font-size: 16px;
        transition: all 0.3s ease;
        background-color: #fafafa;
    }

    .form-control:focus {
        border-color: #E2231A;
        box-shadow: 0 0 0 0.2rem rgba(226, 35, 26, 0.15);
        background-color: #fff;
        outline: 0;
    }

    .form-group {
        margin-bottom: 20px;
    }

    label {
        font-weight: 600;
        color: #ee0a0a;
        margin-bottom: 8px;
        display: block;
        /* Garante o alinhamento correto acima do input */
    }

    .fade.modal-backdrop.show {
        opacity: 0.9;
    }

    /* --- AJUSTES PARA TABLET (ENGESIG) --- */

    body {
        background-size: cover !important;
        background-position: center center !important;
        background-attachment: fixed;
        min-height: 100vh;
    }

/* --- AJUSTES PARA TABLET E CELULAR (ENGESIG) --- */

/* --- ESTE É O BLOCO ÚNICO E DEFINITIVO --- */

@media (max-width: 992px) {
 /* 1. Ajuste da Tela de Login */
    .row.m-5 {
        margin: 80px 10px 10px 10px !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .col-md-6.d-flex.align-items-center {
        display: none !important; 
    }

    video {
        width: 100% !important;
        height: auto !important;
    }

   /* 2. MONITORAMENTO (ENGESIG) - FOCO NO JAVASCRIPT */
    #card-container {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        width: 100% !important;
        padding: 10px !important;
    }

    /* Alvo em qualquer DIV que o JS criar dentro do container */
    #card-container > div {
        flex: 0 0 45% !important; /* Força 2 cards por linha */
        max-width: 45% !important;
        min-width: 140px !important;
        margin: 5px !important;
    }

    /* Ajuste do card interno */
    .card {
        height: 150px !important;
        width: 100% !important;
    }

    /* O XEQUE-MATE: Força cada coluna de card a ocupar 46% da largura */
    div[class*="col-"] {
        flex: 0 0 46% !important; 
        max-width: 46% !important;
        min-width: 150px !important;
        margin-bottom: 15px !important;
        display: inline-block !important;
    }

    /* Ajuste do Card Vermelho */
    .card, [style*="background-color"] {
        width: 100% !important;
        height: 140px !important; 
        padding: 10px !important;
        border-radius: 10px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        font-size: 0.85rem !important;
    }
}