*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:Arial, Helvetica, sans-serif;
}

/* ⚙️ AJUSTES TÉCNICOS OBRIGATÓRIOS CONTRA OVERFLOW E EFEITO PINÇA */
html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

body{
    background:#ffffff;
    padding:15px;
    color:#000;
}

.container{
    width:100%;
    max-width:1800px;
    margin:auto;
}

.topo{
    background:#000;
    color:#fff;
    display:flex;
    justify-content:center;
    align-items:center;
    position:relative;
    padding:18px;
    border-radius:10px;
    margin-bottom:15px;
    flex-wrap:wrap;
}

h1{
    font-size:22px;
    font-weight:bold;
    text-align:center;
}

#relogio{
    position:absolute;
    right:20px;
    font-size:14px;
    font-weight:bold;
    color:#00ff99;
    font-family:Consolas, monospace;
}

.buttons{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    margin-bottom:15px;
}

input[type="file"]{
    background:#fff;
    padding:10px;
    border:1px solid #ccc;
    border-radius:8px;
}

button{
    padding:10px 16px;
    border:none;
    border-radius:8px;
    cursor:pointer;
    font-weight:bold;
    background:#f2f2f2;
    transition:.2s;
}

button:hover{
    transform:scale(1.03);
    background:#e4e4e4;
}

.filtro-container{
    margin-bottom:15px;
}

#filtroEquipamento{
    width:100%;
    padding:14px;
    font-size:15px;
    border:1px solid #ccc;
    border-radius:10px;
}

.legenda-criticidade{
    display:flex;
    justify-content:center;
    align-items:center;
    gap:20px;
    flex-wrap:wrap;
    margin-bottom:20px;
}

.legenda-item{
    padding:10px 20px;
    border-radius:10px;
    font-weight:bold;
    color:#fff;
}

.verde{
    background:#00b050;
}

.amarelo{
    background:#ffc000;
    color:#000;
}

.vermelho{
    background:#ff0000;
}

.painel-resumo{
    display:grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap:15px;
    margin-bottom:20px;
}

.card-resumo{
    background:#fff;
    border-radius:12px;
    padding:20px;
    box-shadow: 0 2px 10px rgba(0,0,0,.1);
    text-align:center;
}

.titulo-card{
    font-size:14px;
    font-weight:bold;
    margin-bottom:10px;
}

.valor-card{
    font-size:30px;
    font-weight:bold;
    color:#0066ff;
}

.grafico-container{
    background:#fff;
    padding:20px;
    border-radius:15px;
    box-shadow: 0 2px 10px rgba(0,0,0,.1);
    margin-bottom:20px;
    height:75vh;
    min-height:500px;
    position:relative;
    max-width: 100%; /* Proteção extra de viewport para o Canvas */
}

#graficoPareto{
    width:100% !important;
    height:100% !important;
}

.detalhes-container{
    background:#fff;
    padding:20px;
    border-radius:15px;
    box-shadow: 0 2px 10px rgba(0,0,0,.1);
    margin-bottom:20px;
}

.detalhes-container h2{
    margin-bottom:15px;
}

#detalhesEquipamento{
    font-size:16px;
    font-weight:bold;
    line-height:1.8;
}

.resultado-container{
    overflow-x:auto;
    width: 100%;
    -webkit-overflow-scrolling: touch; /* Scroll suave no iOS */
}

#tabelaResultado{
    width:100%;
    border-collapse:collapse;
    background:#fff;
}

#tabelaResultado th{
    background:#000;
    color:#fff;
    padding:12px;
    border:1px solid #444;
}

#tabelaResultado td{
    padding:12px;
    border:1px solid #ccc;
    text-align:center;
    font-weight:bold;
}

#tabelaResultado tbody tr:nth-child(even){
    background:#f7f7f7;
}

#tabelaResultado tbody tr:hover{
    background:#efefef;
}

.class-normal{
    background:#00b050;
    color:#fff;
}

.class-atencao{
    background:#ffc000;
    color:#000;
}

.class-critico{
    background:#ff0000;
    color:#fff;
}

.inspecao{
    background:#92d050;
    color:#000;
}

.programar{
    background:#ffc000;
    color:#000;
}

.imediata{
    background:#ff0000;
    color:#ffff00;
}

footer{
    margin-top:20px;
    padding:12px;
    text-align:center;
    font-size:14px;
    font-weight:bold;
}

/* 📱 RESPONSIVIDADE E ADAPTAÇÃO FLEXBOX/VIEWPORT EXTRA */
@media(max-width:900px){
    .topo{
        padding-top:50px;
        flex-direction: column; /* Evita colisão com o relógio absoluto */
        height: auto;
    }
    #relogio{
        top:10px;
        right:15px;
        font-size:12px;
        position: absolute;
    }
    .grafico-container{
        height:65vh;
    }
}

@media(max-width:600px){
    body{
        padding:8px;
    }
    h1{
        font-size:16px;
        line-height:1.4;
    }
    .buttons{
        flex-direction:column;
    }
    button{
        width:100%;
    }
    input[type="file"]{
        width:100%;
    }
    .legenda-criticidade{
        flex-direction:column;
        gap: 10px;
    }
    .valor-card{
        font-size:24px;
    }
    .grafico-container{
        height:500px;
        padding:10px;
    }
    #detalhesEquipamento{
        font-size:14px;
    }
    #tabelaResultado{
        min-width:900px; /* Mantém a legibilidade da tabela via scroll contido */
    }
}