/* =========================================================
   Theora aluno — Folha de estilos
   Sistema de design alinhado com o Theora: cores da marca,
   letra Schibsted Grotesk, menu lateral com a barra da margem,
   barra inferior "liquid glass" e menu Mais.
   ========================================================= */

/* Marca Theora: cobalto (o que se toca), tinta (texto), margem (a barra do logótipo),
   nota (o que pede atenção) e névoa (fundos de destaque suaves) */
:root {
    --primary-color: #1F3BDB;
    --primary-rgb: 31, 59, 219;
    --hover-color: #172DB0;
    --bg-color: #F5F6FC;
    --card-bg: #FFFFFF;
    --text-main: #11152A;
    --text-muted: #4B5172;
    --border-color: #D5DAEE;
    --input-bg: #F8F9FE;

    --success-color: #FF6A4D;
    --success-hover: #F0442C;
    --success-text: #11152A;
    --success-rgb: 255, 106, 77;
    --margem: #F0442C;
    --nota: #FFE7E1;
    --nota-texto: #B2321D;
    --nevoa: #E9ECFF;

    --danger-color: #FF1744;
    --danger-hover: #D50000;
    --danger-text: #FFFFFF;
    --warning-color: #F59E0B;

    /* Cor de destaque efetiva: cobalto no modo claro, margem clara nos modos escuro/preto */
    --accent: var(--primary-color);
    --accent-rgb: var(--primary-rgb);
    --accent-text: #FFFFFF;

    --modal-backdrop: rgba(17, 21, 42, 0.85);
    --radius-main: 10px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --sombra-1: 0 1px 3px rgba(17, 21, 42, 0.08);
    --sombra-2: 0 12px 32px rgba(17, 21, 42, 0.16);
    --sidebar-width: 260px;
    --sidebar-width-collapsed: 80px;
}

body.dark-mode, body.oled-mode { --margem: #FF6A4D; --nota: rgba(255, 106, 77, 0.10); --nota-texto: #FF8A72; --nevoa: rgba(135, 150, 255, 0.12); }
body.dark-mode, body.oled-mode { --sombra-1: 0 1px 3px rgba(0, 0, 0, 0.4); --sombra-2: 0 12px 32px rgba(0, 0, 0, 0.5); }
body.dark-mode {
    --bg-color: #11152A;
    --card-bg: #191E38;
    --text-main: #F3F4FA;
    --text-muted: #A6ACCB;
    --border-color: #2A3052;
    --input-bg: #0D1024;
}

body.oled-mode {
    --bg-color: #000000;
    --card-bg: #000000;
    --text-main: #F8FAFC;
    --text-muted: #A0ABC0;
    --border-color: #1A1A1A;
    --input-bg: #050505;
}

body.dark-mode, body.oled-mode {
    color-scheme: dark;
    --accent: var(--success-color);
    --accent-rgb: var(--success-rgb);
    --accent-text: var(--success-text);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
/* Qualquer componente com display próprio continua escondido com o atributo hidden */
[hidden] { display: none !important; }
/* Sem o retângulo de toque do Android (não respeita os cantos arredondados); com teclado, o foco fica visível */
html, button, a, [role="button"], summary, label { -webkit-tap-highlight-color: transparent; }
/* Android: sem o retângulo de toque; no lugar dele, o próprio elemento escurece um pouco */
@media (hover: none) {
    :where(button, a, summary, [role="button"], .theme-mode-card):active { opacity: 0.72; transition: opacity 0s; }
    :where(button, a, summary, [role="button"], .theme-mode-card) { transition: opacity 0.18s ease; }
}
/* Faixa da cor do tema por trás da barra de estado (relógio, Dynamic Island): o conteúdo que sobe
   ao fazer scroll passa por baixo dela em vez de ficar tapado pelos ícones do sistema */
#zonaSeguraTopo { position: fixed; top: 0; left: 0; right: 0; height: env(safe-area-inset-top, 0px); background: var(--cor-barra-estado, var(--bg-color)); z-index: 9000; pointer-events: none; }
:focus-visible { outline: 3px solid rgba(var(--accent-rgb), 0.45); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }

html, body {
    height: 100%; width: 100%; overflow: hidden;
    background-color: var(--bg-color); transition: background-color 0.3s ease;
}

body {
    font-family: 'Schibsted Grotesk', system-ui, -apple-system, sans-serif;
    color: var(--text-main); line-height: 1.5; transition: color 0.3s ease;
}

h1, h2, h3, h4, h5, h6,
.subtitle, .section-subtitle, .faq-category-title, .info-widget-title, .stat-valor {
    font-family: 'Schibsted Grotesk', system-ui, -apple-system, sans-serif;
}

input, select, textarea, button { font-family: inherit; }

.ic { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; line-height: 0; }
.ic svg { width: 100%; height: 100%; }

.fade-in-anim { animation: containerFadeIn 0.3s ease-out both; }
.fade-out-anim { animation: containerFadeOut 0.3s ease-in forwards; }
@keyframes containerFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes containerFadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: scale(0.98) translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
@keyframes spin { 100% { transform: rotate(360deg); } }

.logo-theme-light { display: block; }
.logo-theme-dark { display: none; }
body.dark-mode .logo-theme-light, body.oled-mode .logo-theme-light { display: none; }
body.dark-mode .logo-theme-dark, body.oled-mode .logo-theme-dark { display: block; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }

/* =========================================================
   ECRÃ DE ENTRADA (LANDING)
   Mobile: faixa de marca no topo e cartão sobreposto.
   Desktop (>900px): painel de marca à esquerda, formulário à direita.
   ========================================================= */
#landingContainer {
    display: flex; flex-direction: column; align-items: stretch;
    position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
html.a-retomar-sessao #landingContainer { display: none; }

.landing-hero { display: contents; }
.landing-hero-top {
    position: relative; overflow: hidden; z-index: 1;
    padding: calc(28px + env(safe-area-inset-top, 0px)) 24px 92px; color: #FFFFFF;
    background: var(--primary-color);
}
body.dark-mode .landing-hero-top, body.oled-mode .landing-hero-top { background: var(--card-bg); border-bottom: 1px solid var(--border-color); }

.landing-hero-logo { width: 170px; max-width: 60%; height: auto; display: block; }
.landing-hero-content { margin-top: 28px; }
.landing-hero-title { font-size: clamp(22px, 7vw, 32px); font-weight: 600; line-height: 1.1; letter-spacing: -0.03em; margin-bottom: 10px; }
.landing-hero-text { font-size: 14.5px; line-height: 1.55; opacity: 0.85; max-width: 440px; }
.landing-produto { display: none; }
.landing-outro { margin: 18px auto 0; font-size: 14px; color: var(--text-muted); text-align: center; }
.landing-outro a { color: var(--accent); font-weight: 650; }
.landing-instalar[hidden] { display: none !important; }

.landing-main { display: flex; flex-direction: column; align-items: center; flex: 1 0 auto; padding: 0 16px; margin-top: -64px; z-index: 2; }
.landing-box {
    background: var(--card-bg); padding: 30px 24px; border-radius: var(--radius-main);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08); border: 1px solid var(--border-color);
    max-width: 440px; width: 100%; margin: 0 auto; animation: containerFadeIn 0.45s ease-out both;
}
.landing-theme-btn { position: absolute; top: calc(20px + env(safe-area-inset-top, 0px)); right: 16px; z-index: 3; }
.landing-heading { margin-bottom: 24px; }
.landing-heading h1 { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; margin-bottom: 6px; }
.landing-heading p { font-size: 14.5px; color: var(--text-muted); }
.landing-form { display: flex; flex-direction: column; gap: 18px; }
.google-btn-wrap { display: flex; justify-content: center; width: 100%; min-height: 44px; }
.google-indisponivel { font-size: 13px; color: var(--text-muted); text-align: center; padding: 12px; border: 1px dashed var(--border-color); border-radius: var(--radius-sm); }

.aviso-privacidade {
    display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-main);
    background: rgba(var(--accent-rgb), 0.06); border: 1px solid rgba(var(--accent-rgb), 0.22);
    font-size: 13px; line-height: 1.5; color: var(--text-muted);
}
.aviso-privacidade strong { color: var(--text-main); display: block; font-size: 13.5px; margin-bottom: 2px; }
.aviso-privacidade .ic { width: 20px; height: 20px; color: var(--accent); margin-top: 1px; }

.login-error-box {
    display: none; background: rgba(255, 23, 68, 0.08); border: 1px solid var(--danger-color);
    color: var(--danger-color); padding: 12px; border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 600; line-height: 1.4;
}
.login-error-box.show { display: block; animation: shake 0.3s ease-in-out; }

.link-demo { background: none; border: 0; color: var(--text-muted); font-size: 13px; font-weight: 600; text-decoration: underline; cursor: pointer; align-self: center; }
.link-demo:hover { color: var(--accent); }

.landing-footer {
    order: 1; display: flex; flex-direction: column; align-items: center; gap: 10px;
    padding: 28px 16px max(24px, env(safe-area-inset-bottom)); font-size: 13px; color: var(--text-muted); text-align: center;
}
.landing-footer a {
    display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); text-decoration: none; cursor: pointer;
    font-weight: 600; padding: 8px 16px; border-radius: var(--radius-sm); background: var(--card-bg); border: 1px solid var(--border-color); transition: all 0.2s;
}
.landing-footer a .ic { width: 15px; height: 15px; }
.landing-footer a:hover { color: var(--accent); border-color: var(--accent); }

@media (max-width: 900px) {
    .landing-theme-btn .top-btn { color: #FFFFFF; background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.35); }
}

@media (min-width: 901px) {
    #landingContainer { flex-direction: row; overflow: hidden; }
    .landing-hero {
        display: flex; flex-direction: column; flex: 1 1 55%; min-width: 0; position: relative; overflow: hidden; color: #FFFFFF;
        padding: clamp(36px, 5vw, 64px) clamp(36px, 5vw, 72px);
        background: var(--primary-color);
    }
    body.dark-mode .landing-hero, body.oled-mode .landing-hero { background: var(--card-bg); border-right: 1px solid var(--border-color); }
    .landing-hero-top, body.dark-mode .landing-hero-top, body.oled-mode .landing-hero-top {
        position: static; overflow: visible; flex: none; display: flex; flex-direction: column;
        padding: 0; background: none; border: 0;
    }
    .landing-hero-logo { width: 240px; max-width: 100%; }
    .landing-hero-content { margin-top: 40px; max-width: 600px; }
    .landing-hero-title { font-size: clamp(28px, 2.8vw, 40px); line-height: 1.12; margin-bottom: 16px; max-width: 520px; }
    .landing-hero-text { font-size: 16px; line-height: 1.6; }
    /* Uma imagem real da app, como uma janela: tamanho real (máximo 680 px); em ecrãs baixos corta só em baixo */
    .landing-produto {
        display: block; flex: 0 1 auto; min-height: 120px; width: min(100%, 680px); aspect-ratio: 1280 / 820; margin-top: 44px;
        border-radius: 12px; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.28); box-shadow: 0 24px 60px rgba(8, 12, 40, 0.35);
    }
    .landing-produto img { width: 100%; height: 100%; object-fit: cover; object-position: left top; }
    body.dark-mode .landing-produto, body.oled-mode .landing-produto { border-color: var(--border-color); box-shadow: none; }

    .landing-footer { order: 0; position: relative; z-index: 1; flex-direction: row; gap: 16px; padding: 32px 0 0; margin-top: auto; color: rgba(255, 255, 255, 0.75); }
    .landing-footer a { color: #FFFFFF; background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.25); }
    .landing-footer a:hover { color: #FFFFFF; background: rgba(255, 255, 255, 0.18); border-color: #FFFFFF; }
    body.dark-mode .landing-footer, body.oled-mode .landing-footer { color: var(--text-muted); }
    body.dark-mode .landing-footer a, body.oled-mode .landing-footer a { color: var(--text-muted); background: transparent; border-color: var(--border-color); }
    body.dark-mode .landing-footer a:hover, body.oled-mode .landing-footer a:hover { color: var(--accent); border-color: var(--accent); }

    .landing-main { flex: 0 0 clamp(440px, 42%, 600px); position: relative; margin-top: 0; padding: 80px 40px 40px; overflow-y: auto; }
    .landing-box { margin: auto 0; max-width: 420px; padding: 44px 40px; }
    .landing-theme-btn { top: 24px; right: 24px; }
    .landing-heading { margin-bottom: 28px; }
    .landing-heading h1 { font-size: 28px; margin-bottom: 8px; }
    .landing-heading p { font-size: 15px; }
}

/* ECRÃ DE ARRANQUE ("do caderno ao menu")
   A margem do caderno desenha-se, as linhas aparecem, a margem encolhe até ser a barra do logótipo
   e "theora / aluno" escreve-se sobre duas linhas. No computador, a barra viaja até ao menu lateral. */
#loadingContainer {
    display: none; flex-direction: column; align-items: center; justify-content: center;
    position: fixed; inset: 0; text-align: center; z-index: 9999; background: var(--bg-color); overflow: hidden;
    /* Medidas tiradas do logótipo: palavras de 3660 × 2224 px, barra de 173 px a 179 px das palavras;
       "aluno" assenta na linha do centro e "theora" na linha de cima */
    --arr-w: min(42vw, 180px);
    --arr-barra: calc(var(--arr-w) * 0.0473);
    --arr-vao: calc(var(--arr-w) * 0.0489);
    --arr-alt: calc(var(--arr-w) * 0.6077);
    --arr-base: calc(var(--arr-w) * 0.588);    /* do topo das palavras até à linha onde "aluno" assenta */
    --arr-passo: calc(var(--arr-w) * 0.3574);  /* distância entre as linhas do caderno */
    --arr-esq: calc(50% - (var(--arr-barra) + var(--arr-vao) + var(--arr-w)) / 2);
    --arr-linha: rgba(31, 59, 219, 0.15);
}
@media (min-width: 901px) { #loadingContainer { --arr-w: min(17vw, 220px); } }
body.dark-mode #loadingContainer { --arr-linha: rgba(150, 165, 255, 0.14); }
body.oled-mode #loadingContainer { --arr-linha: rgba(150, 165, 255, 0.12); }
html.a-retomar-sessao #loadingContainer { display: flex; }
.arranque { position: absolute; inset: 0; pointer-events: none; }
/* Linhas do caderno: uma passa no centro do ecrã, onde "aluno" assenta */
.arranque-linhas {
    position: absolute; inset: 0;
    background-image: linear-gradient(to bottom, transparent calc(50% - 0.5px), var(--arr-linha) calc(50% - 0.5px), var(--arr-linha) calc(50% + 0.5px), transparent calc(50% + 0.5px));
    background-size: 100% var(--arr-passo); background-position: 0 calc(50% + var(--arr-passo) / 2);
    -webkit-mask-image: linear-gradient(to bottom, transparent 20%, #000 38%, #000 62%, transparent 80%);
    mask-image: linear-gradient(to bottom, transparent 20%, #000 38%, #000 62%, transparent 80%);
    animation: arranqueLinhas 0.65s cubic-bezier(0.3, 0.7, 0.2, 1) 0.25s both;
    transition: opacity 0.3s ease;
}
/* A margem começa como a linha fina do caderno, de cima a baixo, e encolhe até ser a barra do logótipo */
.arranque-margem {
    position: absolute; left: var(--arr-esq); top: calc(50% - var(--arr-base)); width: var(--arr-barra); height: var(--arr-alt);
    background: var(--margem); border-radius: 1px; transform-origin: top center; z-index: 2;
    animation: arranqueMargem 1.25s cubic-bezier(0.55, 0, 0.25, 1) both, arranqueRespira 1.3s ease-in-out 1.35s infinite;
}
.arranque-palavra {
    position: absolute; left: calc(var(--arr-esq) + var(--arr-barra) + var(--arr-vao)); top: calc(50% - var(--arr-base));
    width: var(--arr-w); height: var(--arr-alt);
    animation: arranquePalavra 0.55s cubic-bezier(0.3, 0.7, 0.2, 1) 0.8s both;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.arranque-palavra img { width: 100%; height: 100%; max-width: none; }
@keyframes arranqueMargem {
    0%   { top: 0; height: 100%; width: 1.5px; transform: scaleY(0); }
    36%  { top: 0; height: 100%; width: 1.5px; transform: scaleY(1); }
    62%  { top: 0; height: 100%; width: 1.5px; transform: scaleY(1); }
    100% { top: calc(50% - var(--arr-base)); height: var(--arr-alt); width: var(--arr-barra); transform: scaleY(1); }
}
@keyframes arranqueRespira { 50% { opacity: 0.35; } }
@keyframes arranqueLinhas { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes arranquePalavra { from { clip-path: inset(0 100% 0 0); transform: translateX(calc(var(--arr-w) * -0.02)); } to { clip-path: inset(0 0 0 0); transform: none; } }
/* Texto na linha de baixo: a saudação aparece quando as palavras estão escritas; os outros avisos só se a espera passar de 3 s */
#loadingText {
    position: absolute; left: 0; right: 0; top: calc(50% + var(--arr-passo) - 22px); padding: 0 20px;
    font-size: 15px; font-weight: 500; color: var(--text-muted);
    animation: arranqueTexto 0.4s ease 3s both;
}
#loadingText.saudacao {
    top: calc(50% + var(--arr-passo) - 27px);
    font-size: 22px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; color: var(--text-main);
    animation: arranqueSaudacao 0.5s ease 1.2s both;
}
@keyframes arranqueTexto { from { opacity: 0; } to { opacity: 1; } }
@keyframes arranqueSaudacao { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
/* Saída: o caderno desaparece; a app já está por baixo e responde enquanto o ecrã de arranque sai */
#loadingContainer.arranque-a-sair, #loadingContainer.fade-out-anim { pointer-events: none; }
#loadingContainer.arranque-a-sair { background: transparent; transition: background-color 0.5s ease 0.15s; }
#loadingContainer.arranque-a-sair .arranque-linhas, #loadingContainer.arranque-a-sair #loadingText { opacity: 0; transition: opacity 0.35s ease; }
#loadingContainer.arranque-a-sair .arranque-palavra { opacity: 0; transform: translateY(calc(var(--arr-w) * -0.03)); transition: opacity 0.35s ease, transform 0.45s ease; }
/* A viagem da barra até ao menu é feita no JavaScript (sairDoArranque), só com transformações */
#loadingContainer.arranque-a-sair .arranque-margem { animation: none; will-change: transform; }
/* Enquanto a barra viaja, a barra do menu espera por ela */
html.arranque-a-deslizar .nav-indicador, html.arranque-a-deslizar .nav-item.active::before { opacity: 0 !important; }
@media (prefers-reduced-motion: reduce) {
    .arranque-linhas, .arranque-palavra, .arranque-margem { animation: arranqueTexto 0.3s ease both !important; }
    #loadingContainer.arranque-a-sair .arranque-margem { opacity: 0; }
}

/* =========================================================
   APP SHELL, MENU LATERAL E ÁREA PRINCIPAL
   ========================================================= */
#appShell { display: none; width: 100%; height: 100%; overflow: hidden; position: absolute; inset: 0; }

.sidebar {
    width: var(--sidebar-width); background: var(--card-bg); border-right: 1px solid var(--border-color);
    display: flex; flex-direction: column; height: 100%; position: absolute; top: 0; left: 0; bottom: 0;
    z-index: 100; transition: width 0.3s ease; padding-bottom: env(safe-area-inset-bottom);
}
.sidebar-header {
    padding: 25px 20px; padding-top: max(25px, env(safe-area-inset-top));
    display: flex; justify-content: space-between; align-items: center; transition: all 0.3s ease;
}
.logo-full img { max-width: 120px; }
.logo-icon { display: none; justify-content: center; align-items: center; height: 36px; }
.logo-icon img { max-width: 34px; }
.desktop-toggle-btn {
    background: transparent; border: none; color: var(--text-main); cursor: pointer;
    display: flex; align-items: center; justify-content: center; padding: 6px;
    border-radius: var(--radius-sm); transition: all 0.2s ease; width: 36px; height: 36px;
}
.desktop-toggle-btn .ic { width: 22px; height: 22px; }
.desktop-toggle-btn:hover { background: var(--input-bg); color: var(--accent); }
.icon-expand { display: none !important; }
#appShell.collapsed .icon-collapse { display: none !important; }
#appShell.collapsed .icon-expand { display: inline-flex !important; }

#appShell.collapsed .sidebar { width: var(--sidebar-width-collapsed); }
#appShell.collapsed .main-wrapper { margin-left: var(--sidebar-width-collapsed); }
#appShell.collapsed .sidebar-header { flex-direction: column; padding: 25px 10px; }
#appShell.collapsed .logo-full { display: none; }
#appShell.collapsed .logo-icon { display: flex; }
#appShell.collapsed .desktop-toggle-btn { display: none; }
#appShell.collapsed .sidebar-header:hover .logo-icon { display: none; }
#appShell.collapsed .sidebar-header:hover .desktop-toggle-btn { display: flex; margin: 0 auto; }
#appShell.collapsed .nav-text,
#appShell.collapsed .nav-divider,
#appShell.collapsed .nav-badge,
#appShell.collapsed .sidebar-version { display: none; }
#appShell.collapsed .nav-item { justify-content: center; padding: 12px 0; width: 44px; margin: 0 auto; border-radius: var(--radius-main); }

.nav-menu { padding: 10px 15px; display: flex; flex-direction: column; gap: 6px; flex: 1; overflow-y: auto; overflow-x: hidden; }
.nav-divider { font-size: 11px; font-weight: 700; color: var(--text-muted); margin: 15px 10px 5px; white-space: nowrap; }
.nav-divider:first-child { margin-top: 0; }
.nav-item {
    display: flex; align-items: center; gap: 12px; padding: 11px 15px; background: transparent; border: none; width: 100%; text-align: left;
    font-size: 15px; font-weight: 600; color: var(--text-muted); border-radius: var(--radius-sm); cursor: pointer; transition: all 0.2s ease; position: relative;
}
.nav-item .ic { width: 20px; height: 20px; }
.nav-item .ic svg { stroke-width: 2.3px; }
.nav-text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item:hover { background: var(--input-bg); color: var(--accent); }
.nav-item.active { background: none; color: var(--text-main); font-weight: 650; }
/* A barra da margem marca a página ativa, como no logótipo */
.nav-item.active::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 4px; border-radius: 1px; background: var(--margem); }
#appShell.collapsed .nav-item.active::before { left: -10px; }
/* Com o JavaScript ativo, a barra é um só elemento que desliza de uma página para a outra */
.nav-indicador { position: absolute; top: 0; left: 0; width: 4px; height: 0; border-radius: 1px; background: var(--margem); z-index: 2; pointer-events: none; opacity: 0; will-change: transform; }
.nav-indicador.visivel { opacity: 1; }
.nav-indicador.a-deslizar { transition: transform 0.42s cubic-bezier(0.3, 0.8, 0.25, 1), height 0.42s cubic-bezier(0.3, 0.8, 0.25, 1), opacity 0.2s ease; }
.sidebar.com-indicador .nav-item.active::before { display: none; }
@media (prefers-reduced-motion: reduce) { .nav-indicador.a-deslizar { transition: opacity 0.2s ease; } }
.nav-item.danger-btn:hover { background: rgba(255, 23, 68, 0.1); color: var(--danger-color); }
.nav-badge {
    margin-left: auto; background: rgba(var(--accent-rgb), 0.12); color: var(--accent);
    font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 12px; min-width: 22px; text-align: center;
}
.nav-badge:empty { display: none; }

.sidebar-footer { padding: 16px 15px 18px; border-top: 1px solid var(--border-color); background: var(--card-bg); display: flex; flex-direction: column; gap: 4px; }
.sidebar-version { display: block; text-align: center; font-size: 11px; font-weight: 700; color: var(--text-muted); margin-top: 12px; text-decoration: none; }
a.sidebar-version:hover { color: var(--accent); text-decoration: underline; }

/* Cartão anónimo no fim do menu lateral (sem nome nem email) */
.user-info {
    display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 8px; padding: 12px 8px 0;
    border: 0; border-top: 1px solid var(--border-color); background: none; text-align: left; color: inherit; cursor: pointer;
}
.user-avatar {
    flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%;
    background: var(--accent); color: var(--accent-text); transition: box-shadow 0.2s ease;
}
.user-avatar .ic { width: 18px; height: 18px; }
.user-info:hover .user-avatar { box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.2); }
.user-dados { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.user-nome { font-size: 13.5px; font-weight: 700; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-sub { font-size: 12px; font-weight: 500; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#appShell.collapsed .user-info { justify-content: center; padding: 12px 0 0; }
#appShell.collapsed .user-dados { display: none; }

.main-wrapper {
    margin-left: var(--sidebar-width); height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch;
    display: flex; flex-direction: column; background-color: var(--bg-color); transition: margin-left 0.3s ease;
}
.content-area { padding: 40px 5vw; max-width: 1400px; margin: 0 auto; width: 100%; flex: 1; padding-bottom: max(40px, env(safe-area-inset-bottom)); }
.app-view { display: none; }
.app-view.ativa { display: block; animation: containerFadeIn 0.3s ease-out both; }

.app-header {
    display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 36px;
    border-bottom: 2px solid var(--border-color); padding-bottom: 15px; padding-top: 12px;
}
.app-header.sem-linha { border-bottom: none; margin-bottom: 10px; }
.title-container { min-width: 0; }
.title-container h2 { font-size: 36px; font-weight: 600; line-height: 1.05; color: var(--accent); letter-spacing: -0.02em; display: flex; align-items: center; gap: 10px; }
.title-container .subtitle { display: block; font-size: 14px; color: var(--text-muted); font-weight: 600; margin-top: 8px; }
.header-actions { display: flex; gap: 10px; flex-shrink: 0; }

.info-btn {
    background: var(--input-bg); color: var(--text-muted); border: 1px solid var(--border-color); border-radius: 50%;
    width: 22px; height: 22px; font-size: 12px; font-weight: 700; cursor: pointer; display: inline-flex; justify-content: center; align-items: center;
    transition: all 0.2s; flex-shrink: 0; font-family: 'Schibsted Grotesk', sans-serif; letter-spacing: 0;
}
.info-btn:hover { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }

/* BOTÕES */
.top-btn {
    background: transparent; color: var(--text-main); border: 1px solid var(--border-color); height: 40px; padding: 0 15px; border-radius: var(--radius-sm);
    cursor: pointer; display: inline-flex; justify-content: center; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; transition: all 0.2s ease; white-space: nowrap;
}
.top-btn .ic { width: 18px; height: 18px; }
.top-btn.icon-only { width: 40px; padding: 0; }
a.top-btn { text-decoration: none; }
.top-btn:hover { background: var(--input-bg); border-color: var(--accent); color: var(--accent); }
.top-btn.danger-btn:hover { background: rgba(255, 23, 68, 0.1); color: var(--danger-color); border-color: var(--danger-color); }

.btn-primary {
    background-color: var(--primary-color); color: #FFFFFF; border: none; padding: 12px 24px; font-size: 15px; font-weight: 700;
    border-radius: var(--radius-sm); cursor: pointer; box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.2); transition: all 0.2s ease;
    display: inline-flex; align-items: center; gap: 8px; justify-content: center; white-space: nowrap;
}
.btn-primary .ic { width: 18px; height: 18px; }
.btn-primary:hover { background-color: var(--hover-color); box-shadow: 0 0 15px rgba(var(--primary-rgb), 0.45); }
.btn-secondary {
    background: transparent; color: var(--text-main); border: 1px solid var(--border-color); padding: 12px 22px; font-size: 15px; font-weight: 600;
    border-radius: var(--radius-sm); cursor: pointer; transition: all 0.2s ease; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-secondary .ic { width: 17px; height: 17px; }
.btn-secondary:hover { background: var(--input-bg); border-color: var(--text-muted); }
.btn-danger, body.dark-mode .btn-danger, body.oled-mode .btn-danger { background: var(--danger-color); color: var(--danger-text); box-shadow: 0 4px 12px rgba(255, 23, 68, 0.2); }
.btn-danger:hover, body.dark-mode .btn-danger:hover, body.oled-mode .btn-danger:hover { background: var(--danger-hover); box-shadow: 0 0 15px rgba(255, 23, 68, 0.4); }

button.gerar-btn {
    background-color: var(--primary-color); color: #FFFFFF; border: none; padding: 16px 32px; font-size: 16px; font-weight: 600;
    border-radius: var(--radius-sm); cursor: pointer; width: 100%; margin-top: 10px; transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.15); display: flex; justify-content: center; align-items: center; gap: 10px;
}
button.gerar-btn .ic { width: 20px; height: 20px; }
button.gerar-btn:hover { background-color: var(--hover-color); box-shadow: 0 6px 16px rgba(var(--primary-rgb), 0.25); transform: translateY(-2px); }
body.dark-mode button.gerar-btn, body.oled-mode button.gerar-btn { background: var(--success-color); color: var(--success-text); box-shadow: 0 4px 12px rgba(var(--success-rgb), 0.15); }
body.dark-mode button.gerar-btn:hover, body.oled-mode button.gerar-btn:hover { background: var(--success-hover); }

/* FORMULÁRIOS */
.form-container { background: var(--card-bg); padding: 40px; border-radius: var(--radius-main); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04); border: 1px solid var(--border-color); }
.form-row { display: flex; gap: 25px; margin-bottom: 25px; flex-wrap: wrap; width: 100%; }
.form-group { flex: 1; min-width: 220px; display: flex; flex-direction: column; }
.form-group.estreito { flex: 0 1 200px; min-width: 160px; }
label, .label { font-weight: 600; margin-bottom: 8px; font-size: 13px; color: var(--text-muted); }
.label-opcional { text-transform: none; letter-spacing: 0; font-weight: 500; }
input, select, textarea {
    padding: 14px 18px; border: 1px solid var(--border-color); border-radius: var(--radius-sm); font-size: 15px;
    background-color: var(--input-bg); color: var(--text-main); transition: all 0.2s ease; width: 100%; max-width: 100%;
}
input::placeholder, textarea::placeholder { color: var(--text-muted); opacity: 0.75; }
select {
    -webkit-appearance: none; appearance: none; padding-right: 40px;
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23475569" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>');
    background-repeat: no-repeat; background-position: right 15px center; background-size: 16px;
}
body.dark-mode select, body.oled-mode select {
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%2394A3B8" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>');
}
input[type="date"] { -webkit-appearance: none; appearance: none; display: block; min-height: 51px; }
body.dark-mode input[type="date"], body.oled-mode input[type="date"] { color-scheme: dark; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); background-color: var(--card-bg); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.15); }
textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
textarea.curta { min-height: 90px; }
.helper-text { font-size: 12px; color: var(--text-muted); font-weight: 500; margin-top: 6px; display: block; }
.campo-invalido { border-color: var(--danger-color) !important; animation: shake 0.3s ease-in-out; }

.section-subtitle {
    font-size: 15px; font-weight: 700; color: var(--text-main); margin-bottom: 15px;
    border-bottom: 2px solid var(--border-color); padding-bottom: 8px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.section-subtitle a, .section-link { font-family: 'Schibsted Grotesk', sans-serif; text-transform: none; letter-spacing: 0; font-size: 13.5px; font-weight: 600; color: var(--accent); cursor: pointer; text-decoration: none; background: none; border: 0; }
.section-subtitle a:hover, .section-link:hover { text-decoration: underline; }

/* Campo bloqueado (disciplina atribuída pelo professor) */
.campo-fixo {
    display: flex; align-items: center; gap: 10px; min-height: 51px; padding: 0 18px; border: 1px dashed var(--border-color);
    border-radius: var(--radius-sm); background: var(--bg-color); font-size: 15px; font-weight: 600; color: var(--text-main);
}
.campo-fixo .ic { width: 16px; height: 16px; color: var(--text-muted); }

/* Estado da sincronização com o servidor */
.estado-sync { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; color: var(--text-main); }
.estado-sync .ic { width: 16px; height: 16px; color: var(--accent); }
.estado-sync.aviso .ic { color: var(--warning-color); }

/* Escala 1–5 (nível de domínio, foco...) */
.escala { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.escala input { display: none; }
.escala label {
    margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    padding: 12px 4px; border: 1px solid var(--border-color); background: var(--input-bg); border-radius: var(--radius-sm);
    cursor: pointer; transition: all 0.2s; text-transform: none; letter-spacing: 0; color: var(--text-main);
}
.escala label b { font-family: 'Schibsted Grotesk', sans-serif; font-size: 20px; line-height: 1.1; }
.escala label small { font-size: 11px; font-weight: 600; color: var(--text-muted); text-align: center; line-height: 1.2; }
.escala label .emoji { font-size: 24px; line-height: 1.1; }
.escala label:hover { border-color: var(--accent); }
.escala input:checked + label { background: var(--accent); border-color: var(--accent); color: var(--accent-text); box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.2); }
.escala input:checked + label small { color: inherit; opacity: 0.9; }

/* Etiquetas em pílula (categorias das notas, métodos de estudo) */
.pill-tags { display: flex; gap: 10px; flex-wrap: wrap; }
.pill-tags label { margin: 0; cursor: pointer; text-transform: none; letter-spacing: 0; }
.pill-tags input { display: none; }
.pill-tag {
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: 1px solid var(--border-color); background: var(--card-bg); color: var(--text-muted); transition: all 0.2s;
}
.pill-tags label:hover .pill-tag { border-color: var(--accent); color: var(--text-main); }
.pill-tags input:checked + .pill-tag { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }

.feed-pill {
    border: 1px solid var(--accent); color: var(--accent); background: rgba(var(--accent-rgb), 0.05);
    padding: 3px 10px; font-size: 11px; border-radius: 20px; font-weight: 700; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
}
.feed-pill.neutra { border-color: var(--border-color); color: var(--text-muted); background: var(--input-bg); }

.empty-state { text-align: center; padding: 36px 20px; color: var(--text-muted); grid-column: 1 / -1; }
.empty-state > .ic { display: none; }
.empty-state p { font-size: 15px; }
.empty-state span { font-size: 13.5px; display: block; margin-top: 4px; }
.empty-state .btn-primary, .empty-state .btn-secondary { margin-top: 14px; }

/* =========================================================
   INÍCIO (DASHBOARD)
   ========================================================= */
.dashboard-layout { display: grid; grid-template-columns: 2.6fr 1fr; gap: 25px; align-items: start; margin-top: 10px; }
.dash-main { display: flex; flex-direction: column; gap: 36px; min-width: 0; }
.dash-sidebar { display: flex; flex-direction: column; gap: 25px; min-width: 0; }

.faixa-agora { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.faixa-item {
    display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 14px 16px; text-align: left;
    background: var(--card-bg); border: 1px solid var(--border-color); border-left: 4px solid var(--border-color);
    border-radius: var(--radius-main); color: var(--text-main); cursor: pointer; transition: all 0.2s ease;
}
.faixa-item:hover { border-color: var(--accent); }
.faixa-item.destaque { border-left-color: var(--accent); background: rgba(var(--accent-rgb), 0.05); }
.faixa-rotulo { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: var(--text-muted); }
.faixa-item.destaque .faixa-rotulo { color: var(--accent); }
.faixa-rotulo i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.faixa-item strong { font-family: 'Schibsted Grotesk', sans-serif; font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.faixa-meta { font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tools-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 15px; }
.tool-widget {
    background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--radius-main); padding: 22px 15px; text-align: center; cursor: pointer;
    transition: all 0.2s ease; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02); color: inherit;
}
.tool-widget:hover { border-color: var(--accent); }
.tool-widget-icon { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; color: var(--accent); }
.tool-widget-icon .ic { width: 24px; height: 24px; }
.tool-widget h4 { font-size: 18px; font-weight: 700; color: var(--text-main); letter-spacing: 0.01em; line-height: 1; }
.tool-widget .tool-desc { font-size: 11px; font-weight: 600; color: var(--text-muted); }

.info-widget { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--radius-main); padding: 24px; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02); }
.info-widget-title {
    font-size: 13px; color: var(--text-muted); margin-bottom: 18px;
    border-bottom: 2px solid var(--input-bg); padding-bottom: 12px; font-weight: 800; display: flex; align-items: center; gap: 8px;
}
body.dark-mode .info-widget-title, body.oled-mode .info-widget-title { border-bottom-color: var(--border-color); }
.info-widget-title .ic { width: 16px; height: 16px; }
.info-widget-title .section-link { margin-left: auto; }
.info-item { margin-bottom: 16px; }
.info-item:last-child { margin-bottom: 0; }
.info-label { font-size: 11px; font-weight: 700; color: var(--text-muted); margin-bottom: 6px; display: block; }
.info-value { font-size: 15px; font-weight: 600; color: var(--text-main); display: flex; align-items: center; gap: 8px; line-height: 1.4; }
.info-value .ic { width: 16px; height: 16px; color: var(--accent); }
.info-texto { font-size: 13.5px; color: var(--text-muted); line-height: 1.55; }
.info-widget.privacidade { border-left: 4px solid var(--accent); }

.mini-stat { background: var(--input-bg); border: 1px solid var(--border-color); border-radius: var(--radius-sm); padding: 12px; }
.mini-stat .stat-valor { font-size: 24px; font-weight: 700; color: var(--accent); line-height: 1.1; display: block; }
.mini-stat .stat-rotulo { display: block; font-size: 10.5px; font-weight: 700; color: var(--text-muted); line-height: 1.3; margin-top: 2px; }

.metas-mini { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.metas-mini li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; font-weight: 500; line-height: 1.4; }
.metas-mini .meta-check { margin-top: 1px; }
.metas-mini-vazio { font-size: 13.5px; color: var(--text-muted); }

/* Atividade recente / lista do diário (estilo "Relatórios") */
.report-list { display: flex; flex-direction: column; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--radius-main); overflow: hidden; }
.report-list:empty, .report-list:has(> .empty-state), .report-list:has(> .esqueleto-lista) { background: none; border: 0; border-radius: 0; overflow: visible; }
.report-item {
    background: none; border: 0; border-top: 1px solid var(--border-color); border-radius: 0;
    padding: 18px 20px; display: flex; justify-content: space-between; align-items: center; gap: 16px; transition: all 0.2s; cursor: pointer;
}
.report-item:first-child { border-top: 0; }
.report-item:hover { background: var(--input-bg); }
.report-icone { width: 24px; height: 24px; color: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.report-icone .ic { width: 22px; height: 22px; }
.report-info { flex: 1; min-width: 0; }
.report-info h4 { font-size: 17px; font-weight: 600; color: var(--text-main); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.report-info p { font-size: 13.5px; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.report-info p .sep { opacity: 0.5; }
.report-actions { display: flex; gap: 8px; flex-shrink: 0; }
.report-actions .top-btn { height: 36px; }
.report-actions .top-btn.icon-only { width: 36px; }
.report-actions .top-btn:not(.icon-only) { padding: 0 14px; font-size: 14px; font-weight: 600; }
/* Menu "⋯" com as ações menos usadas */
.menu-acoes { position: relative; }
.menu-acoes > summary { list-style: none; cursor: pointer; font-size: 18px; line-height: 1; letter-spacing: 1px; }
.menu-acoes > summary::-webkit-details-marker { display: none; }
.menu-acoes-lista { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 160px; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--radius-sm); box-shadow: var(--sombra-2); padding: 4px; }
.menu-acoes-lista button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 12px; background: none; border: 0; border-radius: 6px; font-size: 14px; font-weight: 600; color: var(--text-main); cursor: pointer; text-align: left; }
.menu-acoes-lista button .ic { width: 16px; height: 16px; }
.menu-acoes-lista button:hover { background: var(--input-bg); }
.menu-acoes-lista button.perigo { color: var(--danger-color); }

.nivel-pontos { display: inline-flex; gap: 3px; vertical-align: middle; }
.nivel-pontos i { width: 8px; height: 8px; border-radius: 50%; background: var(--border-color); }
.nivel-pontos i.on { background: var(--accent); }

/* Barra de filtros (Diário, Notas) */
.filtros-bar { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 22px; }
.filtros-bar .form-group { min-width: 160px; }
.filtros-bar .form-group.cresce { flex: 2; min-width: 220px; }
.filtros-bar input, .filtros-bar select { padding: 12px 16px; }
.filtros-bar select { padding-right: 40px; }
.filtros-contagem { font-size: 13px; color: var(--text-muted); font-weight: 600; margin: -8px 0 14px; }

/* =========================================================
   NOTAS (estilo "As minhas notas" do Theora)
   ========================================================= */
.nota-captura { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--radius-main); padding: 24px; margin-bottom: 36px; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02); }
.nota-captura textarea { min-height: 100px; margin-bottom: 18px; }
.nota-captura-acoes { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.notas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.nota-card {
    background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--radius-sm); padding: 20px; position: relative;
    transition: all 0.2s; display: flex; flex-direction: column; min-height: 200px; cursor: pointer; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}
.nota-card.fixada { border-color: var(--accent); box-shadow: 0 4px 15px rgba(var(--accent-rgb), 0.1); }
.nota-card:hover { transform: translateY(-3px); box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05); border-color: var(--accent); }
.nota-card-topo { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 12px; }
.nota-data { font-size: 11px; color: var(--text-muted); font-weight: 600; display: block; margin-top: 6px; }
.nota-texto { font-size: 15px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; flex: 1; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 6; line-clamp: 6; -webkit-box-orient: vertical; }
.nota-fixada-ic { width: 14px; height: 14px; color: var(--accent); }

.menu-pontos { position: relative; }
.menu-pontos-btn { width: 32px; height: 32px; border-radius: var(--radius-sm); border: 1px solid transparent; background: transparent; color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.menu-pontos-btn .ic { width: 18px; height: 18px; }
.menu-pontos-btn:hover { background: var(--input-bg); border-color: var(--border-color); color: var(--text-main); }
.menu-dropdown {
    display: none; position: absolute; right: 0; top: calc(100% + 4px); background: var(--card-bg); border: 1px solid var(--border-color);
    border-radius: var(--radius-sm); box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15); z-index: 50; min-width: 160px; overflow: hidden; animation: popIn 0.15s ease-out;
}
.menu-dropdown.show { display: block; }
.menu-dropdown button {
    padding: 10px 15px; font-size: 13.5px; font-weight: 600; color: var(--text-main); background: transparent; border: none; width: 100%;
    text-align: left; cursor: pointer; display: flex; align-items: center; gap: 9px; transition: background 0.2s;
}
.menu-dropdown button .ic { width: 15px; height: 15px; }
.menu-dropdown button:hover { background: var(--input-bg); color: var(--accent); }
.menu-dropdown button.perigo:hover { background: rgba(255, 23, 68, 0.1); color: var(--danger-color); }

/* =========================================================
   METAS
   ========================================================= */
.metas-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 25px; align-items: start; }
.metas-coluna { display: flex; flex-direction: column; gap: 12px; }
.meta-card {
    display: flex; align-items: flex-start; gap: 14px; background: var(--card-bg); border: 1px solid var(--border-color);
    border-radius: var(--radius-sm); padding: 16px 18px; transition: all 0.2s;
}
.meta-card:hover { border-color: var(--accent); }
.meta-card.concluida { opacity: 0.75; }
.meta-card.concluida .meta-texto { text-decoration: line-through; color: var(--text-muted); }
.meta-check {
    width: 24px; height: 24px; flex-shrink: 0; border-radius: 50%; border: 2px solid var(--border-color); background: var(--input-bg);
    cursor: pointer; display: flex; align-items: center; justify-content: center; color: transparent; transition: all 0.2s; padding: 0;
}
.meta-check .ic { width: 14px; height: 14px; }
.meta-check:hover { border-color: var(--accent); }
.meta-check.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.meta-corpo { flex: 1; min-width: 0; }
.meta-texto { font-size: 15.5px; font-weight: 600; line-height: 1.4; word-break: break-word; }
.meta-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.meta-prazo { font-size: 12px; font-weight: 600; color: var(--text-muted); display: inline-flex; align-items: center; gap: 4px; }
.meta-prazo .ic { width: 13px; height: 13px; }
.meta-prazo.atrasada { color: var(--danger-color); }
.meta-apagar { background: none; border: 0; color: var(--text-muted); cursor: pointer; width: 30px; height: 30px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.meta-apagar .ic { width: 16px; height: 16px; }
.meta-apagar:hover { background: rgba(255, 23, 68, 0.1); color: var(--danger-color); }

.progresso-metas { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.barra { flex: 1; height: 10px; background: var(--input-bg); border: 1px solid var(--border-color); border-radius: 999px; overflow: hidden; }
.barra span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width 0.4s ease; }
.progresso-metas b { font-size: 14px; white-space: nowrap; }

/* =========================================================
   PROGRESSO
   ========================================================= */
.total-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin-bottom: 30px; }
.cartao-dados { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--radius-main); padding: 20px 22px 12px; }
.cartao-dados h3 { font-size: 16px; font-weight: 650; margin-bottom: 6px; }
dl.dados { margin: 0; }
dl.dados > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 9px 0; border-top: 1px solid var(--border-color); }
dl.dados > div:first-child { border-top: 0; }
dl.dados dt { font-size: 14px; color: var(--text-muted); }
dl.dados dd { font-size: 15px; font-weight: 650; color: var(--text-main); text-align: right; }
dl.dados dd small { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.frase-numeros { font-size: 15px; color: var(--text-muted); margin: 0 0 18px; }
.frase-numeros:empty { display: none; }

.progresso-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 25px; align-items: start; }
.grafico-card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--radius-main); padding: 24px; }
.grafico-card h3 { font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.grafico-card .grafico-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }

/* Barras horizontais: domínio médio por disciplina (uma só série → sem legenda) */
.barras-h { display: flex; flex-direction: column; gap: 14px; }
.barra-h { display: grid; grid-template-columns: 120px minmax(0, 1fr) 44px; align-items: center; gap: 12px; position: relative; }
.barra-h-nome { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barra-h-pista { display: block; height: 14px; border-radius: 0 4px 4px 0; background: transparent; border-left: 1px solid var(--border-color); position: relative; }
.barra-h-pista::before { content: ""; position: absolute; inset: 6px 0; border-top: 1px dashed var(--border-color); opacity: 0.6; }
.barra-h-fill { display: block; position: relative; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; min-width: 4px; transition: width 0.5s ease; }
.barra-h-valor { font-size: 13px; font-weight: 700; color: var(--text-main); text-align: right; }
.barra-h-n { font-size: 11px; color: var(--text-muted); font-weight: 600; }
.barra-h:hover .barra-h-fill { box-shadow: 0 0 0 2px var(--card-bg), 0 0 0 3px var(--accent); }

/* Calendário de atividade (sequencial: uma só cor, intensidade = nº de registos) */
.atividade-grelha { display: grid; grid-template-columns: 26px repeat(12, minmax(0, 1fr)); gap: 4px; }
.atividade-dia-nome { font-size: 10px; font-weight: 700; color: var(--text-muted); display: flex; align-items: center; }
.atividade-cel { aspect-ratio: 1; border-radius: 3px; background: var(--input-bg); border: 1px solid var(--border-color); position: relative; }
.atividade-cel[data-n="1"] { background: rgba(var(--accent-rgb), 0.3); border-color: transparent; }
.atividade-cel[data-n="2"] { background: rgba(var(--accent-rgb), 0.55); border-color: transparent; }
.atividade-cel[data-n="3"] { background: rgba(var(--accent-rgb), 0.8); border-color: transparent; }
.atividade-cel[data-n="4"] { background: var(--accent); border-color: transparent; }
.atividade-cel.futuro { opacity: 0.35; }
.atividade-cel:hover { box-shadow: 0 0 0 2px var(--card-bg), 0 0 0 3px var(--text-main); z-index: 1; }
.atividade-legenda { display: flex; align-items: center; gap: 4px; justify-content: flex-end; margin-top: 12px; font-size: 11px; color: var(--text-muted); font-weight: 600; }
.atividade-legenda .atividade-cel { width: 12px; height: 12px; aspect-ratio: auto; }
.atividade-legenda span { margin: 0 4px; }

/* Humor semanal (linha temporal simples em colunas) */
.humor-linha { display: flex; align-items: flex-end; gap: 8px; height: 140px; padding-top: 10px; border-bottom: 1px solid var(--border-color); }
.humor-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; min-width: 0; position: relative; }
.humor-col .humor-barra { width: 100%; max-width: 28px; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 4px; }
.humor-col .humor-emoji { font-size: 16px; line-height: 1; }
.humor-eixo { display: flex; gap: 8px; margin-top: 6px; }
.humor-eixo span { flex: 1; text-align: center; font-size: 10.5px; color: var(--text-muted); font-weight: 600; white-space: nowrap; overflow: hidden; }

.tooltip-grafico {
    position: fixed; z-index: 11000; pointer-events: none; background: var(--text-main); color: var(--card-bg);
    padding: 7px 10px; border-radius: var(--radius-sm); font-size: 12.5px; font-weight: 600; line-height: 1.35; max-width: 240px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2); opacity: 0; transform: translateY(4px); transition: opacity 0.12s, transform 0.12s;
}
.tooltip-grafico.show { opacity: 1; transform: none; }
.tooltip-grafico small { display: block; font-weight: 500; opacity: 0.8; }
.ver-tabela { margin-top: 14px; }
.ver-tabela summary { font-size: 13px; font-weight: 600; color: var(--accent); cursor: pointer; }
.tabela-dados { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 13px; }
.tabela-dados th, .tabela-dados td { padding: 7px 8px; border-bottom: 1px solid var(--border-color); text-align: left; }
.tabela-dados th { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.tabela-dados td:last-child, .tabela-dados th:last-child { text-align: right; }

/* =========================================================
   DEFINIÇÕES
   ========================================================= */
.def-pagina { max-width: 860px; }
.def-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.def-nav button {
    display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--card-bg);
    border: 1px solid var(--border-color); color: var(--text-main); font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}
.def-nav button .ic { width: 16px; height: 16px; color: var(--text-muted); }
.def-nav button:hover { border-color: var(--accent); color: var(--accent); }
.def-nav button:hover .ic { color: var(--accent); }
.def-nav button.ativo, .def-nav button.ativo:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.def-nav button.ativo .ic { color: var(--accent-text); }
.def-secao {
    display: none; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--radius-main);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02); padding: 28px; margin-bottom: 24px;
}
.def-secao.ativa { display: block; animation: containerFadeIn 0.25s ease-out; }
.def-secao-cabecalho { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 24px; padding-bottom: 18px; border-bottom: 1px solid var(--border-color); }
.def-secao-icone { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 40px; height: 40px; border-radius: var(--radius-sm); background: rgba(var(--accent-rgb), 0.1); color: var(--accent); }
.def-secao-icone .ic { width: 20px; height: 20px; }
.def-secao-cabecalho h3 { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.def-secao-cabecalho p { font-size: 14px; color: var(--text-muted); }
.def-acoes { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border-color); flex-wrap: wrap; }
.def-linha { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--border-color); }
.def-linha:last-child { border-bottom: none; padding-bottom: 0; }
.def-linha:first-child { padding-top: 0; }
.def-linha-texto strong { display: block; font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.def-linha-texto span { font-size: 13.5px; color: var(--text-muted); }
.def-codigo { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; font-weight: 700; padding: 6px 12px; border-radius: var(--radius-sm); background: var(--input-bg); border: 1px solid var(--border-color); letter-spacing: 0.08em; }

.theme-mode-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.theme-mode-card {
    background: var(--input-bg); border: 2px solid var(--border-color); border-radius: var(--radius-sm); padding: 0 0 12px; overflow: hidden;
    display: flex; flex-direction: column; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; font-weight: 700;
    color: var(--text-muted); transition: all 0.2s ease; user-select: none;
}
.theme-mode-card:hover { border-color: var(--accent); color: var(--text-main); transform: translateY(-2px); }
.theme-mode-card.active { border-color: var(--accent); color: var(--accent); background: rgba(var(--accent-rgb), 0.05); }
.theme-mode-card span { display: inline-flex; align-items: center; gap: 6px; }
.theme-mode-card span .ic { width: 15px; height: 15px; }
.tema-miniatura { width: 100%; height: 74px; display: grid; grid-template-columns: 26% 1fr; border-bottom: 1px solid var(--border-color); }
.tema-miniatura i { display: block; }
.tema-miniatura .mini-lado { border-right: 1px solid rgba(128, 128, 128, 0.2); padding: 8px 6px; display: flex; flex-direction: column; gap: 5px; }
.tema-miniatura .mini-lado b { display: block; height: 5px; border-radius: 3px; background: rgba(128, 128, 128, 0.35); }
.tema-miniatura .mini-lado b:first-child { background: var(--primary-color); width: 70%; }
.tema-miniatura .mini-corpo { padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.tema-miniatura .mini-corpo b { display: block; height: 7px; border-radius: 3px; width: 55%; background: var(--primary-color); }
.tema-miniatura .mini-corpo i { height: 20px; border-radius: 3px; border: 1px solid rgba(128, 128, 128, 0.25); }
.tema-miniatura.claro { background: #F5F6FC; } .tema-miniatura.claro .mini-lado, .tema-miniatura.claro .mini-corpo i { background: #FFFFFF; }
.tema-miniatura.escuro { background: #11152A; } .tema-miniatura.escuro .mini-lado, .tema-miniatura.escuro .mini-corpo i { background: #191E38; }
.tema-miniatura.preto { background: #000000; } .tema-miniatura.preto .mini-lado, .tema-miniatura.preto .mini-corpo i { background: #000000; }
.tema-miniatura.escuro .mini-lado b:first-child, .tema-miniatura.escuro .mini-corpo b,
.tema-miniatura.preto .mini-lado b:first-child, .tema-miniatura.preto .mini-corpo b { background: var(--success-color); }

.theme-colors-palette { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.color-swatch-btn { width: 32px; height: 32px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; position: relative; }
.color-swatch-btn:hover { transform: scale(1.1); }
.color-swatch-btn.active { box-shadow: 0 0 0 2px var(--card-bg), 0 0 0 4px var(--text-main); }
.def-subtexto { font-size: 13px; color: var(--text-muted); margin: -6px 0 12px; }

.backup-tipos { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 6px; }
.pill-checkbox-card {
    display: flex; align-items: center; gap: 8px; background: var(--input-bg); border: 1px solid var(--border-color); padding: 10px 14px;
    border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-main); transition: all 0.2s ease;
    user-select: none; margin: 0; text-transform: none; letter-spacing: 0;
}
.pill-checkbox-card input { width: 16px; height: 16px; margin: 0; padding: 0; accent-color: var(--primary-color); cursor: pointer; }
.pill-checkbox-card small { margin-left: auto; color: var(--text-muted); font-weight: 600; }
.pill-checkbox-card:hover { border-color: var(--accent); background: var(--card-bg); }

/* =========================================================
   AJUDA E SOBRE
   ========================================================= */
.guia-linha { margin: -6px 0 22px; font-size: 14.5px; color: var(--text-muted); }
.link-inline { background: none; border: 0; padding: 0; font: inherit; font-weight: 650; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-inline:hover { color: var(--text-main); }

.faq-search-container { text-align: center; margin-bottom: 36px; }
.faq-search-container h3 { color: var(--text-main); font-size: 26px; margin-bottom: 18px; font-weight: 600; letter-spacing: -0.02em; }
.faq-search-input { max-width: 600px; padding: 16px 25px; border-radius: 30px; border: 2px solid var(--border-color); font-size: 16px; background: var(--card-bg); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03); }
.faq-category { margin-bottom: 32px; }
.faq-category-title { font-size: 17px; font-weight: 700; color: var(--accent); margin-bottom: 14px; border-bottom: 2px solid var(--border-color); padding-bottom: 8px; }
.faq-item { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--radius-sm); margin-bottom: 12px; transition: all 0.2s ease; }
.faq-item:hover { border-color: var(--accent); }
.faq-item summary { padding: 17px 22px; font-weight: 600; font-size: 16px; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; user-select: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-size: 24px; color: var(--accent); font-weight: 400; transition: transform 0.3s; line-height: 1; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-answer { padding: 0 22px 20px; font-size: 15px; color: var(--text-muted); line-height: 1.6; animation: popIn 0.3s ease-out; }
.faq-item[open] .faq-answer { border-top: 1px solid var(--border-color); padding-top: 16px; }
.faq-answer strong { color: var(--text-main); }
.faq-answer ul { margin-top: 8px; padding-left: 20px; }
.faq-sem-resultados { display: none; }

.sobre-pagina { max-width: 860px; }
.sobre-pagina h1 { font-size: 32px; font-weight: 600; margin-bottom: 20px; letter-spacing: -0.03em; }
.sobre-pagina > p { font-size: 16px; margin-bottom: 15px; }
.sobre-pilares { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 15px; margin: 28px 0; }
.sobre-pilar { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--radius-main); padding: 20px; }
.sobre-pilar .ic { width: 24px; height: 24px; color: var(--accent); margin-bottom: 10px; display: flex; }
.sobre-pilar strong { display: block; font-size: 16px; margin-bottom: 4px; }
.sobre-pilar span { font-size: 14px; color: var(--text-muted); }
.legal-box { background: var(--input-bg); border: 1px solid var(--border-color); padding: 25px; border-radius: var(--radius-sm); margin: 30px 0; }
.legal-box h2 { font-size: 20px; font-weight: 700; margin-bottom: 15px; }
.legal-box p { font-size: 14px; color: var(--text-muted); margin-bottom: 12px; }
.legal-box p:last-child { margin-bottom: 0; }
.legal-box strong { color: var(--text-main); }
.sobre-rodape { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-top: 30px; color: var(--text-muted); font-size: 13px; }
.sobre-rodape img { height: 56px; width: auto; }

/* =========================================================
   MODAIS
   ========================================================= */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: var(--modal-backdrop); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    z-index: 10000; justify-content: center; align-items: center; padding: 20px;
}
.modal-overlay.show { display: flex; animation: containerFadeIn 0.2s ease-out; }
.modal-content {
    background: var(--card-bg); border-radius: var(--radius-main); width: 100%; max-width: 720px; max-height: 92vh; max-height: 92dvh;
    display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5); border: 1px solid var(--border-color);
    animation: popIn 0.22s ease-out;
}
.modal-content:focus { outline: none; }
.modal-content.modal-sm { max-width: 440px; text-align: center; }
.modal-content.modal-md { max-width: 560px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 26px; border-bottom: 1px solid var(--border-color); flex-shrink: 0; }
.modal-header h3 { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; min-width: 0; }
.modal-header h3 .ic { width: 20px; height: 20px; color: var(--accent); }
.close-btn { background: var(--input-bg); color: var(--text-muted); width: 36px; height: 36px; display: flex; justify-content: center; align-items: center; border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer; transition: all 0.2s; flex-shrink: 0; }
.close-btn .ic { width: 18px; height: 18px; }
.close-btn:hover { background: var(--danger-color); color: #FFFFFF; }
.modal-body { padding: 26px; font-size: 15.5px; line-height: 1.6; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.modal-body p + p { margin-top: 10px; }
.modal-sm .modal-body { padding: 30px 28px 10px; }
.modal-sm .modal-icone { width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 16px; display: flex; align-items: center; justify-content: center; background: rgba(var(--accent-rgb), 0.1); color: var(--accent); }
.modal-sm .modal-icone.perigo { background: rgba(255, 23, 68, 0.1); color: var(--danger-color); }
.modal-sm .modal-icone .ic { width: 26px; height: 26px; }
.modal-sm h3.modal-titulo { font-size: 20px; font-weight: 600; margin-bottom: 8px; }
.modal-sm .modal-body p { color: var(--text-muted); font-size: 15px; }
.modal-footer { padding: 18px 26px; border-top: 1px solid var(--border-color); display: flex; justify-content: flex-end; gap: 12px; flex-shrink: 0; flex-wrap: wrap; }
.modal-sm .modal-footer { border-top: none; justify-content: center; padding-bottom: 26px; }

/* Pré-visualização de uma entrada do diário */
.entrada-detalhe { display: flex; flex-direction: column; gap: 18px; }
.entrada-detalhe-topo { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.entrada-campo .label { display: block; margin-bottom: 4px; font-size: 12px; }
.entrada-campo p { font-size: 15.5px; white-space: pre-wrap; word-break: break-word; }
.entrada-campo p.vazio { color: var(--text-muted); font-style: italic; }
.entrada-grelha { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.entrada-grelha .mini-stat .stat-valor { font-size: 20px; }

/* Guia (slides) */
.guia-modal { max-width: 560px; }
.guia-progresso { height: 3px; background: var(--border-color); }
.guia-progresso span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.35s ease; }
.guia-corpo { padding: 28px 26px 22px; min-height: 360px; text-align: left; }
.guia-slide { animation: popIn 0.35s ease both; }
.guia-hero { text-align: center; margin-bottom: 22px; }
.guia-icone { display: flex; align-items: center; justify-content: center; width: 76px; height: 76px; margin: 0 auto 16px; border-radius: 24px; color: var(--accent); background: rgba(var(--accent-rgb), 0.12); box-shadow: 0 12px 30px rgba(var(--accent-rgb), 0.18); }
.guia-icone .ic { width: 34px; height: 34px; }
.guia-titulo { font-size: 23px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; margin: 0 0 6px; }
.guia-subtitulo { font-size: 14.5px; color: var(--text-muted); max-width: 420px; margin: 0 auto; }
.guia-pontos { list-style: none; display: grid; gap: 10px; }
.guia-pontos li { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.45; background: var(--input-bg); border: 1px solid var(--border-color); border-radius: var(--radius-main); }
.guia-pontos li .ic { width: 20px; height: 20px; padding: 3px; border-radius: 50%; color: var(--accent); background: rgba(var(--accent-rgb), 0.14); }
.guia-rodape { padding: 14px 22px; display: flex; justify-content: space-between; align-items: center; gap: 12px; border-top: 1px solid var(--border-color); }
.guia-indicadores { display: flex; gap: 6px; align-items: center; }
.guia-ponto { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 4px; background: var(--border-color); cursor: pointer; transition: all 0.3s ease; }
.guia-ponto.ativo { width: 22px; background: var(--accent); }
.guia-botoes { display: flex; gap: 8px; }
.guia-botoes button { padding: 10px 18px; font-size: 14px; }

/* TOAST */
#toast {
    position: fixed; bottom: 30px; right: 30px; z-index: 10500; display: flex; align-items: center; gap: 12px;
    background: var(--card-bg); border: 1px solid var(--border-color); border-left: 4px solid var(--accent); border-radius: var(--radius-main);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12); padding: 14px 18px; font-size: 14px; font-weight: 600; max-width: 380px;
    opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity 0.2s ease, transform 0.25s ease;
}
#toast.show { opacity: 1; transform: none; pointer-events: auto; }
#toast .ic { width: 20px; height: 20px; color: var(--accent); }
#toast { cursor: pointer; }
#toast.aviso { border-left-color: #D97706; }
#toast.aviso .ic { color: #D97706; }
#toast.erro { border-left-color: var(--danger-color); }
#toast.erro .ic { color: var(--danger-color); }
@media (prefers-reduced-motion: reduce) { #toast { transition: none; } }

/* =========================================================
   MOBILE: BARRA INFERIOR "LIQUID GLASS" E MENU MAIS
   ========================================================= */
.bottom-nav-bar, .floating-more-menu, .menu-mais-fundo { display: none; }

@media (max-width: 1050px) {
    .dashboard-layout { grid-template-columns: 1fr; }
    .dash-sidebar { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
    .progresso-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    html, body { height: auto; min-height: 100%; overflow: auto; }
    #landingContainer { position: static; min-height: 100vh; min-height: 100dvh; overflow: visible; }
    #appShell { position: static; height: auto; overflow: visible; }
    .main-wrapper { margin-left: 0 !important; height: auto; overflow: visible; }
    .sidebar { display: none !important; }
    .content-area { padding-top: calc(env(safe-area-inset-top, 0px) + 20px) !important; padding-bottom: max(120px, calc(env(safe-area-inset-bottom) + 100px)) !important; }
    #toast { left: 15px; right: 15px; bottom: calc(max(20px, env(safe-area-inset-bottom)) + 84px); max-width: none; }

    .bottom-nav-bar {
        display: flex; position: fixed; bottom: max(20px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
        width: calc(100% - 30px); max-width: 500px; justify-content: space-between; align-items: center;
        background: rgba(255, 255, 255, 0.75); border: 1px solid rgba(255, 255, 255, 0.4);
        backdrop-filter: blur(25px) saturate(200%); -webkit-backdrop-filter: blur(25px) saturate(200%);
        border-radius: 35px; box-shadow: 0 15px 45px rgba(0, 0, 0, 0.1); padding: 8px 10px; z-index: 9000;
    }
    body.dark-mode .bottom-nav-bar { background: rgba(25, 30, 56, 0.75); border-color: rgba(255, 255, 255, 0.05); box-shadow: 0 15px 45px rgba(0, 0, 0, 0.4); }
    body.oled-mode .bottom-nav-bar { background: rgba(5, 5, 5, 0.75); border-color: rgba(255, 255, 255, 0.1); box-shadow: 0 15px 45px rgba(255, 255, 255, 0.02); }
    /* A bolha: posição, tamanho e forma calculados em JS (física de mola), para seguir o dedo sem atraso,
       crescer para lá da barra quando é agarrada e encaixar com um ressalto ao largar */
    .bottom-nav-bar { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
    .nav-indicator {
        position: absolute; top: 0; left: 0; width: 0; height: 0; background: rgba(var(--accent-rgb), 0.08); border-radius: 24px;
        box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.05); z-index: 1; pointer-events: none; transform-origin: 0 0;
        transition: background-color 0.2s ease, box-shadow 0.2s ease;
    }
    /* Agarrada: lente de vidro que se sobrepõe à barra */
    .nav-indicator.agarrada {
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.12)), rgba(var(--accent-rgb), 0.10);
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7), inset 0 2px 10px rgba(255, 255, 255, 0.6), 0 10px 28px rgba(17, 21, 42, 0.16), 0 0 0 0.5px rgba(var(--accent-rgb), 0.12);
        backdrop-filter: blur(4px) saturate(180%); -webkit-backdrop-filter: blur(4px) saturate(180%);
    }
    body.dark-mode .nav-indicator.agarrada, body.oled-mode .nav-indicator.agarrada {
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.03)), rgba(var(--accent-rgb), 0.12);
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), inset 0 2px 10px rgba(255, 255, 255, 0.08), 0 10px 28px rgba(0, 0, 0, 0.45);
    }
    .bottom-nav-item {
        background: transparent; border: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
        color: var(--text-muted); padding: 8px 5px; border-radius: 24px; cursor: pointer; flex: 1; position: relative; z-index: 2; outline: none;
        -webkit-tap-highlight-color: transparent;
    }
    /* A cor de destaque vem de uma cópia dos ícones recortada pela forma da bolha (clip-path, definido em JS):
       fica colorido exatamente o que está debaixo da bolha */
    .nav-cor-janela { position: absolute; top: 0; left: 0; width: 0; height: 0; z-index: 3; pointer-events: none; transform-origin: 0 0; }
    .nav-cor {
        position: absolute; top: 0; left: 0; box-sizing: border-box; pointer-events: none; transform-origin: 0 0;
        display: flex; justify-content: space-between; align-items: center; color: var(--accent);
    }
    .nav-cor .bottom-nav-item { color: inherit; cursor: default; }
    @media (hover: hover) { .bottom-nav-bar > .bottom-nav-item:hover { color: var(--text-main); } }
    .bottom-nav-item .ic { width: 22px; height: 22px; margin-bottom: 2px; }
    .bottom-nav-item span:not(.ic) { font-size: 10px; font-weight: 700; letter-spacing: 0.02em; }

    .menu-mais-fundo { display: block; position: fixed; inset: 0; z-index: 8998; background: rgba(17, 21, 42, 0.08); opacity: 0; pointer-events: none; transition: opacity 0.25s ease; }
    .menu-mais-fundo.show { opacity: 1; pointer-events: auto; }
    body.dark-mode .menu-mais-fundo, body.oled-mode .menu-mais-fundo { background: rgba(0, 0, 0, 0.2); }
    .floating-more-menu {
        display: block; position: fixed; left: 50%; bottom: calc(max(20px, env(safe-area-inset-bottom)) + 84px);
        width: calc(100% - 30px); max-width: 500px; max-height: calc(100dvh - 140px); overflow-y: auto;
        background: rgba(255, 255, 255, 0.75); border: 1px solid rgba(255, 255, 255, 0.4);
        backdrop-filter: blur(25px) saturate(200%); -webkit-backdrop-filter: blur(25px) saturate(200%);
        box-shadow: 0 15px 45px rgba(0, 0, 0, 0.1); border-radius: 28px; z-index: 8999; padding: 16px;
        transform: translateX(-50%) translateY(16px) scale(0.98); opacity: 0; pointer-events: none;
        transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s ease; transform-origin: bottom center;
    }
    .floating-more-menu.show { transform: translateX(-50%) translateY(0) scale(1); opacity: 1; pointer-events: auto; }
    body.dark-mode .floating-more-menu { background: rgba(13, 22, 41, 0.75); border-color: rgba(255, 255, 255, 0.05); box-shadow: 0 15px 45px rgba(0, 0, 0, 0.4); }
    body.oled-mode .floating-more-menu { background: rgba(5, 5, 5, 0.75); border-color: rgba(255, 255, 255, 0.1); }
    .menu-mais-grupo { font-size: 11px; font-weight: 700; color: var(--text-muted); margin: 2px 4px 8px; }
    .menu-mais-grelha { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 14px; }
    .menu-mais-item {
        display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px 8px; background: transparent; border: 0; border-radius: 16px;
        cursor: pointer; font-size: 12px; font-weight: 600; color: var(--text-main); text-align: center; line-height: 1.2; -webkit-tap-highlight-color: transparent; transition: background 0.2s ease;
    }
    .menu-mais-item:active, .menu-mais-item:hover { background: rgba(var(--accent-rgb), 0.06); }
    .menu-mais-icone {
        display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 14px;
        background: rgba(255, 255, 255, 0.55); border: 1px solid rgba(255, 255, 255, 0.7); color: var(--accent);
        box-shadow: 0 2px 8px rgba(17, 21, 42, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    }
    .menu-mais-icone .ic { width: 22px; height: 22px; }
    body.dark-mode .menu-mais-icone, body.oled-mode .menu-mais-icone { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.08); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05); }
    .menu-mais-item.ativo .menu-mais-icone { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
    .menu-mais-rodape { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; padding-top: 12px; border-top: 1px solid rgba(17, 21, 42, 0.08); }
    body.dark-mode .menu-mais-rodape, body.oled-mode .menu-mais-rodape { border-top-color: rgba(255, 255, 255, 0.08); }
    .menu-mais-acao {
        display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; min-height: 46px; padding: 11px 8px; border-radius: 14px; white-space: nowrap;
        background: rgba(255, 255, 255, 0.55); border: 1px solid rgba(255, 255, 255, 0.7); color: var(--text-main); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
        font-size: 14px; font-weight: 600; cursor: pointer; -webkit-tap-highlight-color: transparent;
    }
    body.dark-mode .menu-mais-acao, body.oled-mode .menu-mais-acao { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.08); box-shadow: none; }
    .menu-mais-acao .ic { width: 17px; height: 17px; }
    .menu-mais-acao span:not(.ic) { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
    .menu-mais-acao.perigo, body.dark-mode .menu-mais-acao.perigo, body.oled-mode .menu-mais-acao.perigo { color: var(--danger-color); background: rgba(255, 23, 68, 0.08); border-color: rgba(255, 23, 68, 0.2); }

    .metas-layout { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .content-area { padding-left: 15px; padding-right: 15px; }
    .form-container { padding: 24px 16px; }
    .nota-captura { padding: 16px; }
    input, select, textarea { font-size: 16px; }
    .app-header { flex-direction: column; align-items: stretch; gap: 15px; margin-bottom: 25px; position: relative; }
    .app-header .header-actions { width: 100%; }
    .app-header .header-actions .top-btn, .app-header .header-actions .btn-primary { flex: 1; }
    .app-header.cabecalho-compacto .title-container { padding-right: 56px; }
    .app-header.cabecalho-compacto .header-actions { position: absolute; right: 0; bottom: 15px; width: auto; }
    .app-header.cabecalho-compacto .header-actions .top-btn { flex: 0 0 auto; width: 44px; height: 44px; }
    .title-container h2 { font-size: 28px; }
    .form-row { gap: 18px; margin-bottom: 18px; flex-direction: column; }
    .form-group, .form-group.estreito { min-width: 0 !important; width: 100%; flex-basis: auto; }
    .filtros-bar { gap: 12px; }
    .filtros-bar .form-group { flex: 1 1 calc(50% - 6px); min-width: 0; }
    .filtros-bar .form-group.cresce { flex-basis: 100%; }
    .report-item { padding: 14px; gap: 12px; }
    .report-info h4 { font-size: 15.5px; }
    .report-actions.ocultar-mobile, .report-actions .ocultar-mobile { display: none; }
    .report-info p { gap: 6px 10px; }
    .report-info p .sep { display: none; }
    .escala { gap: 5px; }
    .escala label { padding: 10px 2px; }
    .escala label small { font-size: 10px; }
    .nota-captura-acoes .btn-primary { width: 100%; }
    .modal-overlay { padding: 12px; align-items: flex-end; }
    .modal-overlay.centrado { align-items: center; }
    .modal-content { max-height: 88dvh; }
    .modal-header { padding: 16px 18px; }
    .modal-body { padding: 20px 18px; }
    .modal-footer { flex-direction: column-reverse; padding: 16px 18px; }
    .modal-footer button { width: 100%; justify-content: center; }
    .def-secao { padding: 20px 16px; }
    .def-acoes button { width: 100%; }
    .def-linha { flex-direction: column; align-items: flex-start; gap: 12px; }
    .theme-mode-grid { gap: 8px; }
    .guia-corpo { padding: 22px 18px 18px; min-height: 0; }
    .guia-indicadores { display: none; }
    .guia-rodape { justify-content: flex-end; }
    .barra-h { grid-template-columns: 92px minmax(0, 1fr) 40px; gap: 8px; }
    .sobre-pagina h1 { font-size: 26px; }
}

/* =========================================================
   PAINEL DO PROFESSOR
   ========================================================= */
.segmentado { display: inline-flex; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.segmentado button {
    border: 0; background: transparent; color: var(--text-muted); font-size: 13.5px; font-weight: 600; padding: 0 14px; height: 32px;
    border-radius: 3px; cursor: pointer; transition: all 0.15s; white-space: nowrap; -webkit-tap-highlight-color: transparent;
}
.segmentado button:hover { color: var(--text-main); background: var(--input-bg); }
.segmentado button.ativo { background: var(--accent); color: var(--accent-text); }
.segmentado.grande { display: flex; padding: 4px; }
.segmentado.grande button { flex: 1; height: 41px; font-size: 15px; }

.disciplinas-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.disc-card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--radius-main); padding: 22px 24px; display: flex; flex-direction: column; gap: 16px; cursor: pointer; transition: all 0.2s; text-align: left; color: inherit; }
.disc-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 12px 25px rgba(var(--accent-rgb), 0.08); }
.disc-card-topo { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.disc-card-topo h3 { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; display: flex; align-items: center; gap: 10px; }
.disc-sigla { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 28px; padding: 0 8px; border-radius: 6px; background: var(--accent); color: var(--accent-text); font-size: 12px; font-weight: 800; letter-spacing: 0.04em; }
.disc-card-resumo { display: block; font-size: 14px; color: var(--text-muted); line-height: 1.5; }

.dificuldade-lista { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.dificuldade-lista li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 12px 14px; background: var(--input-bg); border: 1px solid var(--border-color); border-radius: var(--radius-sm); }
.dificuldade-lista strong { font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dificuldade-lista small { grid-column: 1; font-size: 12px; color: var(--text-muted); font-weight: 600; }
.dificuldade-lista .nivel { grid-row: 1 / 3; grid-column: 2; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-family: 'Schibsted Grotesk', sans-serif; font-weight: 700; font-size: 18px; }

.codigo-pill {
    display: inline-flex; align-items: center; gap: 5px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; font-weight: 700;
    letter-spacing: 0.04em; padding: 3px 8px; border-radius: 5px; background: var(--text-main); color: var(--card-bg); white-space: nowrap;
}

.alunos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.aluno-card {
    background: var(--card-bg); border: 1px solid var(--border-color); border-radius: calc(var(--radius-main) + 2px); padding: 20px; cursor: pointer;
    display: flex; flex-direction: column; gap: 14px; transition: all 0.25s ease; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02); text-align: left; color: inherit; width: 100%;
}
.aluno-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 15px 30px rgba(var(--accent-rgb), 0.1); }
.aluno-card-topo { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-bottom: 1px solid var(--border-color); padding-bottom: 14px; }
.aluno-codigo { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 20px; font-weight: 700; letter-spacing: 0.06em; }
.aluno-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.aluno-stats div { display: flex; flex-direction: column; gap: 1px; }
.aluno-stats b { font-family: 'Schibsted Grotesk', sans-serif; font-size: 19px; font-weight: 600; line-height: 1.15; }
.aluno-stats span { font-size: 10.5px; font-weight: 700; color: var(--text-muted); }
.aluno-rodape { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12.5px; color: var(--text-muted); font-weight: 600; }
.aluno-alerta { color: var(--danger-color); display: inline-flex; align-items: center; gap: 4px; }
.aluno-alerta .ic { width: 13px; height: 13px; }
.grupo-disciplina { margin-bottom: 32px; }

.voltar-link { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; color: var(--text-muted); font-size: 14px; font-weight: 600; cursor: pointer; padding: 4px 0; margin-bottom: 4px; }
.voltar-link .ic { width: 16px; height: 16px; }
.voltar-link:hover { color: var(--accent); }
.titulo-codigo { font-family: ui-monospace, SFMono-Regular, Menlo, monospace !important; letter-spacing: 0.04em !important; }
.def-nav .contador { font-size: 11.5px; font-weight: 700; opacity: 0.7; }

.lista-utilizadores { display: flex; flex-direction: column; gap: 10px; }
.utilizador-row { display: flex; align-items: center; gap: 14px; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--radius-sm); padding: 12px 16px; transition: border-color 0.2s; }
.utilizador-row:hover { border-color: var(--accent); }
.utilizador-row.suspenso { opacity: 0.65; }
.utilizador-icone { width: 36px; height: 36px; border-radius: 50%; background: var(--input-bg); border: 1px solid var(--border-color); display: flex; align-items: center; justify-content: center; color: var(--text-muted); flex-shrink: 0; }
.utilizador-icone .ic { width: 16px; height: 16px; }
.utilizador-email { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.utilizador-row select { width: auto; padding: 8px 36px 8px 12px; font-size: 13.5px; background-position: right 10px center; }
.utilizador-row .top-btn { height: 36px; font-size: 13px; }
.estado-pill { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 20px; border: 1px solid; cursor: pointer; background: transparent; white-space: nowrap; }
.estado-pill.ativo { color: var(--accent); border-color: var(--accent); background: rgba(var(--accent-rgb), 0.06); }
.estado-pill.suspenso { color: var(--warning-color); border-color: var(--warning-color); background: rgba(245, 158, 11, 0.08); }
.estado-pill.sem { color: var(--danger-color); border-color: var(--danger-color); cursor: default; }

@media (max-width: 900px) {
}
@media (max-width: 600px) {
    .painel-professor .app-header .header-actions { flex-wrap: wrap; }
    .segmentado { width: 100%; }
    .segmentado button { flex: 1; padding: 0 6px; }
    .utilizador-row { flex-wrap: wrap; gap: 10px; padding: 12px; }
    .utilizador-email { flex-basis: calc(100% - 50px); }
    .utilizador-row select { flex: 1; }
    .aluno-codigo { font-size: 18px; }
}
a.nav-item, a.menu-mais-item { text-decoration: none; }
@media (max-width: 600px) {
    .painel-professor .app-header .header-actions .segmentado { flex: 1; width: auto; }
    .painel-professor .app-header .header-actions .top-btn.icon-only { flex: 0 0 40px; width: 40px; }
}

/* =========================================================
   MENSAGENS — lógica de email (aluno e professor)
   ========================================================= */
.correio { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--radius-main); overflow: hidden; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02); }
.correio-barra { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border-color); flex-wrap: wrap; }
.correio-barra .def-nav { margin: 0; }
.correio-barra .filtros-inline { display: flex; gap: 8px; flex: 1; justify-content: flex-end; min-width: 220px; }
.correio-barra .filtros-inline input, .correio-barra .filtros-inline select { padding: 9px 14px; font-size: 14px; max-width: 260px; }
.correio-barra .filtros-inline select { padding-right: 36px; background-position: right 10px center; max-width: 170px; }
.correio-dia { padding: 10px 18px 6px; font-size: 11px; font-weight: 700; color: var(--text-muted); background: var(--input-bg); border-bottom: 1px solid var(--border-color); }
.correio-item {
    display: grid; grid-template-columns: 12px auto minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; padding: 14px 18px;
    border: 0; border-bottom: 1px solid var(--border-color); background: transparent; color: inherit; text-align: left; cursor: pointer; transition: background 0.15s;
}
.correio-item:last-child { border-bottom: 0; }
.correio-item:hover { background: var(--input-bg); }
.correio-ponto { width: 9px; height: 9px; border-radius: 50%; background: transparent; }
.correio-item.por-ler .correio-ponto { background: var(--accent); }
.correio-de { display: flex; align-items: center; gap: 8px; min-width: 120px; font-size: 14px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.correio-item.por-ler .correio-de { color: var(--text-main); font-weight: 700; }
.correio-corpo { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.correio-corpo strong { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.correio-item.por-ler .correio-corpo strong { font-weight: 800; }
.correio-corpo span { font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.correio-lado { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.estado-entrega { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 10px; border: 1px solid var(--border-color); color: var(--text-muted); display: inline-flex; align-items: center; gap: 4px; }
.estado-entrega .ic { width: 11px; height: 11px; }
.estado-entrega.pendente { color: var(--warning-color); border-color: var(--warning-color); background: rgba(245, 158, 11, 0.08); }
.correio-vazio { padding: 36px 20px; text-align: center; color: var(--text-muted); }
.correio-vazio > .ic { display: none; }
.correio-vazio p { font-size: 15px; margin-bottom: 4px; }
.correio-vazio span { font-size: 13.5px; display: block; max-width: 420px; margin: 0 auto; }
.correio-vazio .btn-primary { margin-top: 16px; }

/* Ler mensagem */
.mensagem-cabecalho { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; padding-bottom: 16px; margin-bottom: 18px; border-bottom: 1px solid var(--border-color); align-items: center; }
.mensagem-cabecalho dt { font-size: 11.5px; font-weight: 700; color: var(--text-muted); }
.mensagem-cabecalho dd { font-weight: 600; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mensagem-texto { font-size: 15.5px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.mensagem-original { margin-top: 20px; padding: 12px 16px; border-left: 3px solid var(--border-color); color: var(--text-muted); font-size: 13.5px; white-space: pre-wrap; word-break: break-word; }
.mensagem-original b { display: block; color: var(--text-main); font-size: 12px; margin-bottom: 4px; }

/* Escrever */
.escrever-campos .form-group { min-width: 0; margin-bottom: 16px; }
.escrever-campos textarea { min-height: 180px; }
.para-fixo { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 14px; border: 1px dashed var(--border-color); border-radius: var(--radius-sm); background: var(--bg-color); font-weight: 600; flex-wrap: wrap; }
.para-fixo .ic { width: 16px; height: 16px; color: var(--text-muted); }

.pill-novo { font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 10px; background: var(--accent); color: var(--accent-text); }
.nav-badge.alerta, .badge-bolinha { background: var(--danger-color); color: #FFFFFF; }
.bottom-nav-item .badge-bolinha {
    position: absolute; top: 4px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px;
    font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center; z-index: 3; border: 2px solid var(--card-bg);
}
.bottom-nav-item .badge-bolinha:empty { display: none; }
.def-nav .nav-badge { margin-left: 2px; }

/* Professor: escrever para vários */
.comunicacao-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 25px; align-items: start; }
.codigos-escolha { display: flex; flex-wrap: wrap; gap: 8px; max-height: 220px; overflow-y: auto; padding: 4px 2px; }
.codigos-escolha label { margin: 0; cursor: pointer; text-transform: none; letter-spacing: 0; }
.codigos-escolha input { display: none; }
.codigos-escolha .codigo-opcao { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 20px; border: 1px solid var(--border-color); background: var(--input-bg); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; font-weight: 700; color: var(--text-main); }
.codigos-escolha .codigo-opcao small { font-family: 'Schibsted Grotesk', sans-serif; font-size: 10px; color: var(--text-muted); }
.codigos-escolha input:checked + .codigo-opcao { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.codigos-escolha input:checked + .codigo-opcao small { color: inherit; }
.pre-visualizacao { background: var(--input-bg); border: 1px dashed var(--border-color); border-radius: var(--radius-main); padding: 18px; }
.pre-visualizacao .label { display: block; margin-bottom: 12px; }
.pre-visualizacao .correio { box-shadow: none; }
.contador-chars { font-size: 12px; color: var(--text-muted); text-align: right; margin-top: 6px; }

@media (max-width: 1050px) { .comunicacao-grid { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
    .correio-barra { padding: 10px; }
    .correio-barra .def-nav { width: 100%; }
    .correio-barra .filtros-inline { min-width: 0; width: 100%; }
    .correio-barra .filtros-inline input, .correio-barra .filtros-inline select { max-width: none; }
    .correio-item { grid-template-columns: 10px minmax(0, 1fr) auto; gap: 10px; padding: 12px 14px; }
    .correio-de { grid-column: 2; min-width: 0; font-size: 12.5px; }
    .correio-corpo { grid-column: 2; }
    .correio-lado { grid-column: 3; grid-row: 1 / 3; }
    .mensagem-cabecalho { grid-template-columns: 1fr; gap: 2px; }
    .mensagem-cabecalho dd { margin-bottom: 8px; }
}
.pre-visualizacao .correio-de { min-width: 0; }
@media (max-width: 600px) {
    .app-header .header-actions .top-btn.icon-only { flex: 0 0 44px; width: 44px; }
}


/* =========================================================
   INDICADOR DE LIGAÇÃO, PESQUISA GLOBAL, ESQUELETOS, SISTEMA (0.3.0)
   ========================================================= */
.indicador-ligacao {
    position: fixed; top: calc(12px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); z-index: 9500;
    display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 700;
    white-space: nowrap; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis;
    box-shadow: 0 6px 18px rgba(17, 21, 42, 0.15); background: var(--card-bg); border: 1px solid var(--border-color); color: var(--text-main);
}
.indicador-ligacao::before { content: ''; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: #F59E0B; }
.indicador-ligacao.a-sincronizar::before { background: var(--accent); }

.nav-pesquisa { margin-bottom: 4px; border: 1px solid var(--border-color); background: var(--input-bg); }
.nav-badge-tecla { margin-left: auto; font-family: inherit; font-size: 10.5px; font-weight: 700; color: var(--text-muted); border: 1px solid var(--border-color); border-radius: 5px; padding: 1px 6px; background: var(--card-bg); white-space: nowrap; }
#appShell.collapsed .nav-badge-tecla { display: none; }
#appShell.collapsed .nav-pesquisa { border-color: transparent; background: transparent; }
.menu-mais-pesquisa {
    display: none; align-items: center; gap: 10px; width: 100%; padding: 12px 14px; margin-bottom: 14px; border-radius: 14px;
    border: 1px solid var(--border-color); background: var(--input-bg); color: var(--text-muted); font-size: 15px; font-weight: 600; text-align: left; cursor: pointer;
}
.menu-mais-pesquisa .ic { width: 18px; height: 18px; }
@media (max-width: 900px) { .menu-mais-pesquisa { display: flex; } }

.pesquisa-overlay { align-items: flex-start; }
.modal-content.pesquisa-global { max-width: 640px; margin-top: 34vh; transition: margin-top 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); animation: none; }
.modal-content.pesquisa-global.com-resultados { margin-top: 10vh; }
.pesquisa-campo { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border-color); color: var(--text-muted); }
.pesquisa-campo .ic { width: 20px; height: 20px; }
.pesquisa-campo input { flex: 1; min-width: 0; border: none !important; background: transparent !important; box-shadow: none !important; font-size: 17px; padding: 4px 0 !important; color: var(--text-main); outline: none; }
.pesquisa-campo input::-webkit-search-cancel-button { display: none; }
.pesquisa-fechar { font-size: 12px; font-weight: 700; color: var(--text-muted); border: 1px solid var(--border-color); border-radius: 6px; padding: 2px 8px; background: var(--input-bg); cursor: pointer; }
.pesquisa-resultados { max-height: min(60vh, 520px); overflow-y: auto; padding: 8px; }
.pesquisa-dica { color: var(--text-muted); font-size: 14px; text-align: center; padding: 24px 12px; }
.pesquisa-grupo + .pesquisa-grupo { margin-top: 6px; }
.pesquisa-grupo-titulo { font-size: 11px; font-weight: 800; color: var(--text-muted); padding: 8px 10px 4px; }
.pesquisa-grupo-titulo span { font-weight: 600; text-transform: none; letter-spacing: 0; }
.pesquisa-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left; padding: 9px 10px; border: none; border-radius: 10px; background: transparent; color: var(--text-main); font-size: 14px; cursor: pointer; }
.pesquisa-item strong { font-weight: 600; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pesquisa-item span { font-size: 12px; color: var(--text-muted); }
.pesquisa-item:hover, .pesquisa-item:focus-visible { background: rgba(var(--accent-rgb), 0.08); outline: none; }
@media (max-width: 900px) { .modal-content.pesquisa-global { margin-top: 28vh; } .modal-content.pesquisa-global.com-resultados { margin-top: 12px; } }
@media (max-width: 600px) { .pesquisa-overlay { align-items: flex-start; } }
@media (prefers-reduced-motion: reduce) { .modal-content.pesquisa-global { transition: none; } }

.esqueleto-lista { display: grid; gap: 12px; width: 100%; padding: 4px 0; }
.correio .esqueleto-lista { padding: 14px; }
.esqueleto-cartaos { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.esqueleto { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--radius-main); padding: 16px; display: flex; gap: 12px; }
.esqueleto-cartao { flex-direction: column; min-height: 110px; }
.esqueleto-linha { align-items: center; }
.esq-coluna { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.esq-bloco { display: block; border-radius: 6px; background: var(--input-bg); }
.esq-icone { width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0; }
.esq-titulo { height: 15px; width: 55%; }
.esq-texto { height: 11px; width: 90%; }
.esq-texto.curto { width: 40%; }

/* Sistema (painel) */
.tabela-mensal { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tabela-mensal th, .tabela-mensal td { padding: 9px 8px; border-bottom: 1px solid var(--border-color); text-align: right; white-space: nowrap; }
.tabela-mensal th:first-child, .tabela-mensal td:first-child { text-align: left; }
.tabela-mensal th { font-size: 11px; color: var(--text-muted); }
.tabela-mensal tr:last-child td { border-bottom: 0; }
.tabela-rolar { overflow-x: auto; }
.erro-item { background: var(--card-bg); border: 1px solid var(--border-color); border-left: 4px solid var(--danger-color); border-radius: var(--radius-sm); padding: 14px 16px; }
.erro-item + .erro-item { margin-top: 10px; }
.erro-item.antigo { border-left-color: var(--border-color); }
.erro-item-topo { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.erro-item strong { font-size: 14.5px; word-break: break-word; }
.erro-item .erro-contagens { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.erro-item p { font-size: 12.5px; color: var(--text-muted); margin-top: 6px; word-break: break-word; }
.erro-item details { margin-top: 8px; font-size: 12px; }
.erro-item summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.erro-item pre { white-space: pre-wrap; word-break: break-word; font-size: 11.5px; background: var(--input-bg); border: 1px solid var(--border-color); border-radius: 4px; padding: 8px 10px; margin-top: 6px; max-height: 220px; overflow: auto; }

/* Movimento reduzido: sem animações de entrada */
@media (prefers-reduced-motion: reduce) {
    .landing-box, .app-view.ativa, .fade-in-anim, .modal-overlay.show, .modal-content, .def-secao.ativa, .guia-slide, .bolha, .faq-answer { animation: none !important; }
    *, *::before, *::after { transition: none !important; }
}

body.dark-mode .link-demo, body.oled-mode .link-demo { color: var(--success-color); }
body.dark-mode .landing-outro a, body.oled-mode .landing-outro a { color: var(--success-color); }
