:root {
    --primaria: #205F5F;
    --primaria-clara: #2D8484;
    --escuro: #0E2B2B;
    --stone-verde: #00C853;
    --vermelho: #5F2020;
    --cinza-claro: #F8F7F7;
    --branco: #FFFFFF;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Manrope', -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--cinza-claro);
    color: #222;
}

/* ---- Login (tela dividida: marca + formulário) ---- */

.pagina-login {
    display: flex;
    min-height: 100vh;
}

/* Painel esquerdo - marca BVX */
.split-marca {
    position: relative;
    flex: 1 1 46%;
    max-width: 560px;
    background: linear-gradient(155deg, var(--escuro) 0%, var(--primaria) 55%, var(--primaria-clara) 100%);
    color: var(--branco);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 64px 56px;
    overflow: hidden;
}

.split-marca-textura {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.marca-dagua {
    position: absolute;
    opacity: 0.07;
    filter: brightness(0) invert(1);
}

.marca-dagua-1 {
    width: 420px;
    top: -130px;
    right: -150px;
    transform: rotate(18deg);
}

.marca-dagua-2 {
    width: 320px;
    bottom: -110px;
    left: -110px;
    transform: rotate(-24deg);
}

.split-marca-conteudo {
    position: relative;
    z-index: 1;
}

.cartao-logo {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.97);
    padding: 16px 22px;
    border-radius: 14px;
    margin-bottom: 44px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
}

.logo-imagem {
    height: 46px;
    width: auto;
    display: block;
}

.split-marca-titulo {
    font-size: 32px;
    font-weight: 800;
    line-height: 1.28;
    margin: 0 0 16px;
    letter-spacing: -0.5px;
}

.split-marca-texto {
    font-size: 15px;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.78);
    max-width: 380px;
    margin: 0;
}

.split-marca-rodape {
    position: relative;
    z-index: 1;
    margin: 48px 0 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

/* Painel direito - formulário */
.split-form {
    flex: 1 1 54%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: var(--branco);
}

.caixa-login {
    width: 100%;
    max-width: 360px;
}

.caixa-login-icone {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--branco);
    border: 1.5px solid #E3E7E6;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    box-shadow: 0 6px 16px rgba(32, 95, 95, 0.12);
}

.caixa-login-icone img {
    width: 38px;
    height: 38px;
}

.caixa-login h1 {
    margin: 0 0 6px;
    color: #10231F;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.subtitulo {
    margin: 0 0 28px;
    color: #6B7573;
    font-size: 14px;
}

.caixa-login label {
    display: block;
    margin-top: 18px;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #3C4644;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.campo-com-icone {
    position: relative;
    display: flex;
    align-items: center;
}

.campo-com-icone svg {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: #9AA5A3;
    pointer-events: none;
}

.campo-com-icone input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border: 1.5px solid #E3E7E6;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    background: #FBFCFC;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.campo-com-icone input:focus {
    outline: none;
    border-color: var(--stone-verde);
    box-shadow: 0 0 0 3px rgba(0, 200, 83, 0.15);
    background: var(--branco);
}

.caixa-login button {
    width: 100%;
    margin-top: 28px;
    padding: 13px;
    border: none;
    border-radius: 10px;
    background: var(--primaria);
    color: var(--branco);
    font-size: 15px;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.12s, box-shadow 0.12s, background 0.15s;
    box-shadow: 0 8px 20px rgba(32, 95, 95, 0.28);
}

.caixa-login button svg {
    width: 18px;
    height: 18px;
    transition: transform 0.15s;
}

.caixa-login button:hover {
    background: var(--primaria-clara);
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(32, 95, 95, 0.34);
}

.caixa-login button:hover svg {
    transform: translateX(3px);
}

.erro {
    background: #fdecea;
    color: #a12626;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 4px;
}

@media (max-width: 860px) {
    .pagina-login {
        flex-direction: column;
    }
    .split-marca {
        max-width: none;
        padding: 40px 32px;
    }
    .split-marca-titulo {
        font-size: 26px;
    }
    .split-marca-texto {
        display: none;
    }
    .split-marca-rodape {
        margin-top: 20px;
        font-size: 12px;
    }
    .split-form {
        padding: 32px 24px;
    }
}

/* ---- Painel ---- */

.pagina-painel {
    background: var(--cinza-claro);
}

.topo {
    background: var(--branco);
    color: #10231F;
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    border-bottom: 1px solid #EAEDEC;
    position: sticky;
    top: 0;
    z-index: 10;
}

.topo-marca {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

.topo-icone {
    width: 30px;
    height: 30px;
}

.topo-titulo {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.3px;
}

.usuario-logado {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 14px;
}

.usuario-nome {
    color: #4B5654;
    font-weight: 600;
}

.btn-sair {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primaria);
    font-weight: 700;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1.5px solid #E3E7E6;
    transition: background 0.15s, border-color 0.15s;
}

.btn-sair svg {
    width: 16px;
    height: 16px;
}

.btn-sair:hover {
    background: var(--cinza-claro);
    border-color: var(--primaria-clara);
}

main {
    max-width: 1400px;
    margin: 32px auto;
    padding: 0 24px 48px;
}

.mensagem {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 600;
}

.mensagem-sucesso {
    background: #e6f4ea;
    color: #1e7a34;
}

.mensagem-erro {
    background: #fdecea;
    color: #a12626;
}

/* Cartões de indicadores */

.cartoes-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.cartao-stat {
    background: var(--branco);
    border-radius: 14px;
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 2px 10px rgba(16, 35, 31, 0.05);
    border-left: 4px solid var(--primaria-clara);
}

.cartao-stat-numero {
    font-size: 28px;
    font-weight: 800;
    color: #10231F;
    letter-spacing: -0.5px;
}

.cartao-stat-label {
    font-size: 13px;
    color: #6B7573;
    font-weight: 600;
}

.cartao-stat-ativo {
    border-left-color: var(--stone-verde);
}

.cartao-stat-bloqueado {
    border-left-color: var(--vermelho);
}

/* Busca */

.busca {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    max-width: 460px;
}

.busca-campo {
    position: relative;
    flex: 1;
}

.busca-campo svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: #9AA5A3;
    pointer-events: none;
}

.busca-limpar {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #6B7573;
    font-size: 18px;
    line-height: 1;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.busca-limpar:hover {
    background: var(--cinza-claro);
    color: var(--vermelho);
}

.busca input {
    width: 100%;
    padding: 11px 38px 11px 42px;
    border: 1.5px solid #E3E7E6;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    background: var(--branco);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.busca input:focus {
    outline: none;
    border-color: var(--stone-verde);
    box-shadow: 0 0 0 3px rgba(0, 200, 83, 0.15);
}

.busca button {
    padding: 11px 22px;
    border: none;
    border-radius: 10px;
    background: var(--primaria);
    color: var(--branco);
    font-family: inherit;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s;
}

.busca button:hover {
    background: var(--primaria-clara);
}

/* Tabela */

.tabela-scroll {
    overflow-x: auto;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(16, 35, 31, 0.05);
}

table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    background: var(--branco);
    table-layout: fixed;
}

th, td {
    padding: 14px 16px;
    text-align: left;
    font-size: 14px;
    border-bottom: 1px solid #EFF2F1;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Só o CNPJ tem formato fixo curto - as outras colunas podem quebrar linha ou
   cortar com reticências (title mostra o texto completo ao passar o mouse). */
th:nth-child(3), td:nth-child(3) {
    white-space: nowrap;
    width: 175px;
    overflow: visible;
}

th:nth-child(4), td:nth-child(4) {
    white-space: nowrap;
    width: 110px;
}

th:last-child, td:last-child {
    width: 120px;
    white-space: nowrap;
}

th {
    background: #FBFCFC;
    color: #6B7573;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background: #FBFCFC;
}

tr.linha-bloqueada {
    background: #FEF8F8;
}

tr.linha-bloqueada:hover {
    background: #FDF0EF;
}

td.vazio {
    text-align: center;
    color: #888;
    padding: 32px;
    white-space: normal;
}

.cliente-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.cliente-avatar {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--primaria), var(--primaria-clara));
    color: var(--branco);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
}

.cliente-nome {
    font-weight: 700;
    color: #10231F;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.status-ponto {
    position: relative;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.status-ponto::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: currentColor;
    animation: pulso 1.6s ease-out infinite;
}

@keyframes pulso {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }
    100% {
        transform: scale(2.8);
        opacity: 0;
    }
}

.status-ativo {
    background: #e6f4ea;
    color: #1e7a34;
}

.status-bloqueado {
    background: #f8d7da;
    color: #a12626;
}

.btn-bloquear, .btn-desbloquear {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    color: var(--branco);
    transition: opacity 0.15s;
}

.btn-bloquear, .btn-desbloquear {
    opacity: 0.92;
}

.btn-bloquear:hover, .btn-desbloquear:hover {
    opacity: 1;
}

.btn-bloquear {
    background: var(--vermelho);
}

.btn-desbloquear {
    background: var(--primaria);
}

@media (max-width: 640px) {
    .topo {
        padding: 14px 20px;
    }
    .usuario-nome {
        display: none;
    }
    main {
        padding: 0 16px 40px;
    }
    .cartoes-stats {
        grid-template-columns: 1fr;
    }
    .busca {
        max-width: none;
    }
}