:root {
    --ft-cinza: #424242;
    --ft-azul-claro: #5ac8f5;
    --ft-azul: #3a8ee6;
    --ft-azul-escuro: #2f6fc0;
    --ft-marinho: #1f2a44;
    --ft-verde-agua: #2bb5a5;
    --ft-laranja: #f7931e;
    --ft-roxo: #7b3f6e;
    --ft-degrade: linear-gradient(90deg, var(--ft-azul-claro), var(--ft-azul));
    --ft-degrade-marca: linear-gradient(90deg, var(--ft-roxo), var(--ft-azul), var(--ft-verde-agua), var(--ft-laranja));
    --fundo: #f3f6fa;
    --borda: #dde3ec;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--fundo);
    color: var(--ft-cinza);
}

a { color: var(--ft-azul-escuro); }

h1 { color: var(--ft-marinho); font-weight: 700; font-size: 1.5rem; }

.topo {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.25rem 1rem;
    background: #fff;
    box-shadow: 0 1px 4px rgba(31, 42, 68, .08);
}
.topo::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 4px;
    background: var(--ft-degrade-marca);
}
.topo nav { display: flex; gap: 1rem; align-items: center; font-size: 0.9rem; }
.topo nav a, .topo .link { color: var(--ft-cinza); font-weight: 600; text-decoration: none; margin: 0; }
.topo nav a:hover, .topo .link:hover { color: var(--ft-azul); }
.topo form { margin: 0; }
.usuario { color: var(--ft-azul-escuro); font-weight: 600; }

.marca { display: flex; align-items: center; }
.marca img { height: 64px; width: auto; display: block; }

.conteudo { max-width: 960px; margin: 0 auto; padding: 1rem; }

.cartao {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(31, 42, 68, .06);
    border-top: 4px solid var(--ft-azul-claro);
}
.estreito { max-width: 480px; margin: 1.5rem auto; }

.logo-login { display: block; width: 100%; max-width: 280px; margin: 0 auto 0.5rem; }

.cabecalho { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }

label { display: block; font-weight: 600; margin: 0.9rem 0 0.3rem; color: var(--ft-marinho); font-size: 0.9rem; }
input, select {
    width: 100%;
    padding: 0.65rem 0.75rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--ft-cinza);
    border: 1px solid var(--borda);
    border-radius: 8px;
    background: #fff;
}
input:focus, select:focus {
    outline: none;
    border-color: var(--ft-azul);
    box-shadow: 0 0 0 3px rgba(58, 142, 230, .2);
}
input[type="checkbox"] { width: auto; }

.botao {
    display: inline-block;
    padding: 0.75rem 1.4rem;
    margin-top: 1.25rem;
    background: var(--ft-degrade);
    color: #fff;
    border: 0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(58, 142, 230, .3);
}
.botao:hover { filter: brightness(1.05); }
.cabecalho .botao { margin-top: 0; }

.link {
    background: none;
    border: 0;
    padding: 0;
    margin-left: 1rem;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    text-decoration: underline;
    color: var(--ft-azul-escuro);
}

.preview { display: block; max-width: 100%; max-height: 300px; margin-top: 0.5rem; border-radius: 8px; }

.errorlist { color: #b42318; margin: 0.25rem 0 0; padding-left: 1rem; font-size: 0.9rem; }

.alerta { padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 1rem; border-left: 4px solid; }
.alerta-success { background: #e3f7f4; border-color: var(--ft-verde-agua); }
.alerta-error { background: #fdecea; border-color: #d92d20; }

.total {
    display: inline-block;
    padding: 0.6rem 1rem;
    background: #fff;
    border-radius: 8px;
    border-left: 4px solid var(--ft-laranja);
    font-size: 1.05rem;
}
.total strong { color: var(--ft-marinho); }

.tabela {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(31, 42, 68, .06);
}
.tabela th {
    background: var(--ft-marinho);
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.tabela th, .tabela td { padding: 0.7rem; border-bottom: 1px solid var(--borda); text-align: left; }
.tabela tbody tr:hover { background: #f5faff; }
.tabela .num { text-align: right; white-space: nowrap; font-weight: 600; color: var(--ft-marinho); }

.filtros {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0 1rem;
    align-items: end;
    margin: 1rem 0;
    padding: 0.5rem 1.25rem 1.25rem;
}
.filtros .campo-q { grid-column: span 2; }
.acoes-filtro { display: flex; align-items: center; }
.acoes-filtro .botao { margin-top: 0; }

.paginacao { display: flex; gap: 1rem; justify-content: center; margin: 1rem 0; }
.vazio { color: #777; }

@media (max-width: 640px) {
    .marca img { height: 48px; }
    .topo nav .usuario { display: none; }
    .filtros { grid-template-columns: 1fr 1fr; }
    .filtros .campo-q, .acoes-filtro { grid-column: 1 / -1; }
    .acoes-filtro { margin-top: 1rem; }
    .tabela thead { display: none; }
    .tabela tr { display: block; padding: 0.5rem 0; border-bottom: 1px solid var(--borda); }
    .tabela td { display: flex; justify-content: space-between; border: 0; padding: 0.25rem 0.75rem; }
    .tabela td::before { content: attr(data-label); font-weight: 600; color: var(--ft-marinho); }
}
