/* =========================
   BASE
   ========================= */
*{box-sizing:border-box}
html,body{margin:0;padding:0;min-height:100%;font-family:Arial,Helvetica,sans-serif;color:#202830;background:#f4f6f8}
body{min-height:100vh}

/* =========================
   CABEÇALHO — CENTRADO NA JANELA INTEIRA
   ========================= */
.site-header{
    width:100%;
    background:#fff;
    border-bottom:1px solid #dfe3e7;
    box-shadow:0 1px 5px #0000000b;
    margin:0 0 30px;
}

.header-inner{
    width:100%;
    max-width:none;
    height:150px;
    margin:0;
    padding:0;
    position:relative;
    display:flex;
    justify-content:center;
    align-items:flex-start;
}

/* A imagem é posicionada em relação à viewport, não a um container limitado. */
.header-image{
    position:absolute;
    left:50vw;
    top:10px;
    transform:translateX(-50%);
    display:block;
    width:auto;
    height:auto;
    max-width:min(900px,calc(100vw - 40px));
    max-height:105px;
    object-fit:contain;
    margin:0;
}

/* Usuário centralizado abaixo da imagem. */
.header-user{
    position:absolute;
    left:50vw;
    bottom:12px;
    transform:translateX(-50%);
    display:flex;
    align-items:center;
    justify-content:center;
    gap:14px;
    white-space:nowrap;
    font-size:14px;
    text-align:center;
}

.header-user a{color:#1769aa;text-decoration:none;font-weight:bold}
.header-user a:hover{text-decoration:underline}

/* =========================
   CONTEÚDO
   ========================= */
.container{
    width:min(1100px,calc(100% - 32px));
    margin:0 auto 40px;
}

h1{margin:0 0 8px;font-size:32px;line-height:1.2}
h2{margin:0 0 12px;font-size:22px}
p{line-height:1.5}
.muted{color:#66727e}

.card{
    background:#fff;
    border:1px solid #dfe3e7;
    border-radius:10px;
    padding:22px;
    margin:18px 0;
    box-shadow:0 2px 8px #0000000a;
}

.alert,.error{
    background:#fff0f0;
    color:#a51d2d;
    border:1px solid #f1b8bf;
    border-radius:8px;
    padding:12px 14px;
    margin:15px 0;
}

input[type=file]{max-width:100%;padding:8px}
button{
    border:0;
    border-radius:7px;
    background:#1769aa;
    color:#fff;
    font-weight:700;
    padding:11px 22px;
    cursor:pointer;
}
button:hover{background:#125887}
pre{overflow:auto;background:#f6f7f8;padding:15px;border-radius:7px}

/* =========================
   LOGIN — TUDO CENTRALIZADO
   ========================= */
.login-page{
    min-height:100vh;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:30px 20px;
}

.login-box{
    width:min(560px,100%);
    margin:0 auto;
    background:#fff;
    border:1px solid #dfe3e7;
    border-radius:14px;
    padding:28px;
    box-shadow:0 8px 30px #00000012;
    text-align:center;
}

.login-image{
    display:block;
    width:auto;
    height:auto;
    max-width:100%;
    max-height:180px;
    margin:0 auto 24px;
    object-fit:contain;
}

.login-box h1{font-size:30px;margin:0 0 6px}
.login-box .muted{margin:0 0 22px}
.login-box form{
    width:min(360px,100%);
    margin:0 auto;
    display:flex;
    flex-direction:column;
    align-items:stretch;
    gap:8px;
    text-align:left;
}
.login-box label{font-weight:700;margin-top:4px}
.login-box input[type=text],
.login-box input[type=password]{
    width:100%;
    height:44px;
    padding:0 12px;
    border:1px solid #cbd2d8;
    border-radius:7px;
    background:#fff;
    font-size:16px;
}
.login-box input:focus{outline:2px solid #b8d8ef;outline-offset:1px}
.login-box button{width:100%;height:44px;margin-top:10px}

@media (max-width:700px){
    .header-inner{height:125px}
    .header-image{max-width:calc(100vw - 24px);max-height:82px;top:8px}
    .header-user{bottom:9px;font-size:13px}
    .container{width:calc(100% - 24px)}
    .login-page{padding:18px 12px}
    .login-box{padding:22px 18px}
}

/* =========================
   CONFERÊNCIA POR BIP
   ========================= */
.wide{width:min(1250px,calc(100% - 32px))}
.topbar{display:flex;align-items:center;justify-content:space-between;gap:20px}
.button{display:inline-flex;align-items:center;justify-content:center;text-decoration:none;border-radius:7px;padding:11px 18px;font-weight:700}
.button.secondary{background:#e9edf1;color:#202830}
.scan{display:flex;align-items:end;gap:14px}
.scan .grow{flex:1}
.scan label{display:block;font-weight:700;margin-bottom:6px}
.scan input{width:100%;height:46px;padding:0 12px;border:1px solid #cbd2d8;border-radius:7px;font-size:18px}
.scan input:focus{outline:2px solid #b8d8ef;outline-offset:1px}
.scan button{height:46px;white-space:nowrap}
.scan-help{margin-top:10px;color:#66727e;font-size:14px}
.result{margin-top:14px;padding:12px 14px;border-radius:8px;border:1px solid transparent;min-height:44px}
.result.success{background:#eaf7ea;border-color:#a9d8aa;color:#245d2a}
.result.warning{background:#fff7d6;border-color:#ead27a;color:#705600}
.result.error{background:#fff0f0;border-color:#f1b8bf;color:#a51d2d}
.lista-resumo{display:flex;align-items:center;gap:22px;margin-bottom:14px;flex-wrap:wrap}
.legenda{display:flex;gap:8px;margin-left:auto}
.legenda-item{display:inline-flex;align-items:center;border-radius:999px;padding:4px 10px;font-size:12px;font-weight:700}
.legenda-item.correto{background:#dff3df;color:#245d2a}
.legenda-item.divergente{background:#fff0b8;color:#705600}
.legenda-item.pendente{background:#eef1f4;color:#66727e}
.search{width:100%;height:42px;padding:0 12px;border:1px solid #cbd2d8;border-radius:7px;margin-bottom:14px}
table{width:100%;border-collapse:separate;border-spacing:0;overflow:hidden}
th,td{padding:11px 10px;border-bottom:1px solid #e5e8eb;text-align:left;vertical-align:middle}
th{background:#f7f8f9;font-size:13px;color:#4e5963}
tbody tr.correto{background:#e3f5e3}
tbody tr.divergente{background:#fff1b8}
tbody tr.correto td,tbody tr.divergente td{border-bottom-color:#d5dadd}
tbody tr.correto:hover{background:#d8efd8}
tbody tr.divergente:hover{background:#ffec9b}
@media (max-width:800px){
    .topbar{align-items:flex-start}
    .scan{flex-direction:column;align-items:stretch}
    .scan button{width:100%}
    .lista-resumo{gap:10px}
    .legenda{width:100%;margin-left:0}
    table{font-size:13px}
    th,td{padding:8px 6px}
}
