* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 14px;
    color: #111827;
    background: #f6f7f9;
}

a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- topo ---------- */
.topo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}
.marca { font-weight: 600; font-size: 16px; color: #111827; }
.marca span { color: #6b7280; font-weight: 500; }
.marca:hover { text-decoration: none; }
.topo form { margin: 0; }
.topo-esq { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }

.abas { display: flex; gap: 4px; }
.abas a { padding: 6px 12px; border-radius: 8px; color: #6b7280; font-weight: 500; }
.abas a:hover { background: #f3f4f6; color: #111827; text-decoration: none; }
.abas a.ativa { background: #eff6ff; color: #2563eb; }

.conteudo { max-width: 1200px; margin: 0 auto; padding: 24px 16px 48px; }

.cabecalho-pagina h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.subtitulo { margin: 4px 0 20px; color: #6b7280; }
.voltar { display: inline-block; margin-bottom: 16px; }

/* ---------- botões ---------- */
.btn {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid #2563eb;
    background: #2563eb;
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.btn:hover { background: #1d4ed8; text-decoration: none; }
.btn.sec { background: #fff; color: #2563eb; }
.btn.sec:hover { background: #eff6ff; }
.btn.perigo { background: #fff; color: #dc2626; border-color: #dc2626; }
.btn.perigo:hover { background: #fee2e2; }
.btn-link { background: none; border: none; color: #6b7280; font: inherit; cursor: pointer; }
.btn-link:hover { color: #111827; }

/* ---------- avisos ---------- */
.aviso { padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; line-height: 1.5; }
.aviso.erro   { background: #fee2e2; color: #991b1b; }
.aviso.ok     { background: #dcfce7; color: #166534; }
.aviso.alerta { background: #fef3c7; color: #92400e; }
.alerta-texto { color: #b45309; }

.selo {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: #e5e7eb;
    color: #374151;
}
.selo.erro { background: #fee2e2; color: #991b1b; }
.selo.ok   { background: #dcfce7; color: #166534; }

.pequeno { font-size: 12px; color: #6b7280; margin-top: 2px; }
.pequeno.alerta-texto { color: #b45309; }
.desc-troca { max-width: 220px; }
.situacao-titulo { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; }
.situacao-titulo .pequeno { margin: 0; }
.vazio {
    padding: 40px;
    text-align: center;
    color: #6b7280;
    background: #fff;
    border: 1px dashed #d1d5db;
    border-radius: 12px;
}

/* ---------- dados da OC ---------- */
.dados {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.dados div {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px 12px;
}
.dados span { display: block; font-size: 12px; color: #6b7280; margin-bottom: 2px; }

/* ---------- tabela ---------- */
.tabela-wrap {
    overflow-x: auto;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid #f0f1f3; }
th { font-size: 12px; font-weight: 600; color: #6b7280; background: #fafafa; white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.linha-erro { background: #fffafa; }
.acoes { display: flex; gap: 8px; justify-content: flex-end; }
.acoes form { margin: 0; }

input.troca {
    width: 130px;
    padding: 7px 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font: inherit;
}
input.troca:focus, .cartao-login input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}

.rodape-form {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 16px;
    flex-wrap: wrap;
}
.rodape-form p { margin: 0; max-width: 640px; }

/* ---------- login ---------- */
.pagina-login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.cartao-login {
    width: 100%;
    max-width: 380px;
    padding: 32px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, .06);
}
.cartao-login h1 { margin: 0; font-size: 24px; font-weight: 600; }
.cartao-login label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: #374151; }
.cartao-login input {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font: inherit;
    margin-bottom: 16px;
}
.cartao-login .btn { width: 100%; padding: 11px; }
