/* Fichas do AEE (PDI, Atendimento, Avaliação) — Tarefa #33284.
   A ficha é o dossiê pedagógico de uma criança: folha calma, campos numa só margem, títulos de
   seção em Sora. O único gesto forte é o bloco de data dos atendimentos, que são sessões em
   sequência. Destaque = o roxo das abas (primária do MudBlazor); verde/vermelho só com significado. */
.ve-ficha {
    --ve-ficha-tinta: #1d2433;
    --ve-ficha-suave: #5f6577;
    --ve-ficha-linha: #e3e4ee;
    --ve-ficha-papel: #f7f7fb;
    --ve-ficha-destaque: var(--mud-palette-primary, #594ae2);
    --ve-ficha-presente: #2e7d5b;
    --ve-ficha-falta: #c2413b;
    color: var(--ve-ficha-tinta);
    font-size: 1rem;
    padding: 16px clamp(8px, 2vw, 20px) 24px;
}

/* Letra grande: muitas professoras do AEE leem com dificuldade (pedido do Herbert). O padrão do
   MudBlazor é 14px nos campos e 12px nos rótulos; aqui nada fica abaixo de 15px. */
.ve-ficha .mud-input,
.ve-ficha .mud-input > textarea,
.ve-ficha .mud-input > input,
.ve-ficha .mud-select-input,
.ve-ficha .mud-radio .mud-typography,
.ve-ficha .mud-checkbox .mud-typography,
.ve-ficha .mud-switch .mud-typography {
    font-size: 1.0625rem;
    line-height: 1.5;
}

.ve-ficha .mud-input-label {
    font-size: 1rem;
}

/* Lista aberta do select: fica fora da ficha (popover no fim da página), por isso a classe própria */
.ve-ficha-opcoes .mud-typography {
    font-size: 1.0625rem;
}

/* Botões em caixa normal: "Salvar", "Excluir ficha" (o padrão do MudBlazor é tudo maiúsculo) */
.ve-ficha .mud-button-root {
    text-transform: none;
    letter-spacing: normal;
    font-size: 1rem;
}

/* O picker de data põe 8px a mais acima do campo: alinha com o título ao lado */
.ve-ficha .mud-picker > .mud-input-control {
    margin-top: 0;
}

.ve-ficha-titulo {
    font-family: 'Sora', 'Segoe UI', sans-serif;
    font-weight: 600;
    font-size: 1.65rem;
    letter-spacing: -.3px;
    line-height: 1.25;
    margin: 0;
    color: var(--ve-ficha-tinta);
}

.ve-ficha-meta {
    color: var(--ve-ficha-suave);
    font-size: 1rem;
    margin: 4px 0 0;
}

/* ---------- Lista de fichas ---------- */
.ve-ficha-topo {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 16px;
    margin-bottom: 16px;
}

.ve-ficha-lista {
    border: 1px solid var(--ve-ficha-linha);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.ve-ficha-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 8px 12px 16px;
    border-bottom: 1px solid var(--ve-ficha-linha);
}

.ve-ficha-item:last-child {
    border-bottom: 0;
}

.ve-ficha-item:hover {
    background: var(--ve-ficha-papel);
}

.ve-ficha-abrir {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    background: none;
    border: 0;
    padding: 0;
    text-align: left;
    color: inherit;
    cursor: pointer;
}

.ve-ficha-abrir:focus-visible {
    outline: 2px solid var(--ve-ficha-destaque);
    outline-offset: 4px;
    border-radius: 6px;
}

.ve-ficha-nome {
    font-weight: 600;
    font-size: 1.2rem;
    overflow-wrap: break-word;
}

.ve-ficha-detalhe {
    color: var(--ve-ficha-suave);
    font-size: 1rem;
    margin-top: 2px;
}

.ve-ficha-acoes {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* Bloco de data: atendimentos são sessões em sequência, a data é o que se procura */
.ve-ficha-data {
    flex-shrink: 0;
    width: 64px;
    text-align: center;
    border-right: 2px solid var(--ve-ficha-destaque);
    padding-right: 12px;
    line-height: 1.1;
}

.ve-ficha-data b {
    display: block;
    font-family: 'Sora', 'Segoe UI', sans-serif;
    font-weight: 600;
    font-size: 1.8rem;
    color: var(--ve-ficha-destaque);
}

.ve-ficha-data span {
    font-size: .95rem;
    color: var(--ve-ficha-suave);
}

.ve-ficha-presenca {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .95rem;
    font-weight: 500;
    padding: 3px 12px;
    border-radius: 999px;
    white-space: nowrap;
}

.ve-ficha-presenca::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.ve-ficha-presenca.presente {
    color: var(--ve-ficha-presente);
    background: #e8f4ee;
}

.ve-ficha-presenca.falta {
    color: var(--ve-ficha-falta);
    background: #fbeceb;
}

.ve-ficha-vazia {
    padding: 28px 16px;
    text-align: center;
    color: var(--ve-ficha-suave);
}

/* ---------- Ficha aberta ---------- */
.ve-ficha-cabecalho {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px 16px;
    margin: 4px 0 16px;
}

/* Baixar PDF e o "Ver outra ficha" amarelo, no canto direito como sempre esteve */
.ve-ficha-cabecalho-acoes {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.ve-ficha-voltar {
    font-size: .95rem;
    padding: 4px 14px;
}

.ve-ficha-folha {
    background: var(--ve-ficha-papel);
    border: 1px solid var(--ve-ficha-linha);
    border-radius: 12px;
    padding: 8px clamp(14px, 3vw, 28px) 20px;
}

.ve-ficha-secao {
    font-family: 'Sora', 'Segoe UI', sans-serif;
    font-weight: 600;
    font-size: 1.25rem;
    line-height: 1.35;
    color: var(--ve-ficha-tinta, #1d2433);
    margin: 28px 0 4px;
    padding-left: 12px;
    border-left: 3px solid var(--ve-ficha-destaque, var(--mud-palette-primary, #594ae2));
}

/* Pergunta acima do campo (ConteudoDinamico; vale também nas telas só de leitura) */
.ve-ficha-rotulo {
    font-size: 1.0625rem !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
    margin-bottom: 6px !important;
    color: var(--ve-ficha-tinta, #1d2433);
}

.ve-ficha-folha .mud-input-outlined:not(.mud-disabled) {
    background: #fff;
}

.ve-ficha-aprovacao {
    display: flex;
    justify-content: flex-start;
    margin-top: 12px;
}

.ve-ficha-rodape {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--ve-ficha-linha);
}

/* Salvar e, abaixo dele, a chave do salvamento automático (pedido do Herbert) */
.ve-ficha-salvar {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    margin-left: auto;
}

.ve-ficha-salvar .mud-switch {
    margin: 0;
}

.ve-ficha-salvar .mud-typography-caption {
    color: var(--ve-ficha-suave);
    font-size: .95rem;
}

@media (max-width: 600px) {
    .ve-ficha-item {
        flex-wrap: wrap;
    }

    /* o selo de presença desce para a linha de baixo em vez de partir o nome no meio */
    .ve-ficha-abrir {
        flex-wrap: wrap;
        row-gap: 6px;
    }

    .ve-ficha-abrir > .flex-grow-1 {
        min-width: 150px;
    }

    /* alinhado ao nome, não à data (64px do bloco + 16px de espaço) */
    .ve-ficha-data ~ .ve-ficha-presenca {
        margin-left: 80px;
    }

    .ve-ficha-salvar {
        align-items: stretch;
        width: 100%;
    }
}
