/* Prevenção estrita de transbordo e zoom-out para Mobile-First */
html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

body{
    background:#dcdcdc;
    font-family:Arial, Helvetica, sans-serif;
    padding:12px;
    color:#000;
    -webkit-text-size-adjust: 100%;
}

.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;
    margin-bottom:10px;
    border-radius:8px;
    flex-wrap:wrap;
    gap:10px;
}

h1{
    font-size:22px;
    font-weight:bold;
    letter-spacing:1px;
    margin:0;
    text-align:center;
    word-break:break-word;
}

#relogio{
    position:absolute;
    right:20px;
    font-size:14px;
    font-weight:bold;
    color:#00ff99;
    font-family:Consolas, monospace;
}

.buttons{
    display:flex;
    align-items:center;
    justify-content:flex-start;
    gap:10px;
    flex-wrap:wrap;
    margin-bottom:10px;
}

input[type="file"]{
    background:#fff;
    padding:8px;
    border-radius:6px;
    border:1px solid #999;
    font-size:12px;
    cursor:pointer;
}

button{
    background:#f2f2f2;
    padding:10px 16px;
    border:none;
    border-radius:6px;
    cursor:pointer;
    font-weight:bold;
    font-size:14px;
    transition:0.2s;
    box-shadow:0 1px 3px rgba(0,0,0,0.2);
    white-space:nowrap;
}

button:hover{
    transform:scale(1.03);
    background:#e4e4e4;
}

.legenda-ranges{
    display:flex;
    justify-content:center;
    align-items:center;
    gap:30px;
    flex-wrap:wrap;
    background:#ffffff;
    padding:8px 12px;
    margin-top:10px;
    margin-bottom:14px;
    border-radius:6px;
    border:1px solid #999;
    box-shadow:0 1px 3px rgba(0,0,0,0.15);
    font-size:12px;
    font-weight:bold;
}

.legenda-ranges span{
    white-space:nowrap;
}

.table-container{
    overflow-x:auto;
    width:100%;
    border-radius:8px;
    box-shadow:0 1px 4px rgba(0,0,0,0.2);
}

table{
    width:100%;
    border-collapse:collapse;
    background:#fff;
    min-width:1400px;
}

th{
    background:#000;
    color:#fff;
    padding:12px;
    border:1px solid #444;
    font-size:14px;
    font-weight:bold;
    text-align:center;
    white-space:nowrap;
    position:sticky;
    top:0;
    z-index:2;
}

td{
    padding:10px;
    border:1px solid #666;
    text-align:center;
    font-weight:bold;
    font-size:13px;
    word-break:break-word;
    vertical-align:middle;
}

td:nth-child(4){
    min-width:250px;
    text-align:left;
    line-height:1.5;
}

td:nth-child(3){
    white-space:nowrap;
}

tbody tr:nth-child(even){
    background:#fafafa;
}

tbody tr:hover{
    background:#f1f1f1;
    transition:0.2s;
}

.normal{
    background:#00b050;
    color:#ffffff;
}

.verificar{
    background:#0096ff;
    color:#ffffff;
}

.alerta{
    background:#ff0000;
    color:#ffffff;
}

.atencao{
    background:#ffc000;
    color:#000000;
}

.semleitura{
    background:#d9d9d9;
    color:#000000;
}

.inspecao{
    background:#92d050;
    color:#000000;
}

.manutencao{
    background:#ff0000;
    color:#ffff00;
}

footer{
    margin-top:20px;
    padding:12px;
    text-align:center;
    font-size:13px;
    font-weight:bold;
    color:#333;
}

@media(max-width:1200px){
    table{
        font-size:12px;
    }

    th{
        font-size:12px;
        padding:8px;
    }

    td{
        font-size:12px;
        padding:8px;
    }

    button{
        font-size:12px;
        padding:8px 12px;
    }

    h1{
        font-size:18px;
    }
}

@media(max-width:900px){
    .topo{
        padding-top:45px;
        flex-direction: column;
        height: auto;
    }

    #relogio{
        position: relative;
        top: 0;
        right: 0;
        text-align: center;
        margin-top: 5px;
        font-size:12px;
    }

    .buttons{
        justify-content:center;
    }

    button{
        flex:0 0 auto;
    }
}

@media(max-width:600px){
    body{
        padding:6px;
    }

    .topo{
        padding: 15px 10px;
        flex-direction: column;
        height: auto;
    }

    h1{
        font-size:16px;
        line-height:1.4;
    }

    #relogio{
        position: relative;
        top: 0;
        right: 0;
        text-align: center;
        margin-top: 8px;
        font-size:11px;
    }

    .buttons{
        display:grid;
        grid-template-columns:1fr 1fr;
        gap:8px;
        width:100%;
    }

    input[type="file"]{
        grid-column:1 / span 2;
        width:100%;
        font-size:11px;
    }

    button{
        width:100%;
        padding:8px;
        font-size:12px;
    }

    .legenda-ranges{
        font-size:11px;
        gap:10px;
        padding:10px;
    }

    table{
        min-width:1200px;
    }

    td{
        font-size:11px;
    }

    th{
        font-size:11px;
    }
}