:root {
    --azul: #171d29;          /* marinho da marca: cor exata do fundo do logo */
    --azul-claro: #1d4e89;    /* azul de apoio: hovers, links */
    --dourado: #d2a64c;       /* acento dourado da fênix */
    --vermelho: #701514;      /* vermelho profundo (oficial) — botão de enviar */
    --vermelho-claro: #8f2420;/* derivado mais claro — hover do botão */
    --tinta: #14181f;
    --cinza: #5b6470;
    --linha: #e3e7ec;
    --fundo: #f7f8fa;
    --branco: #ffffff;
}

* {
    box-sizing: border-box;
}

/* Controles de formulário não herdam a fonte por padrão — forçamos a herança
   para a Inter valer também em botões, inputs e na barra lateral. */
button,
input,
textarea,
select {
    font-family: inherit;
}

body {
    margin: 0;
    font-family: "Schibsted Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    color: var(--tinta);
    background: var(--fundo);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Chat e painel travam em 100vh e rolam por dentro (sem barra externa da janela).
   O login e demais páginas fluem normalmente. */
body:has(.page-chat),
body:has(.painel) {
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

body:has(.page-chat) main,
body:has(.painel) main {
    flex: 1 1 auto;
    min-height: 0;
}

.topbar {
    background: var(--azul);
    color: var(--branco);
    padding: 0.55rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.user-box {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.user-email {
    font-size: 0.9rem;
    color: #cdddf0;
    margin-left: 1.5rem;
}

.logout-form {
    margin: 0 0 0 0.6rem;
}

.logout-btn {
    background: transparent;
    color: var(--branco);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 6px;
    padding: 0.35rem 0.9rem;
    font-size: 0.85rem;
    cursor: pointer;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.auth-card {
    max-width: 380px;
    margin: 2rem auto;
    background: var(--branco);
    border: 1px solid var(--linha);
    border-radius: 10px;
    padding: 2rem;
}

.auth-card h1 {
    margin: 0 0 1.25rem;
    font-size: 1.4rem;
    color: var(--azul);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-form label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.9rem;
    color: var(--cinza);
}

.auth-form input {
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--linha);
    border-radius: 6px;
    font-size: 1rem;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--azul-claro);
}

.auth-form button {
    margin-top: 0.5rem;
    padding: 0.65rem;
    border: none;
    border-radius: 6px;
    background: var(--azul);
    color: var(--branco);
    font-size: 1rem;
    cursor: pointer;
}

.auth-form button:hover {
    background: var(--azul-claro);
}

.auth-alt {
    margin-top: 1.25rem;
    font-size: 0.9rem;
    color: var(--cinza);
    text-align: center;
}

.auth-alt a {
    color: var(--azul-claro);
}

.aviso {
    padding: 0.65rem 0.85rem;
    border-radius: 6px;
    margin: 0 0 1rem;
    font-size: 0.9rem;
}

.aviso.erro {
    background: #fdecec;
    color: #a12020;
    border: 1px solid #f3c2c2;
}

.aviso.info {
    background: #eaf2fb;
    color: #1d4e89;
    border: 1px solid #c2d7f0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.brand-logo {
    height: 48px;
    width: auto;
    display: block;
    border-radius: 4px;
}

.brand-accent {
    color: var(--dourado);
}

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

.hero h1 {
    font-size: 1.75rem;
    margin: 0 0 0.75rem;
    color: var(--azul);
}

.lead {
    color: var(--cinza);
    margin: 0 0 2rem;
}

.demo-form {
    display: flex;
    gap: 0.5rem;
}

.demo-form input {
    flex: 1;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--linha);
    border-radius: 6px;
    font-size: 1rem;
    background: var(--branco);
}

.demo-form input:focus {
    outline: none;
    border-color: var(--azul-claro);
}

.demo-form button {
    padding: 0.65rem 1.4rem;
    border: none;
    border-radius: 6px;
    background: var(--azul);
    color: var(--branco);
    font-size: 1rem;
    cursor: pointer;
}

.demo-form button:hover {
    background: var(--azul-claro);
}

.resposta {
    margin-top: 1.5rem;
}

/* Página de chat: ocupa a largura toda (sem o contêiner estreito de 720px) */
.page-chat {
    min-height: 0;
    padding: 1rem 1.25rem;
}

/* Layout: menu lateral + chat */
.layout {
    display: flex;
    height: 100%;
    background: var(--branco);
    border: 1px solid var(--linha);
    border-radius: 10px;
    overflow: hidden;
}

.sidebar {
    width: 260px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: #eef1f5;
    border-right: 1px solid var(--linha);
    padding: 1rem 0.85rem;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cdd4de transparent;
}

.sidebar::-webkit-scrollbar {
    width: 12px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #cdd4de;
    border-radius: 999px;
    border: 3px solid #eef1f5;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #b4bdca;
}

.nova-conversa {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    align-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--linha);
    background: var(--branco);
    color: var(--azul);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.nova-conversa svg {
    width: 22px;
    height: 22px;
}

.nova-conversa:hover {
    background: #eef4fb;
    border-color: #c2d7f0;
}

.lista-conversas {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.conversa-item {
    width: 100%;
    text-align: left;
    padding: 0.4rem 0.7rem;
    border: none;
    background: transparent;
    color: var(--tinta);
    border-radius: 6px;
    font-size: 0.88rem;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversa-item:hover {
    background: var(--fundo);
}

.conversa-item.ativa {
    background: #eef4fb;
    color: var(--azul);
    font-weight: 600;
}

/* Divisória arrastável entre a barra de histórico e o chat. */
.resizer {
    width: 5px;
    flex-shrink: 0;
    cursor: col-resize;
    background: transparent;
    transition: background 0.15s ease;
}

.resizer:hover,
body.redimensionando .resizer {
    background: #c2d7f0;
}

/* Durante o arraste: cursor consistente e sem seleção acidental de texto. */
body.redimensionando {
    cursor: col-resize;
    user-select: none;
}

/* Chat */
.chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 1rem 0 1rem 1.25rem;
}

.mensagens {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.5rem 1rem 1rem 0.25rem;
    scrollbar-width: thin;
    scrollbar-color: #cdd4de transparent;
}

/* Fade-in leve ao trocar de conversa ou abrir uma nova. */
@keyframes esmaecer-entrada {
    from { opacity: 0; }
    to { opacity: 1; }
}

.mensagens.trocando {
    animation: esmaecer-entrada 0.22s ease;
}

.mensagens::-webkit-scrollbar {
    width: 12px;
}

.mensagens::-webkit-scrollbar-track {
    background: transparent;
}

.mensagens::-webkit-scrollbar-thumb {
    background: #cdd4de;
    border-radius: 999px;
    border: 3px solid var(--branco);
}

.mensagens::-webkit-scrollbar-thumb:hover {
    background: #b4bdca;
}

.msg {
    max-width: 80%;
    padding: 0.7rem 0.95rem;
    border-radius: 12px;
    white-space: pre-wrap;
    line-height: 1.5;
}

.msg-user {
    align-self: flex-end;
    background: var(--azul);
    color: var(--branco);
    border-bottom-right-radius: 3px;
}

.msg-assistant {
    align-self: flex-start;
    background: var(--branco);
    border: 1px solid var(--linha);
    color: var(--tinta);
    border-bottom-left-radius: 3px;
    /* O conteúdo é HTML de markdown (blocos <p>/<ul>…). O `pre-wrap` herdado de
       .msg preservaria os `\n` que o marked põe ENTRE as tags, virando linhas em
       branco somadas à margem dos parágrafos — o espaçamento exagerado. `normal`
       colapsa esse espaço; a estrutura fica por conta das margens de bloco. O
       pre-wrap segue valendo em .msg-user (texto puro, precisa preservar quebras). */
    white-space: normal;
}

.msg-assistant.streaming::after {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-left: 4px;
    border-radius: 50%;
    background: var(--azul-claro);
    vertical-align: middle;
    animation: piscar 1.1s ease-in-out infinite;
}

/* Carregamento inicial: bolha vazia vira um quadrado com o ponto no centro. */
.msg-assistant.carregando {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.6rem;
    min-height: 2.6rem;
}

.msg-assistant.carregando::after {
    margin: 0;
}

@keyframes piscar {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}

/* Composer: balão arredondado com texto em cima e a linha de ações embaixo. */
.chat-form {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin: 0.5rem 1.25rem 0 0;
    padding: 0.5rem 0.6rem;
    border-radius: 16px;
    border: 1px solid var(--linha);
    background: var(--branco);
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.chat-form:focus-within {
    box-shadow: 0 0 0 2px #c2d7f0;
}

.chat-form textarea {
    width: 100%;
    padding: 0.4rem 0.3rem;
    border: none;
    background: transparent;
    font-size: 1rem;
    font-family: inherit;
    line-height: 1.4;
    resize: none;
    min-height: 40px;
    max-height: 50vh;
    overflow: hidden;
}

/* Linha de ações abaixo do texto: anexo à esquerda, enviar à direita. */
.chat-acoes {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.attach-btn {
    height: 40px;
    width: 40px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--cinza);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.attach-btn:hover {
    background: rgba(20, 24, 31, 0.06);
    color: var(--tinta);
}

.attach-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.anexo-chip {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
    padding: 0.35rem 0.7rem;
    background: #eef4fb;
    border: 1px solid #c2d7f0;
    border-radius: 999px;
    font-size: 0.82rem;
    color: var(--azul);
    transition: opacity 0.6s ease;
}

.anexo-chip svg { flex-shrink: 0; }

/* Esmaecer antes de sumir (auto-dismiss após alguns segundos). */
.anexo-chip.esmaecendo { opacity: 0; }

.chat-form textarea:focus {
    outline: none;
}

/* --- Markdown nas respostas do assistente --- */
.msg-assistant p {
    margin: 0 0 0.6rem;
}

.msg-assistant > *:last-child {
    margin-bottom: 0;
}

.msg-assistant ul,
.msg-assistant ol {
    margin: 0 0 0.6rem;
    padding-left: 1.3rem;
}

.msg-assistant li {
    margin: 0.15rem 0;
}

.msg-assistant h1,
.msg-assistant h2,
.msg-assistant h3 {
    margin: 0.7rem 0 0.4rem;
    line-height: 1.25;
    color: var(--azul);
}

.msg-assistant h1 { font-size: 1.2rem; }
.msg-assistant h2 { font-size: 1.1rem; }
.msg-assistant h3 { font-size: 1rem; }

/* Imagem gerada (AR6 Fase 3): não estoura a largura da bolha. */
.msg-assistant img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 0.3rem 0;
    display: block;
}

.msg-assistant a {
    color: var(--azul-claro);
}

.msg-assistant code {
    font-family: "Cascadia Code", Consolas, "Courier New", monospace;
    font-size: 0.88em;
    background: #eef1f5;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
}

.msg-assistant pre {
    position: relative;
    background: #f6f8fa;
    border: 1px solid var(--linha);
    border-radius: 8px;
    padding: 0.85rem 0.95rem;
    margin: 0 0 0.6rem;
    overflow-x: auto;
}

.msg-assistant pre code {
    background: none;
    padding: 0;
    font-size: 0.85rem;
}

.msg-assistant blockquote {
    margin: 0 0 0.6rem;
    padding-left: 0.8rem;
    border-left: 3px solid var(--linha);
    color: var(--cinza);
}

.msg-assistant table {
    border-collapse: collapse;
    margin: 0 0 0.6rem;
    font-size: 0.88rem;
}

.msg-assistant th,
.msg-assistant td {
    border: 1px solid var(--linha);
    padding: 0.35rem 0.6rem;
}

.copiar-codigo {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    padding: 0.2rem 0.55rem;
    font-size: 0.72rem;
    border: 1px solid var(--linha);
    background: var(--branco);
    color: var(--cinza);
    border-radius: 5px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.12s;
}

.msg-assistant pre:hover .copiar-codigo {
    opacity: 1;
}

.chat-form button[type="submit"] {
    height: 40px;
    flex-shrink: 0;
    padding: 0 1.2rem;
    border: none;
    border-radius: 10px;
    background: var(--vermelho);
    color: var(--branco);
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.chat-form button[type="submit"]:hover:not(:disabled) {
    background: var(--vermelho-claro);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(112, 21, 20, 0.30);
}

.chat-form button[type="submit"]:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: none;
}

/* Indisponível (sem texto e sem anexo): cinza, sólido, sem brilho. */
.chat-form button[type="submit"]:disabled {
    background: #e1e5ea;
    color: #9aa3af;
    box-shadow: none;
    transform: none;
    opacity: 1;
    cursor: default;
}

.chat-form button:disabled {
    opacity: 0.5;
    cursor: default;
}

.echo {
    padding: 0.85rem 1rem;
    background: var(--branco);
    border: 1px solid var(--linha);
    border-left: 3px solid var(--azul-claro);
    border-radius: 6px;
    margin: 0;
}

.echo.muted {
    color: var(--cinza);
}

/* --- Navegação na topbar (staff) --- */
.nav-link {
    color: #cdddf0;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--branco);
}

.nav-areas {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    flex-wrap: wrap;
}

/* --- Páginas de área (admin / ensino / empresa / meu espaço) --- */
.area {
    width: 100%;
    max-width: 880px;
    margin: 0 auto;
    padding: 2.4rem 1.5rem 3rem;
}

.area-titulo {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--azul);
    margin: 0 0 0.3rem;
}

.area-sub {
    color: var(--cinza);
    margin: 0 0 1.6rem;
}

.area-card {
    background: var(--branco);
    border: 1px solid var(--linha);
    border-radius: 12px;
    padding: 1.6rem 1.8rem;
}

.area-tag {
    display: inline-block;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--dourado);
    border: 1px solid var(--dourado);
    border-radius: 999px;
    padding: 0.15rem 0.7rem;
    margin-bottom: 0.9rem;
}

.area-itens {
    margin: 0.6rem 0 0;
    padding-left: 1.2rem;
    color: var(--tinta);
}

.area-itens li {
    margin: 0.35rem 0;
}

.area-sub2 {
    font-size: 1.05rem;
    color: var(--azul);
    margin: 1.2rem 0 0.4rem;
}

/* --- Áreas: botões, formulários, tabelas, admin --- */
.btn {
    display: inline-block;
    background: var(--azul);
    color: var(--branco);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
}
.btn:hover { background: var(--azul-claro); }

.q-form { display: flex; flex-direction: column; gap: 0.9rem; }
.q-form > label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.9rem; color: var(--cinza); }
.q-form input[type=text], .q-form input[type=email], .q-form input[type=password],
.q-form input[type=number], .q-form select, .q-form textarea {
    font-size: 0.95rem; padding: 0.5rem 0.6rem; border: 1px solid var(--linha);
    border-radius: 8px; background: var(--branco); color: var(--tinta); width: 100%;
}
.q-form textarea { resize: vertical; }
.q-form button[type=submit] {
    align-self: flex-start; background: var(--vermelho); color: var(--branco);
    border: none; border-radius: 8px; padding: 0.55rem 1.4rem; font-size: 0.95rem; cursor: pointer;
}
.q-form button[type=submit]:hover { background: var(--vermelho-claro); }
.q-check { flex-direction: row !important; align-items: center; gap: 0.5rem; color: var(--tinta) !important; }

/* Editor de prompts: coluna única (balões largos), cards próximos + salvar central. */
.prompts-lista { display: flex; flex-direction: column; gap: 0.55rem; }
.prompt-item { padding: 0.9rem 1.1rem; }
.prompt-rotulo { font-weight: 600; text-transform: capitalize; color: var(--azul); }
.prompts-salvar { display: flex; justify-content: center; margin-top: 1.4rem; }
.prompts-salvar button[type=submit] {
    background: var(--vermelho); color: var(--branco); border: none; border-radius: 8px;
    padding: 0.7rem 2.4rem; font-size: 1rem; cursor: pointer;
}
.prompts-salvar button[type=submit]:hover { background: var(--vermelho-claro); }
.q-checks { display: flex; flex-direction: column; gap: 0.3rem; }
.q-item { margin-bottom: 0.5rem; }
.q-rotulo { font-weight: 500; color: var(--tinta); }
.q-obr { color: var(--vermelho); }
.q-ajuda { font-size: 0.82rem; color: var(--cinza); margin: 0.1rem 0; }

.tbl { width: 100%; border-collapse: collapse; margin: 0.6rem 0 1.4rem; font-size: 0.9rem; }
.tbl th, .tbl td { text-align: left; padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--linha); }
.tbl th { color: var(--cinza); font-weight: 600; }
.tbl a { color: var(--azul-claro); }
.link-btn { background: none; border: none; color: var(--vermelho); cursor: pointer; padding: 0; font-size: 0.85rem; }

.admin-subnav {
    display: flex; gap: 0.4rem 1rem; flex-wrap: wrap;
    margin: 0.4rem 0 1.4rem; padding-bottom: 0.6rem; border-bottom: 1px solid var(--linha);
}
.admin-subnav a { color: var(--azul-claro); text-decoration: none; font-size: 0.9rem; }
.admin-subnav a:hover { text-decoration: underline; }
.admin-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.admin-card {
    display: flex; flex-direction: column; gap: 0.25rem; padding: 1.1rem 1.2rem;
    background: var(--branco); border: 1px solid var(--linha); border-radius: 12px;
    text-decoration: none; color: var(--tinta);
}
.admin-card:hover { border-color: var(--dourado); }
.admin-card span { font-size: 0.82rem; color: var(--cinza); }
.convite-link input {
    width: 100%; font-size: 0.9rem; padding: 0.5rem;
    border: 1px solid var(--dourado); border-radius: 8px; background: #fffaf0; color: var(--tinta);
}

.msg-linha { padding: 0.55rem 0; border-bottom: 1px solid var(--linha); }
.msg-linha:last-child { border-bottom: none; }
.msg-role { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--cinza); }
.msg-conteudo { white-space: pre-wrap; margin-top: 0.2rem; color: var(--tinta); }

/* Abas de agente (geral × empresa) na barra de conversas */
.conv-tabs { display: flex; gap: 0.3rem; padding: 0 0.4rem 0.55rem; }
.conv-tab {
    flex: 1; background: transparent; border: 1px solid var(--linha); color: var(--cinza);
    border-radius: 6px; padding: 0.3rem 0.5rem; font-size: 0.82rem; cursor: pointer;
}
.conv-tab.ativa { background: var(--azul); color: var(--branco); border-color: var(--azul); }

/* --- Painel de gestão --- */
.ferramentas-nota { color: var(--cinza); font-size: 0.85rem; margin: 0 0 0.6rem; }
.ferramentas-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.2rem; }
.ferramentas-links a { color: var(--azul-claro); text-decoration: none; font-size: 0.9rem; }
.ferramentas-links a:hover { text-decoration: underline; }

.painel {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cdd4de transparent;
}

.painel::-webkit-scrollbar {
    width: 12px;
}

.painel::-webkit-scrollbar-track {
    background: transparent;
}

.painel::-webkit-scrollbar-thumb {
    background: #cdd4de;
    border-radius: 999px;
    border: 3px solid var(--fundo);
}

.painel::-webkit-scrollbar-thumb:hover {
    background: #b4bdca;
}

.painel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.painel-head h1 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--azul);
}

.painel-sub {
    margin: 0.25rem 0 0;
    color: var(--cinza);
    font-size: 0.9rem;
}

.periodo-filtro {
    display: flex;
    gap: 0.4rem;
}

.periodo-btn {
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--linha);
    border-radius: 999px;
    font-size: 0.85rem;
    color: var(--cinza);
    text-decoration: none;
    background: var(--branco);
}

.periodo-btn:hover {
    border-color: var(--azul-claro);
}

.periodo-btn.ativo {
    background: var(--azul);
    color: var(--branco);
    border-color: var(--azul);
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.card {
    background: var(--branco);
    border: 1px solid var(--linha);
    border-radius: 10px;
    padding: 1.1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.card-rotulo {
    font-size: 0.8rem;
    color: var(--cinza);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.card-valor {
    font-size: 1.7rem;
    font-weight: 600;
    color: var(--azul);
    line-height: 1.1;
}

.card-detalhe {
    font-size: 0.82rem;
    color: var(--cinza);
}

.bloco {
    margin-bottom: 2rem;
}

.bloco h2 {
    font-size: 1.05rem;
    color: var(--tinta);
    margin: 0 0 0.85rem;
}

.saude-linha {
    display: flex;
    gap: 2.5rem;
    flex-wrap: wrap;
    background: var(--branco);
    border: 1px solid var(--linha);
    border-radius: 10px;
    padding: 1.1rem 1.5rem;
}

.saude-item {
    display: flex;
    flex-direction: column;
}

.saude-valor {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--azul);
}

.saude-item.alerta .saude-valor {
    color: #a12020;
}

.saude-rotulo {
    font-size: 0.8rem;
    color: var(--cinza);
}

.tabela {
    width: 100%;
    border-collapse: collapse;
    background: var(--branco);
    border: 1px solid var(--linha);
    border-radius: 10px;
    overflow: hidden;
    font-size: 0.9rem;
}

.tabela th,
.tabela td {
    padding: 0.6rem 0.85rem;
    text-align: left;
    border-bottom: 1px solid var(--linha);
}

.tabela th {
    background: #eef1f5;
    color: var(--cinza);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

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

.tabela .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.aluno-nome {
    font-weight: 600;
    color: var(--tinta);
}

.aluno-email {
    font-size: 0.8rem;
    color: var(--cinza);
}

.tag {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    background: #eef1f5;
    color: var(--cinza);
}

.tag-admin { background: #fdecec; color: #a12020; }
.tag-professor { background: #eaf2fb; color: #1d4e89; }

.barra {
    display: inline-block;
    width: 120px;
    height: 7px;
    background: var(--linha);
    border-radius: 999px;
    overflow: hidden;
    vertical-align: middle;
    margin-right: 0.5rem;
}

.barra span {
    display: block;
    height: 100%;
    background: var(--azul-claro);
}

.barra-label {
    font-size: 0.8rem;
    color: var(--cinza);
}

.duas-colunas {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.vazio {
    color: var(--cinza);
    font-size: 0.9rem;
    padding: 0.5rem 0;
}

.painel-nota {
    font-size: 0.78rem;
    color: var(--cinza);
    border-top: 1px solid var(--linha);
    padding-top: 1rem;
    margin-top: 1rem;
}

@media (max-width: 760px) {
    .duas-colunas { grid-template-columns: 1fr; }
}
