/* Vetties - Design system */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

:root {
    --cor-primaria: #1a5f4a;
    --cor-primaria-escura: #0f3d30;
    --cor-primaria-clara: #e8f4ef;
    --cor-secundaria: #2d8b6f;
    --cor-acento: #3da882;
    --cor-fundo: #f0f4f2;
    --cor-fundo-elevado: #f8faf9;
    --cor-card: #fff;
    --cor-texto: #1a2420;
    --cor-texto-suave: #5c6b64;
    --cor-borda: #d4e0db;
    --cor-borda-forte: #b8cdc4;
    --sombra-xs: 0 1px 2px rgba(15, 61, 48, 0.06);
    --sombra: 0 2px 8px rgba(15, 61, 48, 0.08), 0 1px 2px rgba(15, 61, 48, 0.04);
    --sombra-md: 0 8px 24px rgba(15, 61, 48, 0.1), 0 2px 6px rgba(15, 61, 48, 0.05);
    --sombra-lg: 0 16px 48px rgba(15, 61, 48, 0.14), 0 4px 12px rgba(15, 61, 48, 0.06);
    --raio: 12px;
    --raio-sm: 8px;
    --raio-lg: 16px;
    --raio-pill: 999px;
    --transicao: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --fonte: 'DM Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --nav-altura: 5rem;
    --largura-conteudo: 960px;
    --largura-conteudo-dashboard: 1200px;
    --focus-ring: 0 0 0 3px rgba(45, 139, 111, 0.35);
}

* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--fonte);
    background: var(--cor-fundo);
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(45, 139, 111, 0.12), transparent),
        radial-gradient(ellipse 60% 40% at 100% 0%, rgba(26, 95, 74, 0.06), transparent);
    color: var(--cor-texto);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: rgba(45, 139, 111, 0.25);
    color: var(--cor-primaria-escura);
}

a {
    color: var(--cor-primaria);
    text-decoration: none;
    transition: color var(--transicao);
}

a:hover { color: var(--cor-primaria-escura); }

.container {
    max-width: var(--largura-conteudo);
    margin: 0 auto;
    padding: 1.75rem 1.5rem 2.5rem;
}

/* Navegação */
.nav-casca {
    position: sticky;
    top: 0;
    z-index: 900;
    width: 100%;
    background: linear-gradient(135deg, var(--cor-primaria-escura) 0%, var(--cor-primaria) 48%, var(--cor-secundaria) 100%);
    box-shadow: 0 4px 20px rgba(15, 61, 48, 0.22);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-topo {
    width: 100%;
    max-width: var(--largura-conteudo);
    margin-left: auto;
    margin-right: auto;
    color: #fff;
    padding: 0 1.5rem;
    min-height: var(--nav-altura);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.nav-casca--dashboard .nav-topo {
    max-width: var(--largura-conteudo-dashboard);
}

.nav-logo {
    padding: 0.35rem 0;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.nav-logo img {
    display: block;
    width: auto;
    max-height: 72px;
    height: auto;
}

.nav-logo:hover {
    text-decoration: none;
    opacity: 0.92;
}

.nav-links {
    list-style: none;
    margin: 0;
    padding: 0.35rem 0;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.45rem 0.75rem;
    border-radius: var(--raio-pill);
    transition: background var(--transicao), color var(--transicao);
}

.nav-links a:hover {
    color: #fff;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.12);
}

.nav-links a.ativo {
    color: var(--cor-primaria-escura);
    background: #fff;
    box-shadow: var(--sombra-xs);
}

.nav-sair,
.nav-configuracoes {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem;
    line-height: 0;
    vertical-align: middle;
    border-radius: var(--raio-pill);
    margin-left: 0.15rem;
}

.nav-sair:hover,
.nav-configuracoes:hover {
    background: rgba(255, 255, 255, 0.12);
    opacity: 1;
}

.nav-sair:focus-visible,
.nav-configuracoes:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.nav-sair svg,
.nav-configuracoes svg {
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-configuracoes.ativo {
    color: var(--cor-primaria-escura);
    background: #fff;
    box-shadow: var(--sombra-xs);
}

@media (max-width: 640px) {
    .nav-topo {
        padding: 0.5rem 1rem;
    }
    .nav-links {
        width: 100%;
        justify-content: flex-start;
        gap: 0.15rem;
    }
    .nav-links a {
        font-size: 0.85rem;
        padding: 0.4rem 0.6rem;
    }
}

/* Página de login / cadastro */
.pagina-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background:
        radial-gradient(ellipse 100% 80% at 20% 0%, rgba(61, 168, 130, 0.35), transparent 50%),
        radial-gradient(ellipse 80% 60% at 100% 100%, rgba(15, 61, 48, 0.5), transparent 55%),
        linear-gradient(145deg, #0a2e24 0%, var(--cor-primaria-escura) 35%, var(--cor-primaria) 65%, var(--cor-secundaria) 100%);
}

.container-login {
    width: 100%;
    max-width: 420px;
    padding: 0;
    animation: entrada-card 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes entrada-card {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-login {
    background: var(--cor-card);
    padding: 2.25rem 2rem;
    border-radius: var(--raio-lg);
    box-shadow: var(--sombra-lg);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.card-login h1 {
    margin: 0 0 1.5rem;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--cor-texto-suave);
    line-height: 1.4;
}

.card-login h1.titulo-cadastro {
    text-align: center;
}

.logo-placeholder {
    margin-top: -1.5rem;
    margin-bottom: -1rem;
    text-align: center;
}

.logo-placeholder img {
    max-width: 100%;
    width: auto;
    max-height: 144px;
    height: auto;
    display: block;
    margin: 0 auto -1.8rem;
}

.pagina-cadastro .logo-placeholder {
    margin-top: -1.5rem;
    margin-bottom: -2rem;
}

.card-login .erro {
    color: #b42318;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    padding: 0.6rem 0.75rem;
    background: #fef3f2;
    border-radius: var(--raio-sm);
    border: 1px solid #fecdca;
}

.card-login .sucesso {
    color: #0a6b0a;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    padding: 0.6rem 0.75rem;
    background: var(--cor-primaria-clara);
    border-radius: var(--raio-sm);
    border: 1px solid rgba(26, 95, 74, 0.15);
}

.card-login .sucesso + .btn { display: inline-block; margin-top: 0.5rem; }

.card-login label {
    display: block;
    margin-top: 1rem;
    margin-bottom: 0.35rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--cor-texto);
}

.card-login input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--cor-borda);
    border-radius: var(--raio-sm);
    font-size: 1rem;
    font-family: inherit;
    background: var(--cor-fundo-elevado);
    transition: border-color var(--transicao), box-shadow var(--transicao), background var(--transicao);
}

.card-login input:focus {
    outline: none;
    border-color: var(--cor-secundaria);
    background: #fff;
    box-shadow: var(--focus-ring);
}

.card-login button {
    margin-top: 1.5rem;
    width: 100%;
    padding: 0.75rem;
    font-weight: 600;
    font-size: 1rem;
}

.dica {
    font-size: 0.85rem;
    color: var(--cor-texto-suave);
    margin-top: 1.25rem;
}

.card-login .dica { text-align: center; }

.card-login .dica a {
    font-weight: 600;
}

/* Botões */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.55rem 1.1rem;
    border: none;
    border-radius: var(--raio-sm);
    font-size: 0.925rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    background: #e8eeeb;
    color: var(--cor-texto);
    box-shadow: var(--sombra-xs);
    transition: background var(--transicao), color var(--transicao), box-shadow var(--transicao), transform 0.1s ease;
}

.btn:hover {
    background: #dce5e1;
    text-decoration: none;
    box-shadow: var(--sombra);
}

.btn:active { transform: translateY(1px); }

.btn:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.btn-primario {
    background: linear-gradient(180deg, var(--cor-secundaria) 0%, var(--cor-primaria) 100%);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-primario:hover {
    background: linear-gradient(180deg, var(--cor-primaria) 0%, var(--cor-primaria-escura) 100%);
    color: #fff;
    text-decoration: none;
}

.btn-secundario {
    background: var(--cor-secundaria);
    color: #fff;
}

.btn-secundario:hover {
    background: var(--cor-primaria);
    color: #fff;
    text-decoration: none;
}

.btn-verde-claro {
    background: #6bb38e;
    color: #fff;
}

.btn-verde-claro:hover {
    background: #58a17d;
    text-decoration: none;
}

.btn-pequeno {
    padding: 0.4rem 0.7rem;
    font-size: 0.85rem;
}
.btn-icone {
    width: 2rem;
    height: 2rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.btn-icone svg {
    width: 1rem;
    height: 1rem;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.btn-perigo {
    background: #fbecef;
    color: #b42318;
}
.btn-perigo:hover {
    background: #f6d9de;
    text-decoration: none;
}

/* Cabeçalho da página — título, busca e ações na mesma linha */
.pagina-header {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    min-width: 0;
    overflow-x: auto;
}
.pagina-header h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--cor-primaria-escura);
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pagina-header > *:not(h1) {
    flex: 0 0 auto;
}
.botoes-header {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.5rem;
}
.pagina-header .botoes-header {
    flex-shrink: 0;
    min-width: min-content;
}
.pagina-header .botoes-header .btn,
.pagina-header > a.btn,
.pagina-header > button.btn {
    white-space: nowrap;
}
.input-busca-lista {
    flex: 0 0 20rem;
    width: 20rem;
    min-width: 16rem;
    max-width: 28rem;
    padding: 0.55rem 0.85rem 0.55rem 2.35rem;
    border: 1px solid var(--cor-borda);
    border-radius: var(--raio-pill);
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--cor-card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%235c6b64' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat 0.75rem center;
    box-sizing: border-box;
    box-shadow: var(--sombra-xs);
    transition: border-color var(--transicao), box-shadow var(--transicao);
}

.input-busca-lista:focus {
    outline: none;
    border-color: var(--cor-secundaria);
    box-shadow: var(--focus-ring);
}

.input-busca-lista::placeholder {
    color: var(--cor-texto-suave);
}
.lista-busca-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: calc(0.75rem * 1.15);
}
.lista-busca-toolbar .input-busca-lista {
    flex: none;
    width: 26rem;
    min-width: 20rem;
    max-width: 36rem;
}
.lista-busca-vazia {
    margin: 0.75rem 0 0;
    font-size: 0.9rem;
    color: #555;
}
.lista-selecao-acoes[hidden] {
    display: none !important;
}
.lista-selecao-acoes {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #fef8f7 0%, #fdf0ef 100%);
    border: 1px solid #f0c9c6;
    border-radius: var(--raio);
    box-shadow: var(--sombra-xs);
}
.lista-selecao-contagem {
    font-size: 0.9rem;
    color: #5c3d3d;
    font-weight: 500;
}
.checkbox-selecionar-item {
    width: 1rem;
    height: 1rem;
    margin: 0;
    cursor: pointer;
    accent-color: var(--cor-primaria, #1a5f4a);
    flex-shrink: 0;
}
.acoes-lista .checkbox-selecionar-item {
    margin-left: 0.15rem;
}

/* Inputs globais */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select,
textarea {
    font-family: inherit;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--cor-secundaria) !important;
    box-shadow: var(--focus-ring);
}

/* Cards e formulários */
.card {
    background: var(--cor-card);
    padding: 1.35rem 1.4rem;
    border-radius: var(--raio);
    box-shadow: var(--sombra);
    margin-bottom: 1.5rem;
    border: 1px solid rgba(212, 224, 219, 0.8);
    transition: box-shadow var(--transicao);
}

.card h2 {
    margin: 0 0 0.85rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--cor-primaria-escura);
    letter-spacing: -0.01em;
}

.form-card {
    background: var(--cor-card);
    padding: 1.65rem;
    border-radius: var(--raio);
    box-shadow: var(--sombra);
    max-width: 480px;
    border: 1px solid rgba(212, 224, 219, 0.8);
}

.form-card label {
    display: block;
    margin-top: 0.85rem;
    margin-bottom: 0.35rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--cor-texto);
}

.form-card input,
.form-card select,
.form-card textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--cor-borda);
    border-radius: var(--raio-sm);
    font-size: 1rem;
    background: var(--cor-fundo-elevado);
    transition: border-color var(--transicao), box-shadow var(--transicao), background var(--transicao);
}

.form-card textarea {
    min-height: 120px;
    resize: vertical;
}

.form-card button { margin-top: 1.15rem; }

/* Ficha do paciente – dados completos */
.card-dados-paciente {
    padding: 0;
    overflow: hidden;
}
.card.card-dados-paciente .card-dados-paciente-titulo {
    margin: 0;
    padding: 1rem 1.25rem;
    font-size: 1.05rem;
    background: linear-gradient(135deg, rgba(26, 95, 74, 0.1) 0%, rgba(45, 139, 111, 0.05) 100%);
    border-bottom: 1px solid rgba(26, 95, 74, 0.12);
    color: var(--cor-primaria-escura);
}
.card-dados-paciente .detalhe-grupo {
    border-radius: var(--raio);
    border: 1px solid #e4ebe8;
    background: linear-gradient(180deg, #fff 0%, #f9fbf9 100%);
    padding: 1rem 1rem 1.05rem;
}
.card-dados-paciente .detalhe-grupo-titulo {
    margin: 0 0 0.85rem;
    padding-bottom: 0;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--cor-primaria);
}
.card-dados-paciente .form-dados-paciente {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 1.25rem;
}
.form-dados-paciente label {
    display: block;
    margin-top: 0.65rem;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--cor-texto-suave);
}
.form-dados-paciente label:first-of-type,
.form-dados-paciente .detalhe-grupo > label:first-child {
    margin-top: 0;
}
.form-dados-paciente input:not([type="file"]),
.form-dados-paciente select,
.form-dados-paciente textarea {
    width: 100%;
    max-width: 100%;
    padding: 0.5rem 0.6rem;
    border: 1px solid #cfd8d3;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
}
.form-dados-paciente textarea {
    resize: vertical;
    min-height: 5rem;
}
.form-dados-paciente .campo-com-acao {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    gap: 0.5rem;
}
.form-dados-paciente .campo-com-acao select {
    width: 100%;
    min-width: 0;
}
.form-dados-paciente .campo-com-acao > .btn {
    align-self: stretch;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    white-space: nowrap;
    margin: 0;
    padding: 0.5rem 0.6rem;
    font-size: 1rem;
    box-sizing: border-box;
}
.form-dados-paciente-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 0.75rem;
}
@media (max-width: 640px) {
    .form-dados-paciente-grid-2 {
        grid-template-columns: 1fr;
    }
}
.form-dados-paciente-ajuda {
    margin: 0.5rem 0 0;
    font-size: 0.8rem;
    color: var(--cor-texto-suave);
    line-height: 1.4;
}
#form-configuracoes label[for="cfg-crmv"],
#form-configuracoes label[for="cfg-telefone"],
#form-configuracoes label[for="cfg-email"],
#form-configuracoes label[for="cfg-nova-senha"],
#form-configuracoes label[for="cfg-confirmar-senha"] {
    margin-top: 0.715rem;
}
.form-dados-paciente-acoes {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-top: 0.25rem;
    padding-top: 0;
}

.config-logotipo-preview {
    margin: 0.75rem 0 0.5rem;
    padding: 0.75rem;
    border: 1px dashed #cfd8d3;
    border-radius: var(--raio-sm);
    background: #fff;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
}
.config-logotipo-preview[hidden] {
    display: none !important;
}
.config-logotipo-preview img {
    display: block;
    max-width: 220px;
    max-height: 80px;
    width: auto;
    height: auto;
    object-fit: contain;
}
.config-logotipo-excluir {
    margin: 0;
}
.config-logotipo-excluir[hidden] {
    display: none !important;
}
#cfg-logotipo {
    display: block;
    width: auto;
    max-width: max-content;
    margin-top: 0.15rem;
    padding: 0;
    border: none;
    background: transparent;
    color: transparent;
    font-size: 0;
}
#cfg-logotipo::file-selector-button,
#cfg-logotipo::-webkit-file-upload-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.1rem;
    margin: 0;
    border: none;
    border-radius: var(--raio-sm);
    font-size: 0.925rem;
    font-weight: 600;
    font-family: inherit;
    line-height: 1.4;
    cursor: pointer;
    background: #6bb38e;
    color: #fff;
    box-shadow: var(--sombra-xs);
    transition: background var(--transicao), box-shadow var(--transicao), transform 0.1s ease;
}
#cfg-logotipo:hover::file-selector-button,
#cfg-logotipo:hover::-webkit-file-upload-button {
    background: #58a17d;
    box-shadow: var(--sombra);
}
#cfg-logotipo:active::file-selector-button,
#cfg-logotipo:active::-webkit-file-upload-button {
    transform: translateY(1px);
}
#cfg-logotipo:focus-visible {
    outline: none;
}
#cfg-logotipo:focus-visible::file-selector-button,
#cfg-logotipo:focus-visible::-webkit-file-upload-button {
    box-shadow: var(--focus-ring);
}

/* Laudo — dados acima do editor */
.form-laudo-dados {
    margin-bottom: 1.25rem;
    padding-bottom: 0;
}
.form-laudo-dados-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 1.1rem 1.35rem;
    align-items: start;
}
.form-laudo-campo--data { grid-column: span 3; }
.form-laudo-campo--nome { grid-column: span 9; }
.form-laudo-campo--especie,
.form-laudo-campo--raca,
.form-laudo-campo--genero,
.form-laudo-campo--idade,
.form-laudo-campo--peso,
.form-laudo-campo--castrado { grid-column: span 4; }
.form-laudo-campo--tutor,
.form-laudo-campo--veterinario { grid-column: 1 / -1; }
.form-laudo-dados .form-laudo-campo {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}
.form-laudo-dados .form-laudo-campo label {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--cor-texto-suave);
}
.form-laudo-dados .form-laudo-campo input,
.form-laudo-dados .form-laudo-campo select {
    width: 100%;
    max-width: 100%;
    padding: 0.5rem 0.6rem;
    border: 1px solid #cfd8d3;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    margin: 0;
    box-sizing: border-box;
}
.form-laudo-dados .campo-com-acao {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    gap: 0.5rem;
}
.form-laudo-dados .campo-com-acao select {
    width: 100%;
    min-width: 0;
}
.form-laudo-dados .campo-com-acao > .btn {
    align-self: stretch;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    white-space: nowrap;
    margin: 0;
    padding: 0.5rem 0.6rem;
    font-size: 1rem;
    box-sizing: border-box;
}
@media (max-width: 640px) {
    .form-laudo-dados-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .form-laudo-campo--data,
    .form-laudo-campo--nome,
    .form-laudo-campo--especie,
    .form-laudo-campo--raca,
    .form-laudo-campo--genero,
    .form-laudo-campo--idade,
    .form-laudo-campo--peso,
    .form-laudo-campo--castrado,
    .form-laudo-campo--tutor,
    .form-laudo-campo--veterinario {
        grid-column: 1 / -1;
    }
}

/* Tabelas */
.tabela-wrapper {
    overflow-x: auto;
    border-radius: var(--raio);
    box-shadow: var(--sombra);
    border: 1px solid rgba(212, 224, 219, 0.8);
}

.tabela {
    width: 100%;
    border-collapse: collapse;
    background: var(--cor-card);
    border-radius: var(--raio);
    overflow: hidden;
}



.tabela th,
.tabela td {
    padding: 0.7rem 0.9rem;
    text-align: left;
    border-bottom: 1px solid var(--cor-borda);
}

.tabela th {
    background: linear-gradient(180deg, var(--cor-primaria-clara) 0%, #f0f7f4 100%);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--cor-primaria-escura);
}

.tabela tbody tr {
    transition: background var(--transicao);
}

.tabela tbody tr:hover {
    background: rgba(232, 244, 239, 0.5);
}

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

.tabela .btn { margin-right: 0.25rem; }
.acoes-lista {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}
.acoes-lista-nowrap {
    flex-wrap: nowrap;
}
.acoes-lista .btn-icone {
    flex: 0 0 auto;
}
.tabela .acoes-lista .btn { margin-right: 0; }

/* Lista de exames (início, exames.php, veterinário) — colunas legíveis; ações em linha única */
.tabela-exames {
    width: 100%;
    table-layout: auto;
    border-collapse: collapse;
}
.tabela-exames th,
.tabela-exames td {
    vertical-align: middle;
    padding: 0.65rem 0.9rem;
}
.tabela-exames th:nth-child(1),
.tabela-exames td:nth-child(1) {
    white-space: nowrap;
    min-width: 7.25rem;
    width: 1%;
}
.tabela-exames th:nth-child(2),
.tabela-exames td:nth-child(2) {
    min-width: 8rem;
    max-width: 14rem;
    overflow-wrap: break-word;
    word-break: normal;
}
.tabela-exames th:nth-child(3),
.tabela-exames td:nth-child(3) {
    min-width: 7.5rem;
    max-width: 16rem;
    overflow-wrap: break-word;
    word-break: normal;
}
.tabela-exames th:nth-child(n + 4):not(:last-child),
.tabela-exames td:nth-child(n + 4):not(:last-child) {
    min-width: 6.5rem;
    max-width: 18rem;
    overflow-wrap: break-word;
    word-break: normal;
}
.tabela-exames th:last-child,
.tabela-exames td:last-child {
    white-space: nowrap;
    width: 1%;
    min-width: 9rem;
    text-align: left;
}
.tabela-exames td:last-child .acoes-lista {
    flex-wrap: nowrap;
    justify-content: flex-start;
}
.tabela-exames--5col th:last-child,
.tabela-exames--5col td:last-child {
    min-width: 6.75rem;
}
.coluna-titulo-modelo {
    white-space: nowrap;
    width: 1%;
}
.coluna-previa-modelo {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.coluna-acoes-modelo {
    white-space: nowrap;
    width: 1%;
    min-width: 9.5rem;
}
.wizard-pacientes-wrapper { margin-top: 0.25rem; }
.tabela-selecao-paciente tbody tr.linha-paciente { cursor: pointer; }
.tabela-selecao-paciente th.coluna-aproveitar-paciente {
    white-space: nowrap;
    width: 1%;
    min-width: 9.25rem;
    text-align: center;
}
.tabela-selecao-paciente td.coluna-aproveitar-paciente {
    width: 1%;
    min-width: 9.25rem;
    text-align: center;
    white-space: nowrap;
}
.checkbox-aproveitar-laudo {
    width: 16px;
    height: 16px;
    cursor: pointer;
}
.checkbox-aproveitar-laudo:disabled {
    cursor: not-allowed;
}
.tabela-selecao-paciente tbody tr.linha-paciente:hover {
    background: #f0f9f5;
}
.tabela-selecao-paciente tbody tr.linha-paciente:focus-visible {
    outline: 2px solid var(--cor-secundaria);
    outline-offset: -2px;
}
.tabela-selecao-paciente tbody tr.linha-paciente.selecionado {
    background: #e3f3ec;
    box-shadow: inset 4px 0 0 var(--cor-primaria);
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 61, 48, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    animation: modal-fade 0.2s ease both;
}

@keyframes modal-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-conteudo {
    background: var(--cor-card);
    padding: 1.65rem;
    border-radius: var(--raio-lg);
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--sombra-lg);
    border: 1px solid rgba(212, 224, 219, 0.9);
    animation: entrada-card 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.modal-conteudo-amplo { max-width: 820px; }

.modal-conteudo label {
    display: block;
    margin-top: 0.65rem;
    margin-bottom: 0.3rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.modal-conteudo input,
.modal-conteudo select,
.modal-conteudo textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--cor-borda);
    border-radius: var(--raio-sm);
    font-family: inherit;
    background: var(--cor-fundo-elevado);
}
.botoes-modal { margin-top: 1rem; display: flex; gap: 0.5rem; justify-content: flex-end; }
.botoes-modal-cadastro { justify-content: flex-start; }

/* Modal — envio de laudo por e-mail */
.modal-email-laudo {
    position: relative;
    max-width: 440px;
    padding: 0;
    overflow: hidden;
}

.modal-email-laudo-fechar {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 1px solid var(--cor-borda);
    border-radius: 50%;
    background: var(--cor-card);
    color: var(--cor-texto-suave);
    cursor: pointer;
    transition: background var(--transicao), color var(--transicao), border-color var(--transicao), box-shadow var(--transicao);
}

.modal-email-laudo-fechar:hover {
    background: var(--cor-fundo-elevado);
    color: var(--cor-texto);
    border-color: var(--cor-borda-forte);
    box-shadow: var(--sombra-xs);
}

.modal-email-laudo-fechar:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.modal-email-laudo-fechar svg {
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
}

.modal-email-laudo-cabecalho {
    padding: 1.5rem 3rem 1.15rem 1.5rem;
    background: linear-gradient(180deg, var(--cor-primaria-clara) 0%, rgba(232, 244, 239, 0.35) 100%);
    border-bottom: 1px solid rgba(212, 224, 219, 0.75);
}

.modal-email-laudo-titulo-grupo h2 {
    margin: 0 0 0.14rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--cor-primaria-escura);
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.modal-email-laudo-descricao {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--cor-texto-suave);
}

.email-laudo-opcoes {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 1.15rem 1.5rem 0.25rem;
}

#modal-email-laudo .email-laudo-opcao {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    margin: 0;
    cursor: pointer;
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--cor-borda);
    border-radius: var(--raio-sm);
    background: var(--cor-fundo-elevado);
    transition: border-color var(--transicao), background var(--transicao), box-shadow var(--transicao), opacity var(--transicao);
}

#modal-email-laudo .email-laudo-opcao:hover:not(.email-laudo-opcao--indisponivel) {
    border-color: var(--cor-borda-forte);
    box-shadow: var(--sombra-xs);
}

#modal-email-laudo .email-laudo-opcao:focus-within:not(.email-laudo-opcao--indisponivel) {
    outline: none;
    box-shadow: var(--focus-ring);
}

#modal-email-laudo .email-laudo-opcao:has(.email-laudo-checkbox:checked) {
    background: var(--cor-primaria-clara);
    border-color: rgba(45, 139, 111, 0.45);
    box-shadow: inset 3px 0 0 var(--cor-primaria);
}

#modal-email-laudo .email-laudo-opcao--indisponivel {
    opacity: 0.62;
    cursor: not-allowed;
}

.email-laudo-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.email-laudo-opcao-corpo {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.email-laudo-papel {
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--cor-texto);
    line-height: 1.35;
}

.email-laudo-nome {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--cor-texto);
    line-height: 1.35;
}

.email-laudo-endereco {
    display: block;
    font-size: 0.85rem;
    color: var(--cor-texto-suave);
    word-break: break-word;
    line-height: 1.35;
}

.email-laudo-opcao--indisponivel .email-laudo-endereco {
    font-style: italic;
}

.email-laudo-marcador {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    margin-top: 0.1rem;
    border: 2px solid var(--cor-borda-forte);
    border-radius: 8px;
    background: var(--cor-card);
    transition: border-color var(--transicao), background var(--transicao), box-shadow var(--transicao);
    position: relative;
}

.email-laudo-opcao:has(.email-laudo-checkbox:checked) .email-laudo-marcador {
    border-color: var(--cor-primaria);
    background: var(--cor-primaria);
    box-shadow: var(--sombra-xs);
}

.email-laudo-opcao:has(.email-laudo-checkbox:checked) .email-laudo-marcador::after {
    content: '';
    position: absolute;
    left: 0.72rem;
    top: 0.38rem;
    width: 0.55rem;
    height: 1rem;
    border: solid #fff;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

.modal-email-laudo-feedback {
    margin: 0.75rem 1.5rem 0;
    padding: 0.55rem 0.75rem;
    border-radius: var(--raio-sm);
}

#modal-email-laudo .erro.modal-email-laudo-feedback {
    background: #fdf0ef;
    border: 1px solid #f0c9c6;
}

#modal-email-laudo .sucesso.modal-email-laudo-feedback {
    background: #eef8f0;
    border: 1px solid #b8dcc4;
}

.modal-email-laudo-acoes {
    margin: 0;
    padding: 1.15rem 1.5rem 1.5rem;
    gap: 0.65rem;
    border-top: 1px solid rgba(212, 224, 219, 0.65);
    background: var(--cor-fundo-elevado);
}

.modal-email-laudo-acoes .btn {
    min-width: 6.5rem;
}

/* Upload */
.upload-area {
    border: 2px dashed var(--cor-borda-forte);
    border-radius: var(--raio);
    padding: 2.25rem 1.5rem;
    text-align: center;
    background: var(--cor-fundo-elevado);
    margin-bottom: 1rem;
    transition: border-color var(--transicao), background var(--transicao), box-shadow var(--transicao);
}

.upload-area.drag {
    border-color: var(--cor-secundaria);
    background: var(--cor-primaria-clara);
    box-shadow: inset 0 0 0 1px rgba(45, 139, 111, 0.2);
}
.upload-label { cursor: pointer; color: var(--cor-primaria); font-weight: 500; }
.lista-imagens { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; }
.imagem-item { border: 1px solid #eee; border-radius: var(--raio); overflow: hidden; background: #fff; }
.imagem-item img { width: 100%; height: 140px; object-fit: cover; display: block; }
.imagem-item-preview { cursor: pointer; }
.modal-imagem-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.92);
    box-sizing: border-box;
}
.modal-imagem-fullscreen[hidden] {
    display: none !important;
}
.modal-imagem-viewport {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 0;
}
.modal-imagem-viewport img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}
.modal-imagem-fechar {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 2001;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: #222;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
    transition: background 0.15s ease, transform 0.15s ease;
}
.modal-imagem-fechar:hover {
    background: #fff;
    transform: scale(1.05);
}
.modal-imagem-fechar svg {
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
}
.imagem-acoes {
    padding: 0.55rem 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.imagem-acoes-botoes {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
}

.imagem-acoes-botoes .btn-icone {
    flex: 0 0 auto;
}

.btn-icone.btn-carregando {
    opacity: 0.65;
    cursor: wait;
}

/* Medidas */
.medidas-topo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}
.medidas-topo p { margin: 0; }
.wizard-medidas-manual { margin-top: 1.25rem; }
#tabela-medidas input,
#tabela-medidas-manual input { width: 100%; padding: 0.35rem; border: 1px solid #ddd; border-radius: 4px; }
#tabela-medidas .medida-unidade,
#tabela-medidas-manual .medida-unidade { max-width: 60px; }
.modelo-laudo-campo {
    min-width: min(100%, 320px);
    flex: 1 1 320px;
}
.modelo-laudo-campo--full {
    flex: none;
    width: 100%;
    min-width: 0;
    margin-bottom: 1rem;
}
.wizard-imagens-medidas { margin-top: 1.25rem; }
.lista-imagens-medidas {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid rgba(212, 224, 219, 0.8);
    border-radius: var(--raio);
    background: var(--cor-card);
    box-shadow: var(--sombra);
    overflow: hidden;
}
.imagem-medidas-linha {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--cor-borda);
}
.imagem-medidas-linha:last-child {
    border-bottom: none;
}
.imagem-medidas-linha__esquerda {
    flex: 0 0 200px;
    max-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
}
.imagem-medidas-thumb-wrap {
    width: 100%;
    line-height: 0;
}
.imagem-medidas-thumb-wrap img.imagem-medidas-thumb {
    display: block;
    width: 100%;
    height: auto;
    max-width: 200px;
    object-fit: contain;
    border-radius: var(--raio);
    border: 1px solid #eee;
    background: #fafafa;
    cursor: pointer;
    transition: opacity 0.15s ease;
}
.imagem-medidas-thumb-wrap img.imagem-medidas-thumb:hover {
    opacity: 0.88;
}
.imagem-medidas-linha__meta {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    align-items: flex-start;
}
.imagem-medidas-linha__direita {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
}
.imagem-medidas-linha .imagem-medidas-orgao {
    width: 100%;
    margin: 0;
    padding: 0.45rem 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.35;
    box-sizing: border-box;
}
.imagem-medidas-linha .imagem-medidas-orgao:focus,
.imagem-medidas-linha .imagem-medidas-texto:focus {
    border-color: var(--cor-primaria, #2a7a5e);
    box-shadow: 0 0 0 2px rgba(42, 122, 94, 0.15);
    outline: none;
}
.imagem-medidas-linha .imagem-medidas-texto {
    flex: 1 1 auto;
    width: 100%;
    margin: 0;
    padding: 0.45rem 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.35;
    resize: none;
    overflow-y: auto;
    box-sizing: border-box;
}
.imagem-medidas-linha .imagem-medidas-orgao:disabled,
.imagem-medidas-linha .imagem-medidas-texto:disabled {
    background: #f5f5f5;
    color: var(--cor-texto-suave);
}
.imagem-medidas-linha .status-ocr {
    font-size: 0.8rem;
    padding: 0.25rem 0.4rem;
    border-radius: 4px;
}
.imagem-medidas-linha .status-ocr[hidden] {
    display: none !important;
}
.imagem-medidas-linha .status-ocr.ok { color: #0a6b0a; background: #f1faf3; }
.imagem-medidas-linha .status-ocr.erro { color: #b00020; background: #fbecef; }
@media (max-width: 640px) {
    .imagem-medidas-linha {
        flex-direction: column;
        align-items: stretch;
    }
    .imagem-medidas-linha__esquerda {
        flex: none;
        max-width: none;
        width: 100%;
    }
}
.audio-orgao-medidas-imagem {
    margin: 0.5rem 0 0;
    padding: 0.5rem 0.65rem;
    font-size: 0.85rem;
    line-height: 1.45;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e8e8e8;
}
.audio-orgao-medidas-imagem p {
    margin: 0 0 0.25rem;
}
.audio-orgao-medidas-imagem p:last-child {
    margin-bottom: 0;
}
.modelo-laudo-campo label {
    display: block;
    margin: 0 0 0.25rem;
    font-size: 0.9rem;
}
.modelo-laudo-campo select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95rem;
    background: #fff;
}
.modelo-laudo-dica {
    margin-top: 0.25rem;
    margin-bottom: 0;
}
.mt { margin-top: 1rem; }
.aviso { background: #fff8e6; padding: 0.75rem; border-radius: 4px; margin-top: 1rem; font-size: 0.9rem; }

/* Laudo */
.card-laudo textarea { width: 100%; min-height: 320px; padding: 0.75rem; border: 1px solid #ccc; border-radius: 4px; font-family: inherit; font-size: 0.95rem; line-height: 1.5; resize: vertical; }
.botoes-laudo {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-top: 0.5rem; }
.form-grid label { display: block; margin-bottom: 0.25rem; font-size: 0.9rem; }
.form-grid input, .form-grid select { width: 100%; padding: 0.5rem; border: 1px solid #ccc; border-radius: 4px; }
.botoes-form { margin-top: 1.25rem; display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; }
.campo-com-acao { display: flex; gap: 0.5rem; align-items: center; }
.campo-com-acao select,
.campo-com-acao input:not(.busca-veterinario-input) { flex: 1; }

/* Modal novo paciente: busca de veterinário + botão na mesma linha */
.modal-conteudo .campo-com-acao--busca-vet {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    column-gap: 0.5rem;
    width: 100%;
    margin-top: 0;
}
.modal-conteudo .campo-com-acao--busca-vet .busca-veterinario {
    position: relative;
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.modal-conteudo .campo-com-acao--busca-vet .busca-veterinario-input {
    width: 100%;
    display: block;
    box-sizing: border-box;
    flex: 1;
    min-height: 100%;
}
.modal-conteudo .campo-com-acao--busca-vet > .btn {
    align-self: stretch;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    white-space: nowrap;
    margin: 0;
    padding: 0.6rem 0.75rem;
    font-size: inherit;
    box-sizing: border-box;
}
.busca-veterinario-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    z-index: 1100;
    margin: 0;
    padding: 0.25rem 0;
    max-height: 11rem;
    overflow-y: auto;
    overflow-x: hidden;
    background: #fff;
    border: 1px solid var(--cor-borda, #dde3ea);
    border-radius: var(--raio-sm, 6px);
    box-shadow: var(--sombra-md, 0 4px 12px rgba(0, 0, 0, 0.12));
}
.busca-veterinario-dropdown.is-aberto {
    display: block;
}
.busca-veterinario-opcao {
    padding: 0.55rem 0.75rem;
    font-size: 0.9rem;
    line-height: 1.35;
    cursor: pointer;
    color: var(--cor-texto, #1a1a1a);
}
.busca-veterinario-opcao:hover,
.busca-veterinario-opcao:focus {
    background: var(--cor-primaria-clara, #e8f5f0);
    outline: none;
}

.lista-veterinarios-exames {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.lista-veterinarios-exames-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--cor-borda, #dde3ea);
    border-radius: 8px;
    background: #fafbfc;
}
.lista-veterinarios-exames-info {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.75rem;
    min-width: 0;
}
.lista-veterinarios-exames-clinica {
    color: #5a6570;
    font-size: 0.9rem;
}
.lista-veterinarios-exames-contagem {
    font-size: 0.85rem;
    color: #6b7785;
}

/* Wizard de novo laudo */
.wizard-stepper {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    counter-reset: step;
}
.wizard-stepper .step {
    flex: 1 1 11.5rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.7rem 1rem;
    background: var(--cor-card);
    border-radius: var(--raio);
    border: 1px solid var(--cor-borda);
    color: var(--cor-texto-suave);
    font-size: 0.9rem;
    box-shadow: var(--sombra-xs);
    transition: border-color var(--transicao), box-shadow var(--transicao), background var(--transicao);
}

.wizard-stepper .step-num {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e8eeeb;
    color: var(--cor-texto-suave);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.wizard-stepper .step.ativo {
    border-color: var(--cor-secundaria);
    color: var(--cor-primaria);
    background: var(--cor-primaria-clara);
    box-shadow: var(--sombra);
}

.wizard-stepper .step.ativo .step-num {
    background: linear-gradient(180deg, var(--cor-secundaria), var(--cor-primaria));
    color: #fff;
}

.wizard-stepper .step.feito {
    background: rgba(232, 244, 239, 0.9);
    border-color: rgba(45, 139, 111, 0.35);
    color: var(--cor-primaria-escura);
}

.wizard-stepper .step.feito .step-num {
    background: var(--cor-primaria);
    color: #fff;
}
.wizard-stepper .step-label {
    font-weight: 500;
    white-space: nowrap;
}

.wizard-tela select[size] {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95rem;
    margin-top: 0.25rem;
    background: #fff;
}
.wizard-tela input[type="date"],
.wizard-tela input[type="text"] {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    margin-top: 0.25rem;
}
.wizard-tela label {
    display: block;
    margin-top: 0.9rem;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}
.wizard-campos-topo {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}
.wizard-campo-data {
    flex: 0 0 auto;
    max-width: 220px;
}
.wizard-campo-busca {
    flex: 1 1 auto;
    width: 100%;
}
.wizard-campo-busca label {
    display: block;
    margin-top: 0;
    margin-bottom: 0.3rem;
}
.wizard-campo-veterinario {
    margin-top: 1.25rem;
}
.wizard-campo-veterinario label {
    margin-top: 0;
}
.wizard-campo-busca .campo-com-acao,
.wizard-campo-veterinario .campo-com-acao {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 13rem;
    column-gap: 0.5rem;
    align-items: stretch;
    width: 100%;
}
.wizard-campo-busca .campo-com-acao input[type="text"],
.wizard-campo-veterinario .campo-com-acao .busca-veterinario-input {
    width: 100%;
    min-width: 0;
    margin-top: 0;
    box-sizing: border-box;
    min-height: calc(1rem + 1rem + 2px);
}
.wizard-campo-veterinario .campo-com-acao .busca-veterinario {
    width: 100%;
    min-width: 0;
    position: relative;
}
.wizard-campo-busca .campo-com-acao .btn,
.wizard-campo-veterinario .campo-com-acao .btn {
    width: 100%;
    margin: 0;
    padding: 0.55rem 0.65rem;
    font-size: 0.925rem;
    white-space: nowrap;
    box-sizing: border-box;
    align-self: stretch;
}
.wizard-tela select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    margin-top: 0.25rem;
    background: #fff;
    min-height: calc(1rem + 1rem + 2px);
}

#dropzone-novo { position: relative; }
#contagem-arquivos { margin-top: 0.6rem; }

.lista-imagens .imagem-item .imagem-acoes p { margin: 0; font-size: 0.75rem; color: var(--cor-texto-suave); }
.imagem-item .status-ocr {
    padding: 0.45rem 0.5rem;
    font-size: 0.75rem;
    border-top: 1px solid #eee;
    background: #fafafa;
    color: var(--cor-texto-suave);
    min-height: 1.6rem;
}
.imagem-item .status-ocr.ok { color: #0a6b0a; background: #f1faf3; }
.imagem-item .status-ocr.erro { color: #b00020; background: #fbecef; }

/* Editor Quill */
.editor-toolbar { border: 1px solid #ccc; border-bottom: 0; border-radius: 4px 4px 0 0; background: #fafafa; }
.editor-quill { min-height: 280px; border: 1px solid #ccc; border-radius: 0 0 4px 4px; background: #fff; }
.editor-quill .ql-editor { min-height: 280px; font-size: 0.95rem; line-height: 1.5; }

/* Página laudo.php: áudio acima da barra Quill e do editor */
.laudo-editor-stack .laudo-gravar-audio-linha {
    border: none;
    background: #fff;
    padding: 0.55rem 0;
    align-items: flex-start;
    width: 100%;
}
.laudo-editor-stack .editor-toolbar {
    border: 1px solid #ccc;
    border-bottom: 0;
    border-radius: 4px 4px 0 0;
}
.laudo-gravar-audio-linha {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    margin: 0;
    padding: 0.55rem 0.75rem;
}
.laudo-gravar-audio-linha .audio-laudo {
    margin: 1rem 0 1rem;
    flex-wrap: wrap;
    align-self: flex-start;
    width: auto;
}
.laudo-gravar-audio-linha .erro,
.laudo-gravar-audio-linha .sucesso {
    width: 100%;
    margin: 0.15rem 0 0;
}
.laudo-editor-stack .editor-quill {
    border-top: none;
    border-radius: 0 0 4px 4px;
}

/* Bloco de gravação de áudio (Tela 3) */
.audio-laudo {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin: 1rem 0 1.25rem;
}
.btn-audio {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    background: #2d8b6f;
    color: #fff;
    padding: 0.65rem 1.25rem;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 1px 3px rgba(45,139,111,0.25);
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}
.btn-audio:hover { background: #226e58; box-shadow: 0 2px 6px rgba(45,139,111,0.35); }
.btn-audio:active { transform: translateY(1px); }
.btn-audio[disabled] { opacity: 0.6; cursor: not-allowed; }
.btn-audio .audio-icone {
    color: #d72626;
    font-size: 0.9rem;
    line-height: 1;
    animation: audio-icone-loop 1.1s ease-in-out infinite;
    display: inline-block;
    transform-origin: center;
}
.btn-audio.gravando { background: #c0392b; box-shadow: 0 1px 3px rgba(192,57,43,0.3); }
.btn-audio.gravando:hover { background: #962d22; }
.btn-audio.gravando .audio-icone { color: #ff2a2a; animation: audio-icone-loop 0.8s ease-in-out infinite; }
.audio-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #c0392b;
    font-weight: 600;
}
.audio-pulse {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #c0392b;
    box-shadow: 0 0 0 0 rgba(192,57,43,0.6);
    animation: audio-pulse-circle 1.1s ease-out infinite;
}
@keyframes audio-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes audio-icone-loop {
    0%, 100% { transform: scale(1); opacity: 0.95; }
    50% { transform: scale(1.22); opacity: 1; }
}
@keyframes audio-pulse-circle {
    0% { box-shadow: 0 0 0 0 rgba(192,57,43,0.65); }
    70% { box-shadow: 0 0 0 12px rgba(192,57,43,0); }
    100% { box-shadow: 0 0 0 0 rgba(192,57,43,0); }
}

.erro { color: #c0392b; font-size: 0.9rem; margin: 0.4rem 0; }
.sucesso { color: #0a6b0a; font-size: 0.9rem; margin: 0.4rem 0; }
#audio-texto-transcrito { font-family: inherit; font-size: 0.95rem; line-height: 1.5; }
#audio-texto-transcrito-laudo { font-family: inherit; font-size: 0.95rem; line-height: 1.5; }
#audio-preview-player { margin-top: 0.5rem; }
#audio-preview-player-laudo { margin-top: 0.5rem; }
#audio-preview-duracao { margin-top: 0.4rem; margin-bottom: 0; }
#audio-preview-duracao-laudo { margin-top: 0.4rem; margin-bottom: 0; }
.audio-orgao-grid {
    --audio-orgao-gap: 0.85rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--audio-orgao-gap);
    margin: calc(var(--audio-orgao-gap) * 0.5) 0 0.5rem;
}
.audio-orgao-topo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.36rem;
    flex-wrap: wrap;
}
.audio-orgao-topo h2 {
    margin: 0;
}
.audio-orgao-grid > div {
    width: 100%;
}
.audio-orgao-lista {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0;
    justify-content: center;
}
#modal-audio-orgao .audio-orgao-lista .btn.btn-primario {
    background: linear-gradient(180deg, #1f6b55 0%, #124838 100%);
    border-color: rgba(0, 0, 0, 0.2);
}
#modal-audio-orgao .audio-orgao-lista .btn.btn-primario:hover {
    background: linear-gradient(180deg, #185441 0%, #0d3328 100%);
}
.audio-orgao-imagem-box {
    margin-top: 0;
    min-height: 300px;
    border: 0;
    border-radius: 0;
    padding: 0;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
}
.audio-orgao-carrossel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    max-width: 100%;
    margin: 0 auto;
}
.audio-orgao-imagem-box .audio-orgao-carrossel {
    align-self: center;
}
.audio-orgao-carrossel-viewport {
    position: relative;
    flex: 0 1 auto;
    min-width: 0;
    max-width: min(100%, 640px);
    display: flex;
    flex-direction: column;
    align-items: center;
}
.audio-orgao-carrossel-seta {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, opacity 0.15s ease;
}
.audio-orgao-carrossel-seta:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.72);
}
.audio-orgao-carrossel-seta:disabled {
    opacity: 0.35;
    cursor: default;
}
.audio-orgao-carrossel-seta[hidden] {
    display: none;
}
.audio-orgao-carrossel-contador {
    position: absolute;
    right: 0.5rem;
    bottom: 0.5rem;
    padding: 0.2rem 0.55rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 999px;
    pointer-events: none;
}
#audio-orgao-imagem {
    display: block;
    width: 100%;
    max-height: 520px;
    object-fit: contain;
    border-radius: 14px;
    align-self: center;
}
.audio-orgao-texto-laudo {
    margin: 0.75rem 0 0;
    padding: 0.65rem 0.75rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--texto, #333);
    background: rgba(0, 0, 0, 0.04);
    border-radius: 8px;
    text-align: left;
    white-space: pre-wrap;
    max-height: 10rem;
    overflow-y: auto;
}
#audio-orgao-sem-imagem {
    margin: 0;
    text-align: center;
}
#modal-audio-orgao .audio-laudo {
    justify-content: center;
    margin-top: var(--audio-orgao-gap);
}

.editor-quill .ql-editor p.secao-destacada {
    border-radius: 4px;
    animation: secao-flash 3s ease-out forwards;
}
@keyframes secao-flash {
    0% { background: #fff19a; box-shadow: 0 0 0 0 rgba(241,196,15,0.6); }
    25% { background: #fff19a; box-shadow: 0 0 0 8px rgba(241,196,15,0); }
    100% { background: transparent; box-shadow: none; }
}

/* Preview do laudo (Tela 4) */
.preview-laudo {
    border: 1px solid #e3e6e4;
    border-radius: var(--raio);
    padding: 1.25rem;
    background: #fff;
}
.preview-cabecalho h3 { margin: 0 0 0.5rem; font-size: 1.05rem; }
.preview-cabecalho p { margin: 0; font-size: 0.9rem; line-height: 1.5; }
.preview-cabecalho-linha {
    display: block;
    margin: 0 0 0.35rem;
}
.preview-cabecalho-linha:last-child {
    margin-bottom: 0;
}
.preview-texto {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    font-size: 0.95rem;
    line-height: 1.5;
}
.preview-texto p { margin: 0.4rem 0; }
.preview-imagens.lista-imagens-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-top: 1.25rem;
}
.preview-imagens.lista-imagens-grid figure {
    margin: 0;
    border: 1px solid #eee;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}
.preview-imagens.lista-imagens-grid img {
    width: 100%;
    display: block;
}

/* Dashboard */
.container-dashboard {
    max-width: var(--largura-conteudo-dashboard);
}
.dashboard-cabecalho {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    align-items: end;
    margin-bottom: 1.25rem;
}
@media (min-width: 720px) {
    .dashboard-cabecalho {
        grid-template-columns: repeat(3, 1fr);
    }
    .dashboard-saudacao {
        grid-column: 1;
    }
    .dashboard-filtro-periodo {
        grid-column: 3;
        width: 100%;
    }
    .dashboard-filtro-campo {
        max-width: none;
    }
}
.dashboard-saudacao,
.pagina-header.pagina-header--titulo-dashboard h1 {
    margin: 0;
    font-size: clamp(1.75rem, 5vw, 2.75rem);
    line-height: 1.12;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--cor-primaria-escura);
    background: linear-gradient(135deg, var(--cor-primaria-escura) 0%, var(--cor-secundaria) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.dashboard-filtro-periodo {
    margin: 0;
    min-width: 0;
}
.dashboard-filtro-campos {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 0.75rem;
}
.dashboard-filtro-campo {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
    flex: 1 1 0;
    max-width: 9.5rem;
}
.dashboard-filtro-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--cor-texto, #333);
}
.dashboard-filtro-campo select {
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--cor-borda);
    border-radius: var(--raio-sm);
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--cor-card);
    color: inherit;
    box-shadow: var(--sombra-xs);
    transition: border-color var(--transicao), box-shadow var(--transicao);
}
.dashboard-kpis {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
@media (min-width: 720px) {
    .dashboard-kpis {
        grid-template-columns: repeat(3, 1fr);
    }
}
.dashboard-kpi {
    background: linear-gradient(145deg, var(--cor-secundaria) 0%, var(--cor-primaria) 55%, var(--cor-primaria-escura) 100%);
    color: #fff;
    border-radius: var(--raio);
    box-shadow: var(--sombra-md);
    padding: 1.35rem 1.15rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    position: relative;
    overflow: hidden;
    transition: transform var(--transicao), box-shadow var(--transicao);
}

.dashboard-kpi::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -20%;
    width: 60%;
    height: 80%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.dashboard-kpi:hover {
    transform: translateY(-2px);
    box-shadow: var(--sombra-lg);
}

.dashboard-kpi-valor {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.15;
    letter-spacing: -0.02em;
    position: relative;
}
.dashboard-kpi-rotulo {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.92);
    line-height: 1.35;
    max-width: 14rem;
}
.dashboard-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}
@media (max-width: 720px) {
    .dashboard-grid-2 {
        grid-template-columns: 1fr;
    }
}
.dashboard-card-titulo {
    margin: 0 0 0.75rem;
    font-size: 1.05rem;
    color: var(--cor-primaria-escura);
}
.dashboard-card-ranking {
    margin-bottom: 0;
}
.dashboard-card-ranking--vets {
    background: linear-gradient(165deg, #4db596 0%, #3d9d7f 50%, #348f72 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(45, 139, 111, 0.28);
}
.dashboard-card-ranking--vets .dashboard-card-titulo {
    color: rgba(255, 255, 255, 0.96);
}
.dashboard-card-ranking--vets .dashboard-ranking-pos {
    color: #b8e8d4;
}
.dashboard-card-ranking--vets .dashboard-ranking-nome {
    color: #fff;
}
.dashboard-card-ranking--vets .dashboard-ranking-meta {
    color: rgba(255, 255, 255, 0.85);
}
.dashboard-card-ranking--vets .dashboard-ranking li {
    border-bottom-color: rgba(255, 255, 255, 0.18);
}
.dashboard-card-ranking--vets .dashboard-vazio {
    color: rgba(255, 255, 255, 0.88);
}

.dashboard-card-ranking--clinicas {
    background: linear-gradient(165deg, #348f72 0%, #2d8b6f 55%, #267a62 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(26, 95, 74, 0.3);
}
.dashboard-card-ranking--clinicas .dashboard-card-titulo {
    color: rgba(255, 255, 255, 0.96);
}
.dashboard-card-ranking--clinicas .dashboard-ranking-pos {
    color: #dff5ec;
}
.dashboard-card-ranking--clinicas .dashboard-ranking-nome {
    color: #fff;
}
.dashboard-card-ranking--clinicas .dashboard-ranking-meta {
    color: rgba(255, 255, 255, 0.88);
}
.dashboard-card-ranking--clinicas .dashboard-ranking li {
    border-bottom-color: rgba(255, 255, 255, 0.2);
}
.dashboard-card-ranking--clinicas .dashboard-vazio {
    color: rgba(255, 255, 255, 0.9);
}

.dashboard-ranking {
    margin: 0;
    padding: 0;
    list-style: none;
}
.dashboard-ranking li {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.35rem 0.5rem;
    align-items: baseline;
    padding: 0.35rem 0;
    border-bottom: 1px solid #eee;
    font-size: 0.95rem;
}
.dashboard-ranking li:last-child {
    border-bottom: none;
}
.dashboard-ranking-pos {
    font-weight: 700;
    color: var(--cor-primaria);
}
.dashboard-ranking-nome {
    overflow-wrap: anywhere;
}
.dashboard-ranking-meta {
    font-size: 0.85rem;
    color: var(--cor-texto-suave);
    white-space: nowrap;
}
.dashboard-vazio {
    margin: 0;
    font-size: 0.9rem;
    color: var(--cor-texto-suave);
}
.dashboard-tabela-card {
    margin-bottom: 1.5rem;
}
.dashboard-tabela-topo {
    display: grid;
    grid-template-columns: 10% 22% 22% 30% 16%;
    column-gap: 0;
    align-items: center;
    margin-bottom: 0.75rem;
}
.dashboard-tabela-topo .dashboard-card-titulo {
    grid-column: 1 / 5;
    grid-row: 1;
    margin-bottom: 0;
}
.dashboard-tabela-topo > .btn {
    grid-column: 5;
    grid-row: 1;
    justify-self: start;
}
@media (max-width: 720px) {
    .dashboard-tabela-topo {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
    }
    .dashboard-tabela-topo .dashboard-card-titulo {
        flex: 1 1 auto;
        min-width: 0;
    }
    .dashboard-tabela-topo > .btn {
        flex: 0 0 auto;
    }
}
.dashboard-paginacao {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 0.5rem;
    border-top: 1px solid #eee;
}
.dashboard-paginacao-info {
    font-size: 0.9rem;
    color: var(--cor-texto-suave);
}
.dashboard-graficos {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.dashboard-graficos--apos-tabela {
    margin-top: 2rem;
    margin-bottom: 0;
}
.dashboard-chart-card--full {
    grid-column: 1 / -1;
}
@media (max-width: 900px) {
    .dashboard-graficos {
        grid-template-columns: 1fr;
    }
    .dashboard-chart-card--full {
        grid-column: auto;
    }
}
.dashboard-chart-card {
    margin-bottom: 0;
}
.dashboard-chart-wrap {
    position: relative;
    height: 240px;
}

.paciente-evolucao-filtros {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    margin-bottom: 1rem;
    align-items: flex-end;
}
.paciente-evolucao-campo {
    flex: 1 1 12rem;
    min-width: 10rem;
    max-width: 20rem;
}
.paciente-evolucao-campo label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
    font-weight: 600;
}
.paciente-evolucao-campo select {
    width: 100%;
    max-width: 100%;
    padding: 0.5rem 0.6rem;
    border: 1px solid #cfd8d3;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    background-color: #fff;
    box-sizing: border-box;
}
.paciente-evolucao-chart-wrap {
    height: 280px;
}
.paciente-evolucao-sem-pontos {
    margin-top: 0.75rem;
}

/* Botão flutuante — novo exame (todas as páginas com nav) */
@keyframes fab-entrada {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fab-onda {
    0%,
    100% {
        box-shadow:
            0 4px 16px rgba(0, 0, 0, 0.22),
            0 0 0 0 rgba(26, 95, 74, 0.45);
    }
    55% {
        box-shadow:
            0 5px 18px rgba(0, 0, 0, 0.2),
            0 0 0 14px rgba(26, 95, 74, 0);
    }
}

@keyframes fab-icone-pulso {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.08);
    }
}

@keyframes fab-bounce-in {
    0% {
        transform: scale(1);
    }
    40% {
        transform: scale(1.16);
    }
    65% {
        transform: scale(0.94);
    }
    85% {
        transform: scale(1.06);
    }
    100% {
        transform: scale(1.08);
    }
}

@keyframes fab-icone-bounce-in {
    0% {
        transform: scale(1);
    }
    40% {
        transform: scale(1.28);
    }
    65% {
        transform: scale(0.9);
    }
    85% {
        transform: scale(1.12);
    }
    100% {
        transform: scale(1.08);
    }
}

.fab-novo-exame {
    position: fixed;
    right: calc(1.25rem + env(safe-area-inset-right, 0px));
    bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
    z-index: 1000;
    width: 3.65rem;
    height: 3.65rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, var(--cor-secundaria), var(--cor-primaria));
    color: #fff;
    box-shadow: var(--sombra-md);
    border: 2px solid rgba(255, 255, 255, 0.2);
    text-decoration: none;
    transition:
        background 0.2s ease,
        box-shadow 0.2s ease;
    animation: fab-onda 2.6s ease-in-out infinite;
}
.fab-novo-exame:hover {
    background: var(--cor-primaria-escura);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
    animation: fab-bounce-in 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.fab-novo-exame:not(:hover) {
    transition: transform 0.35s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.fab-novo-exame:hover svg {
    stroke: #fff;
    animation: fab-icone-bounce-in 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.fab-novo-exame:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}
.fab-novo-exame svg {
    stroke: #fff;
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    animation: fab-icone-pulso 2.6s ease-in-out 0.4s infinite;
}

@media (prefers-reduced-motion: reduce) {
    .fab-novo-exame {
        animation: none;
    }
    .fab-novo-exame svg {
        animation: none;
    }
    .fab-novo-exame:hover {
        animation: none;
        transform: none;
    }
    .fab-novo-exame:hover svg {
        animation: none;
        transform: none;
    }
}

/* Créditos Lesk.ai */
.auth-login-credits {
    margin-top: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #6a6459;
    font-size: 13px;
    font-weight: 600;
}
.auth-login-credits a {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    line-height: 0;
}
.auth-login-credits a:hover {
    text-decoration: none;
    opacity: 0.88;
}
.auth-login-credits img {
    height: 18px;
    width: auto;
    display: block;
}
/* Rodapé "Criado por" — distanciamento como exames.php (sem margem extra do último bloco) */
main.main-rodape-compacto > *:last-child {
    margin-bottom: 0;
}
main.main-rodape-compacto > .wizard-tela.card {
    margin-bottom: 0;
}
main.main-rodape-compacto > .dashboard-graficos:last-child {
    margin-bottom: 0;
}
main.main-rodape-compacto .dashboard-graficos > .card:last-child {
    margin-bottom: 0;
}
main.main-rodape-compacto + .app-credits {
    margin-top: 1.75rem;
}
main.main-rodape-compacto .botoes-form {
    justify-content: flex-start;
}

.app-credits {
    max-width: 960px;
    margin: 1.75rem auto 0;
    padding: 0 1.5rem 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--cor-texto-suave);
    font-size: 13px;
    font-weight: 600;
}
.app-credits a {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    line-height: 0;
}
.app-credits a:hover {
    text-decoration: none;
    opacity: 0.88;
}
.app-credits img {
    height: 20px;
    width: auto;
    display: block;
    max-width: 100%;
}

/* Scrollbar discreta (WebKit) */
.tabela-wrapper::-webkit-scrollbar,
.modal-conteudo::-webkit-scrollbar {
    height: 6px;
    width: 6px;
}

.tabela-wrapper::-webkit-scrollbar-thumb,
.modal-conteudo::-webkit-scrollbar-thumb {
    background: var(--cor-borda-forte);
    border-radius: var(--raio-pill);
}

.tabela-wrapper::-webkit-scrollbar-thumb:hover,
.modal-conteudo::-webkit-scrollbar-thumb:hover {
    background: var(--cor-secundaria);
}

/* Acessibilidade — reduzir animações */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .dashboard-kpi:hover,
    .fab-novo-exame:hover {
        transform: none;
    }
}
