html, body {
    margin: 0;
    font-family: "Segoe UI", system-ui, sans-serif;
    color: #1d2433;
}

h1:focus {
    outline: none;
}

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    padding: 10px 20px;
    background: #fff4ce;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, .2);
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 12px;
    top: 8px;
}

/* ---------- Telas de conta: Login, Alterar senha e Registro ---------- */
.conta-cartao { max-width: 400px; margin: 40px auto; padding: 32px; background: #fff; border: 1px solid #e3e6ea; border-radius: 12px; }
.conta-cartao h1 { margin: 0 0 20px 0; font-size: 22px; }
.conta-campo { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.conta-campo input { min-height: 40px; padding: 0 12px; border: 1px solid #cfd5dd; border-radius: 8px; font: inherit; }
.conta-campo input:focus { outline: 2px solid #2f6fde; outline-offset: -1px; }
.conta-campo input[readonly] { background: #f4f5f7; color: #5b6575; }
.conta-campo .validation-message { color: #b42318; font-size: 13px; }
.conta-erro, .conta-ok, .conta-info { margin-bottom: 16px; padding: 10px 12px; border-radius: 8px; font-size: 14px; }
.conta-erro { background: #fdecea; color: #b42318; }
.conta-ok { background: #e7f6ec; color: #1a7f37; }
.conta-info { background: #eaf1fd; color: #1f4f9e; }
.conta-botao { width: 100%; min-height: 42px; border: 0; border-radius: 8px; background: #2f6fde; color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.conta-botao:disabled { opacity: .6; cursor: default; }
.conta-botao-secundario { margin-top: 10px; background: #fff; color: #2f6fde; border: 1px solid #2f6fde; }
.conta-acoes { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; font-size: 14px; }
.conta-acoes a { color: #2f6fde; text-decoration: none; }
.conta-acoes a:hover { text-decoration: underline; }

/* ---------- Aviso de sessão prestes a expirar ---------- */
.aviso-fundo { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(20, 32, 43, .55); }
.aviso-caixa { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 14px; padding: 24px; background: #fff; border-radius: 14px; box-shadow: 0 16px 40px rgba(20, 32, 43, .25); }
.aviso-caixa h2 { margin: 0; font-size: 18px; }
.aviso-caixa p { margin: 0; }
.aviso-acoes { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.aviso-botao { min-height: 38px; padding: 0 18px; border: 1px solid #cfd5dd; border-radius: 8px; background: #fff; color: #1d2433; font: inherit; cursor: pointer; }
.aviso-botao:hover { background: #f0f2f5; }
.aviso-botao-primario { background: #2f6fde; border-color: #2f6fde; color: #fff; }
.aviso-botao-primario:hover { background: #255bb8; }

.aviso-botao-perigo {
    background: #b42318;
    border-color: #b42318;
    color: #fff;
}

    .aviso-botao-perigo:hover {
        background: #912018;
    }

/* ---------- Telas de cadastro (Clientes, Processos, Autorizações) ---------- */
.cad-pagina {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

    .cad-pagina h1 {
        margin: 0;
        font-size: 22px;
    }

    .cad-pagina h2 {
        margin: 0;
        font-size: 18px;
    }

.cad-suave {
    color: #5b6575;
}

.cad-filtros {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    padding: 16px;
    background: #fff;
    border: 1px solid #e3e6ea;
    border-radius: 12px;
}

.cad-campo {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    color: #5b6575;
}

    .cad-campo input, .cad-campo select {
        min-height: 38px;
        min-width: 170px;
        box-sizing: border-box;
        padding: 0 10px;
        border: 1px solid #cfd5dd;
        border-radius: 8px;
        background: #fff;
        color: #1d2433;
        font: inherit;
        font-size: 14px;
    }

        .cad-campo input:focus, .cad-campo select:focus {
            outline: 2px solid #2f6fde;
            outline-offset: -1px;
        }

        .cad-campo input[readonly], .cad-campo select:disabled {
            background: #f4f5f7;
            color: #5b6575;
        }

    .cad-campo .validation-message {
        color: #b42318;
        font-size: 12px;
    }

.cad-espaco {
    flex: 1 1 auto;
}

.cad-botao {
    min-height: 38px;
    padding: 0 16px;
    border: 1px solid #cfd5dd;
    border-radius: 8px;
    background: #fff;
    color: #1d2433;
    font: inherit;
    font-size: 14px;
    cursor: pointer;
}

    .cad-botao:hover {
        background: #f0f2f5;
    }

    .cad-botao:disabled {
        opacity: .6;
        cursor: default;
    }

.cad-botao-primario {
    background: #2f6fde;
    border-color: #2f6fde;
    color: #fff;
}

    .cad-botao-primario:hover {
        background: #255bb8;
    }

.cad-tabela-caixa {
    overflow-x: auto;
    background: #fff;
    border: 1px solid #e3e6ea;
    border-radius: 12px;
}

.cad-tabela {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

    .cad-tabela th {
        padding: 10px 12px;
        background: #f4f5f7;
        color: #5b6575;
        font-weight: 600;
        text-align: left;
        white-space: nowrap;
    }

    .cad-tabela td {
        padding: 10px 12px;
        border-top: 1px solid #eef0f3;
    }

.cad-acoes {
    text-align: right;
    white-space: nowrap;
}

.cad-link {
    padding: 0 6px;
    border: 0;
    background: none;
    color: #2f6fde;
    font: inherit;
    cursor: pointer;
}

    .cad-link:hover {
        text-decoration: underline;
    }

.cad-link-perigo {
    color: #b42318;
}

.cad-vazio {
    margin: 0;
    padding: 20px;
    color: #5b6575;
    text-align: center;
}

.cad-form {
    max-width: 780px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 24px;
    background: #fff;
    border: 1px solid #e3e6ea;
    border-radius: 12px;
}

.cad-grade {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.cad-form-acoes {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.somente-leitor {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------- Impressão: só o conteúdo da tela ---------- */
@media print {
    .tp-lateral, .tp-topo, .nao-imprimir {
        display: none !important;
    }

    .tp-main {
        padding: 0 !important;
    }

    .cad-tabela-caixa {
        border: 0;
    }
}
