@font-face { font-family: "Comfortaa"; src: url("/assets/fonts/Comfortaa-VariableFont_wght.ttf") format("truetype-variations"); font-weight: 300 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Ostrich Sans Heavy"; src: url("/assets/fonts/OstrichSans-Heavy.otf") format("opentype"); font-weight: 800; font-style: normal; font-display: swap; }

/* ---------- Ícones: Material Symbols (Google) ---------- */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  font-weight: normal; font-style: normal; display: inline-block; line-height: 1;
  text-transform: none; letter-spacing: normal; word-wrap: normal; white-space: nowrap; direction: ltr;
  -webkit-font-smoothing: antialiased;
}
.inline-icon-symbol { vertical-align: middle; }

:root {
  --purple: #691972; --purple-1: #9841A2; --purple-2: #B969C3; --purple-3: #D595DD; --purple-4: #F1C1F7;
  --pink: #A31B72; --pink-1: #C43F94; --pink-2: #DB5FAE; --pink-3: #EB85C6; --pink-4: #FFC9EB;
  --lemon: #CED424; --lemon-1: #E7ED44; --lemon-2: #F1F75F; --lemon-3: #FBFF90; --lemon-4: #FDFFC3;
  --green: #4F8E3A; --green-1: #70B15B; --green-2: #90CB7D; --green-3: #B7E2A8; --green-4: #E1F5DA;
  --green-vivid: #93BA1F;
  --ink: #241329; --slate-90: #2E1B34; --slate-70: #5A4560; --slate-50: #8A7990; --slate-30: #C7BDCB; --slate-10: #EFEAF1;
  --white: #FFFFFF; --paper: #FBF8FC;
  --accent-text: var(--purple);
  --sidebar-bg: #241329;

  --font-display: "Ostrich Sans Heavy", sans-serif;
  --font-body: "Comfortaa", cursive, sans-serif;
  --tracking-eyebrow: 0.14em;

  --radius-sm: 8px; --radius-md: 14px; --radius-lg: 24px; --radius-pill: 999px;
  --shadow-sm: 0 1px 3px rgba(36,19,41,0.08);
  --shadow-md: 0 8px 24px rgba(36,19,41,0.12);
  --shadow-lg: 0 20px 48px rgba(36,19,41,0.18);
  --shadow-brand: 0 12px 32px rgba(105,25,114,0.28);
  --ease-standard: cubic-bezier(0.4,0,0.2,1);
  --duration-base: 240ms;

  /* Legacy aliases so existing markup keeps working */
  --gx-navy: var(--purple);
  --gx-navy-light: var(--purple-1);
  --gx-orange: var(--pink);
  --gx-orange-dark: var(--pink-1);
  --gx-bg: var(--paper);
  --gx-card: var(--white);
  --gx-border: var(--slate-30);
  --gx-text: var(--slate-90);
  --gx-muted: var(--slate-50);
  --gx-green: var(--green);
  --gx-red: var(--pink);
  --radius: var(--radius-lg);
}

:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --white: #211427;
  --paper: #150D19;
  --ink: #F5F0F7;
  --slate-90: #E4DBE8;
  --slate-70: #C7BDCB;
  --slate-50: #9A8BA0;
  --slate-30: #4A3550;
  --slate-10: #2E1B34;
  --accent-text: var(--purple-3);
  --tooltip-text: var(--purple);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.35);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.45);
  --shadow-lg: 0 20px 48px rgba(0,0,0,0.55);
  --shadow-brand: 0 12px 32px rgba(213,149,221,0.25);
}

* { box-sizing: border-box; }

.theme-toggle {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--slate-30);
  background: var(--white); color: var(--ink); font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm); flex-shrink: 0;
  transition: background var(--duration-base) var(--ease-standard), transform 150ms var(--ease-standard);
}
.theme-toggle:hover { transform: scale(1.06); }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--accent-text); background: transparent;
  color: var(--accent-text); font-size: 15px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background var(--duration-base) var(--ease-standard);
}
.icon-btn:hover { background: var(--purple-4); }
.icon-btn .material-symbols-outlined { font-size: 19px; }

.inline-icon { vertical-align: -3px; flex-shrink: 0; }
.badge .inline-icon { vertical-align: -1px; }

.ny-camp-toggle-row { display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 600; color: var(--ink); }
.icon-btn-toggle {
  all: unset; cursor: pointer; color: var(--slate-30); flex-shrink: 0; display: flex; line-height: 0;
  transition: color var(--duration-base) var(--ease-standard);
}
.icon-btn-toggle.on { color: var(--green); }
.icon-btn-toggle:disabled { cursor: default; }

.students-filters { display: flex; gap: 10px; align-items: center; margin: 14px 0; flex-wrap: wrap; }
/* O padding-right precisa vir explícito: o atalho "padding" apagaria os 42px que a regra base do
   select reserva para o chevron, e aí a seta (desenhada por background-image) cai em cima do
   texto. Só aparecia em País/Status, cuja opção mais larga é menor que o próprio placeholder e
   por isso não sobra folga; Programa/Sponsor escondiam o bug por acidente. */
.students-filters select {
  width: auto; margin-bottom: 0; padding: 8px 32px 8px 12px; font-size: 13px;
  background-position: right 12px center;
}
.students-view-toggle { display: flex; gap: 4px; margin-left: auto; }
.icon-btn.small { width: 32px; height: 32px; }
.icon-btn.small .material-symbols-outlined { font-size: 16px; }
.icon-btn.small.active { background: var(--purple); color: #fff; border-color: var(--purple); }

.students-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
/* O nome ocupa de uma a três linhas ("Ana" vs "Rebeka Lopes dos Reis Pinheiro de Souza"), o que
   empurrava o selo de status para alturas diferentes em cada cartão. O corpo cresce para ocupar a
   sobra e o selo fica colado no rodapé, então todos os selos alinham na mesma linha. Os cartões
   têm a mesma altura porque o grid estica os itens (align-items: stretch é o padrão) e a
   min-height iguala também entre fileiras diferentes, não só dentro de uma. */
.student-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 12px;
  min-height: 232px;
  border: 1px solid var(--slate-10); border-radius: var(--radius-md); cursor: pointer; text-align: center;
  transition: box-shadow var(--duration-base) var(--ease-standard), border-color var(--duration-base) var(--ease-standard);
}
.student-card:hover { box-shadow: var(--shadow-sm); border-color: var(--purple-3); }
.student-card-avatar { position: relative; display: inline-flex; }
.student-card-body { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.student-card > .badge { margin-top: auto; }
.student-card-name { font-weight: 700; font-size: 14px; color: var(--ink); overflow-wrap: anywhere; }
.student-card-meta { font-size: 12px; color: var(--slate-50); }

.notif-wrap { position: relative; }
.notif-badge {
  position: absolute; top: -2px; right: -2px; background: var(--pink); color: #fff; font-size: 10px; font-weight: 800;
  min-width: 16px; height: 16px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  padding: 0 4px; line-height: 1;
}
.notif-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0; width: 320px; max-height: 400px; overflow-y: auto;
  background: var(--white); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); z-index: 50;
}
.notif-dropdown-header { padding: 14px 16px; font-weight: 700; font-size: 14px; border-bottom: 1px solid var(--slate-10); color: var(--ink); }
.notif-item { display: flex; gap: 10px; padding: 12px 16px; cursor: pointer; border-bottom: 1px solid var(--slate-10); align-items: flex-start; }
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--slate-10); }
.notif-item-icon { color: var(--accent-text); flex-shrink: 0; margin-top: 1px; }
.notif-item-body { display: flex; flex-direction: column; gap: 2px; }
.notif-item-student { font-weight: 700; font-size: 13px; color: var(--ink); }
.notif-item-message { font-size: 12px; color: var(--slate-50); }

.kb-search-wrap { position: relative; margin-bottom: 8px; }
.kb-search-icon { position: absolute; left: 14px; top: 13px; color: var(--slate-50); pointer-events: none; }
.kb-search-results {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: var(--white); border: 1px solid var(--slate-30);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg); z-index: 10; max-height: 260px; overflow-y: auto;
}
.kb-result-item { padding: 10px 16px; font-size: 14px; color: var(--ink); cursor: pointer; border-bottom: 1px solid var(--slate-10); }
.kb-result-item:last-child { border-bottom: none; }
.kb-result-item:hover { background: var(--slate-10); }

.ticket-thread { display: flex; flex-direction: column; gap: 12px; }
.ticket-message { max-width: 80%; padding: 10px 14px; border-radius: var(--radius-md); background: var(--slate-10); }
.ticket-message.agent { align-self: flex-end; background: var(--purple-4); }
.ticket-message-meta { font-size: 11px; color: var(--slate-50); margin-bottom: 3px; }
.ticket-message-body { font-size: 14px; color: var(--ink); white-space: pre-wrap; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--slate-90);
  transition: background-color 200ms ease, color 200ms ease;
}

#app { min-height: 100vh; }

/* ---------- App shell: sidebar + content ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 230px; flex-shrink: 0; background: var(--sidebar-bg); color: #fff;
  display: flex; flex-direction: column; padding: 28px 0;
  transition: width var(--duration-base) var(--ease-standard);
}
.sidebar.collapsed { width: 76px; }

.sidebar-top { display: flex; align-items: center; justify-content: space-between; margin: 0 24px 36px; }
.sidebar.collapsed .sidebar-top { flex-direction: column; margin: 0 0 36px; gap: 14px; }

.sidebar-logo-wrap { height: 32px; display: flex; align-items: center; }
.sidebar.collapsed .sidebar-logo-wrap { height: 36px; }
.sidebar-logo { height: 32px; width: auto; display: block; object-fit: contain; }
.sidebar-logo-mark { height: 36px; width: 36px; display: none; object-fit: contain; }
.sidebar.collapsed .sidebar-logo { display: none; }
.sidebar.collapsed .sidebar-logo-mark { display: block; }

.sidebar-collapse-toggle {
  all: unset; width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.15); transition: all var(--duration-base) var(--ease-standard);
}
.sidebar-collapse-toggle:hover { color: #fff; background: rgba(255,255,255,0.08); }
.sidebar-collapse-toggle .material-symbols-outlined { flex-shrink: 0; transition: transform var(--duration-base) var(--ease-standard); }
.sidebar.collapsed .sidebar-collapse-toggle .collapse-chevron { transform: rotate(180deg); }

.sidebar nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.sidebar nav button {
  all: unset; padding: 13px 24px; font-size: 14px; font-family: var(--font-body); cursor: pointer;
  color: rgba(255,255,255,0.6); border-left: 3px solid transparent; transition: all var(--duration-base) var(--ease-standard);
  display: flex; align-items: center; gap: 12px; white-space: nowrap; overflow: hidden;
}
.sidebar nav button .material-symbols-outlined { flex-shrink: 0; }
.sidebar nav button:hover { color: #fff; }
.sidebar nav button.active { color: #fff; font-weight: 700; border-left-color: var(--lemon); background: rgba(255,255,255,0.04); }
.sidebar.collapsed nav button { padding: 13px 0; justify-content: center; }

/* Seções do menu (Alunos e Pais / Agentes / Master Admins) */
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group + .nav-group { margin-top: 18px; }
.nav-group-title {
  padding: 0 24px 6px; font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(255,255,255,0.38);
}
/* Recolhido não há espaço para o texto: vira só um traço separando as seções. */
.sidebar.collapsed .nav-group-title { padding: 0; height: 1px; overflow: hidden; text-indent: -999px; background: rgba(255,255,255,0.12); margin: 0 18px 8px; }

.sidebar.collapsed .nav-label { display: none; }

.main-area { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.main-area .container { flex: 1; }
.content-header {
  display: flex; justify-content: space-between; align-items: center; padding: 32px 40px 0;
}
.content-header .eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--pink);
}
.content-header h1 { margin: 4px 0 0; font-size: 20px; color: var(--ink); font-family: var(--font-body); font-weight: 700; }
.content-header .header-right { display: flex; align-items: center; gap: 10px; }

.container { padding: 24px 40px 40px; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: flex; }
.login-brand-panel {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff; position: relative; overflow: hidden; padding: 40px; text-align: left;
  background: linear-gradient(180deg, rgba(105,25,114,0.75), rgba(21,13,25,0.8)), url("/assets/images/login-student.jpg");
  background-size: cover; background-position: center;
}
.login-brand-panel img.swirl { position: absolute; left: -120px; bottom: -120px; width: 420px; }
.login-brand-content { display: flex; flex-direction: column; align-items: flex-start; position: relative; }
.login-brand-panel img.logo { height: 88px; margin-bottom: 32px; position: relative; }
.login-brand-panel .tagline { font-family: var(--font-display); font-size: 44px; max-width: 420px; position: relative; line-height: 1.1; letter-spacing: 0.01em; }
.login-form-panel { flex: 1; display: flex; align-items: center; justify-content: center; background: var(--paper); }
.login-card { width: 340px; background: var(--white); border-radius: var(--radius-lg); padding: 36px 40px; box-shadow: var(--shadow-lg); position: relative; z-index: 1; }
.login-card-wide { width: 620px; max-width: 90vw; max-height: 88vh; overflow-y: auto; }
.login-card-wide button.btn { width: auto; }
.login-card .eyebrow { font-size: 12px; font-weight: 700; letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--pink); margin-bottom: 6px; }
.login-card h1 { margin: 0 0 6px; font-size: 26px; color: var(--ink); font-weight: 700; }
.login-card p.subtitle { margin: 0 0 22px; color: var(--slate-50); font-size: 14px; }
.login-card button.btn { width: 100%; margin-top: 6px; }
.login-card .btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 48px;
  background: var(--white); color: var(--ink); border: 2px solid var(--slate-30); border-radius: var(--radius-pill);
  font-size: 14px; font-weight: 700; cursor: pointer; font-family: var(--font-body); text-decoration: none; box-sizing: border-box;
  transition: border-color var(--duration-base) var(--ease-standard), background var(--duration-base) var(--ease-standard);
}
.login-card .btn-google:hover { border-color: var(--purple); background: var(--paper); }
.login-card .login-divider { display: flex; align-items: center; gap: 10px; margin: 18px 0; color: var(--slate-50); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.login-card .login-divider::before, .login-card .login-divider::after { content: ''; flex: 1; height: 1px; background: var(--slate-30); }

label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; color: var(--ink); }
/* Campo obrigatório: marcado com [data-required] em vez de required (o required nativo bloqueia o
   envio do form silenciosamente, sem mensagem visível — cada form valida e avisa via JS agora). */
label:has(+ [data-required])::after,
label:has(+ div [data-required])::after { content: ' *'; color: var(--pink); }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], input[type=month], input[type=url], input[type=number], select, textarea {
  width: 100%; height: 48px; box-sizing: border-box; padding: 12px 16px; border: 2px solid var(--slate-30); border-radius: var(--radius-md); font-size: 15px;
  margin-bottom: 14px; background: var(--white); font-family: var(--font-body); color: var(--slate-90); outline: none;
  transition: border-color var(--duration-base) var(--ease-standard), box-shadow var(--duration-base) var(--ease-standard);
}
textarea { height: auto; }
select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  padding-right: 42px; cursor: pointer;
  background-repeat: no-repeat; background-position: right 16px center; background-size: 12px 8px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%235A4560' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23C7BDCB' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
input:focus, select:focus, textarea:focus { border-color: var(--purple); box-shadow: 0 0 0 4px rgba(219,95,174,0.25); }
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--slate-50); opacity: 1; }
#kb-search-input { padding-left: 42px; margin-bottom: 0; }

.password-field { position: relative; }
.password-field input[type=password], .password-field input[type=text] { padding-right: 44px; }
.password-toggle {
  position: absolute; right: 10px; top: 0; bottom: 14px; display: flex; align-items: center;
  background: none; border: none; cursor: pointer; font-size: 16px; padding: 0 6px; color: var(--slate-50); line-height: 1;
}
.password-toggle:hover { color: var(--accent-text); }

/* Campo com um atalho dentro dele (ex.: abrir o site digitado numa nova aba). */
.input-with-action { position: relative; }
.input-with-action input { padding-right: 46px; }
/* Campo com DOIS atalhos (ex.: reenviar convite + ver como) — só os campos que de fato têm os
   dois ganham o padding maior, os demais usos de .input-with-action (ex.: site da escola) ficam
   como sempre foram. */
.input-with-action.two-actions input { padding-right: 78px; }
/* Campo com até TRÊS atalhos (reenviar convite + ver exemplo do e-mail + ver como). */
.input-with-action.three-actions input { padding-right: 108px; }
/* Campo com até QUATRO atalhos (reenviar convite + ver exemplo do e-mail + redefinir senha + ver como). */
.input-with-action.four-actions input { padding-right: 138px; }
.input-action {
  position: absolute; right: 10px; top: 0; bottom: 14px; display: flex; align-items: center; padding: 0 6px;
  color: var(--slate-50); text-decoration: none; line-height: 1;
  background: none; border: none; font: inherit; cursor: pointer;
}
.input-action:hover { color: var(--accent-text); }
.input-action[hidden] { display: none; }
/* Dois atalhos no mesmo campo: agrupa lado a lado em vez de empilhar os dois no mesmo right:10px. */
.input-actions { position: absolute; right: 6px; top: 0; bottom: 14px; display: flex; align-items: center; gap: 2px; }
.input-actions .input-action { position: static; }

button.btn, a.btn {
  background: var(--purple); color: #fff; border: none; padding: 14px 26px; border-radius: var(--radius-pill);
  font-size: 14px; font-weight: 700; cursor: pointer; font-family: var(--font-body);
  transition: background var(--duration-base) var(--ease-standard), transform 150ms var(--ease-standard);
}
a.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; }
button.btn:hover, a.btn:hover { background: var(--purple-1); }
button.btn:active, a.btn:active { background: var(--state-active-purple, #54105c); transform: scale(0.98); }
button.btn.secondary, a.btn.secondary { background: var(--pink); }
button.btn.secondary:hover, a.btn.secondary:hover { background: var(--pink-1); }
button.btn.outline, a.btn.outline { background: transparent; color: var(--accent-text); border: 2px solid var(--accent-text); padding: 12px 24px; }
button.btn.outline:hover, a.btn.outline:hover { background: var(--purple-4); }
button.btn.danger, a.btn.danger { background: var(--pink-1); }
button.btn.danger:hover, a.btn.danger:hover { background: var(--pink); }
button.btn:disabled { opacity: 0.5; cursor: not-allowed; }
/* Botão travado por requisição no ar (travarClique). Diferente do disabled comum, que significa
   "você não pode": aqui é "já estou fazendo", e o cursor de espera é o que diz isso. */
.is-busy { cursor: progress !important; opacity: 0.6; }
button.btn.small, a.btn.small { padding: 8px 18px; font-size: 13px; }
/* Botão de ícone é sempre um círculo do mesmo tamanho: flex: none impede que um container em
   flex/grid (linha de arquivo, barra de ações) o estique em faixa. */
button.btn.icon-only, a.btn.icon-only {
  width: 36px; height: 36px; min-width: 36px; padding: 0; flex: none;
  display: inline-flex; align-items: center; justify-content: center; border-radius: 50%;
}

/* Barra de "ver como" (master_admin impersonando pai/aluno) — fica presa no topo da tela toda,
   acima até da sidebar, pra nunca passar despercebido que a sessão não é a do admin de verdade. */
.impersonation-banner {
  position: sticky; top: 0; z-index: 500; display: flex; align-items: center; justify-content: center;
  gap: 16px; flex-wrap: wrap; background: var(--lemon-2); color: var(--ink); padding: 10px 20px;
  font-size: 13px; font-weight: 700; text-align: center;
}
.impersonation-banner .inline-icon { vertical-align: -3px; margin-right: 4px; }
.impersonation-banner .btn.small { background: var(--ink); color: var(--paper); padding: 6px 16px; }
.impersonation-banner .btn.small:hover { background: var(--slate-90); }

.error-msg { background: var(--pink-4); color: var(--pink); padding: 12px 16px; border-radius: var(--radius-md); font-size: 13px; margin-bottom: 14px; font-weight: 600; }
.success-msg { background: var(--green-4); color: var(--green); padding: 12px 16px; border-radius: var(--radius-md); font-size: 13px; margin-bottom: 14px; font-weight: 600; }

#toast-container { position: fixed; right: 24px; bottom: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast {
  background: var(--ink); color: var(--paper); padding: 10px 18px; border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 700; box-shadow: var(--shadow-md); opacity: 0; transform: translateY(8px);
  transition: opacity 200ms var(--ease-standard), transform 200ms var(--ease-standard);
}
.toast-visible { opacity: 1; transform: translateY(0); }
.toast-error { background: var(--pink); color: var(--white); }

.card { background: var(--white); border: none; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 24px; margin-bottom: 20px; }
.card h2 { margin-top: 0; font-size: 18px; color: var(--ink); font-weight: 700; }
.card h3 { font-size: 15px; color: var(--ink); margin: 0 0 10px; font-weight: 700; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Celular internacional: bandeira + código do país (largura fixa) + número (resto da linha). */
.phone-intl { display: flex; gap: 8px; align-items: start; }
.phone-intl input { flex: 1 1 auto; min-width: 0; }
.flag-select { position: relative; flex: 0 0 112px; }
.flag-select-btn {
  width: 100%; height: 48px; box-sizing: border-box; margin-bottom: 14px; display: flex; align-items: center; gap: 8px;
  padding: 0 12px; border: 2px solid var(--slate-30); border-radius: var(--radius-md); background: var(--white);
  color: var(--slate-90); font-family: var(--font-body); font-size: 15px; cursor: pointer;
  transition: border-color var(--duration-base) var(--ease-standard), box-shadow var(--duration-base) var(--ease-standard);
}
.flag-select-btn:focus-visible { outline: none; border-color: var(--purple); box-shadow: 0 0 0 4px rgba(219,95,174,0.25); }
.flag-select-btn:disabled { cursor: default; opacity: 0.7; }
.flag-caret {
  margin-left: auto; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-top: 6px solid var(--slate-50);
}
/* A bandeira vem do emoji, que é retangular: ampliada e recortada pelo círculo. */
.flag-circle {
  flex: none; width: 24px; height: 24px; border-radius: 50%; overflow: hidden; background: var(--slate-10);
  display: flex; align-items: center; justify-content: center; font-size: 22px; line-height: 1;
}
.flag-dial { font-variant-numeric: tabular-nums; }
.flag-select-list {
  position: absolute; top: calc(100% - 6px); left: 0; z-index: 30; min-width: 230px; max-height: 280px; overflow-y: auto;
  background: var(--white); border: 1px solid var(--slate-30); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); padding: 4px;
}
.flag-option {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: none; background: none;
  border-radius: var(--radius-md); font-family: var(--font-body); font-size: 14px; color: var(--ink); cursor: pointer; text-align: left;
}
.flag-option:hover, .flag-option:focus-visible { background: var(--slate-10); outline: none; }
.flag-option.selected { background: var(--purple-4); font-weight: 700; }
.flag-option .flag-name { color: var(--slate-50); }
.flag-option.selected .flag-name { color: inherit; }

/* Reports Mensais: um card por mês do programa, com o velocímetro de humor do mês enviado. */
.report-month-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.report-month-head h3 { margin: 0; }
.report-month-actions { display: flex; align-items: center; gap: 8px; }
.report-month.locked { opacity: 0.55; }
.report-month.locked .report-month-head h3 { color: var(--slate-50); }
.report-month-body { display: grid; grid-template-columns: 270px 1fr; gap: 24px; align-items: start; }
.mood-gauge { width: 100%; max-width: 300px; height: auto; display: block; }
.mood-faces { display: flex; justify-content: center; gap: 8px; margin-top: 6px; }
.mood-face {
  background: none; border: 2px solid transparent; border-radius: 50%; padding: 2px; cursor: pointer; line-height: 0;
  opacity: 0.45; transition: opacity var(--duration-base) var(--ease-standard), border-color var(--duration-base) var(--ease-standard);
}
.mood-face:hover:not(:disabled) { opacity: 0.85; }
.mood-face.selected { opacity: 1; border-color: var(--ink); }
.mood-face:disabled { cursor: default; }
.report-summary p { margin: 0 0 12px; font-size: 15px; color: var(--ink); line-height: 1.55; }
.report-highlight { display: flex; gap: 10px; font-size: 14px; color: var(--slate-70); padding: 8px 0; border-top: 1px solid var(--slate-10); }
.report-highlight-label { flex: 0 0 130px; font-weight: 700; color: var(--ink); }
.report-highlight.atencao { color: var(--pink-1); }
.report-highlight.atencao .report-highlight-label { color: var(--pink-1); }
@media (max-width: 780px) {
  .report-month-body { grid-template-columns: 1fr; }
}

/* Agrupa uma seção do formulário de Placement (Família, Escola, Coordenadores) num bloco visual
   separado, mesma linguagem do .doc-block — sem isso as seções se misturam num scroll só. */
.form-block { border: 1px solid var(--slate-30); border-radius: var(--radius-lg); padding: 18px; margin-bottom: 18px; background: var(--white); }
.form-block h3 { margin-top: 0; }

/* Campo ligado/desligado por uma marcação (ex.: double placement). */
.check-field { margin-bottom: 14px; }
.check-label { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; color: var(--ink); margin-bottom: 10px; cursor: pointer; }
.check-label input { width: auto; margin: 0; cursor: pointer; }
.check-field input[type=text]:disabled { opacity: 0.5; cursor: not-allowed; }

/* Aviso de gravação não confirmada / não salva, fixo no topo do formulário. Fica até o servidor
   confirmar — é o contrário do toast, que some e deixa a tela mentindo sozinha. */
.save-state {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 16px; border-radius: var(--radius-md); font-size: 13px; font-weight: 600; margin-bottom: 16px;
}
.save-state.nao-salvo { background: var(--pink-4); color: var(--pink); }
.save-state.nao-confirmado { background: var(--lemon-4); color: #6b6f0f; }
.save-state span { flex: 1 1 220px; }
.save-state .btn { flex: none; }
.save-pending input:not(:disabled), .save-pending textarea:not(:disabled), .save-pending select:not(:disabled) {
  border-color: var(--pink);
}

/* Telefones de emergência (aba Seguro): rótulo + telefone + botão de remover na mesma linha. */
.emergency-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 16px; align-items: start; }
.emergency-row .row-remove { margin-top: 25px; }
.emergency-list-readonly { display: flex; flex-direction: column; gap: 12px; }
.emergency-item { display: flex; gap: 10px; align-items: center; }
.emergency-item-label { display: block; font-size: 12px; color: var(--slate-50); }
.emergency-item-phone { font-size: 16px; font-weight: 700; color: var(--accent-text); text-decoration: none; }
.emergency-item-phone:hover { text-decoration: underline; }

/* Mapa do placement (casa e um destino por vez marcados via Google Maps). */
.map-embed { position: relative; width: 100%; height: 380px; border-radius: var(--radius-md); overflow: hidden; border: 2px solid var(--slate-30); }
.map-embed iframe { width: 100%; height: 100%; border: 0; display: block; }
.map-empty { display: flex; align-items: center; justify-content: center; height: 160px; color: var(--slate-50); font-size: 14px; text-align: center; padding: 0 20px; background: var(--slate-10); border-radius: var(--radius-md); }
.map-links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; font-size: 13px; }
/* Alterna o destino da rota (escola / local coordinator / regional coordinator) — o embed sem
   chave de API só desenha rota entre dois pontos, então "ver a distância até X" troca o destino
   em vez de acrescentar um terceiro marcador. */
.map-toggle { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.map-toggle-btn {
  background: transparent; color: var(--accent-text); border: 2px solid var(--accent-text);
  border-radius: var(--radius-pill); padding: 6px 16px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.map-toggle-btn:hover { background: var(--purple-4); }
.map-toggle-btn.active { background: var(--purple); color: #fff; border-color: var(--purple); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
table th, table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--slate-10); }
table th { color: var(--slate-50); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
table tr:hover td { background: var(--slate-10); }
table tr.clickable { cursor: pointer; }

/* ---------- Produtividade (Contas) ---------- */
.prod-filters { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 12px; }
.prod-filters > div { display: flex; flex-direction: column; gap: 4px; }
.prod-filters label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--slate-50); }
.prod-filters select, .prod-filters input[type="date"] { width: auto; margin-bottom: 0; }
.prod-chart { display: flex; flex-direction: column; gap: 10px; margin: 18px 0 24px; }
.prod-empty { color: var(--slate-50); font-size: 13px; }
.prod-row { display: grid; grid-template-columns: 160px 1fr 44px; gap: 12px; align-items: center; }
.prod-row-label { font-size: 13px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prod-row-track { height: 22px; background: var(--slate-10); border-radius: var(--radius-sm); overflow: hidden; }
.prod-row-bar {
  height: 100%; background: var(--purple); border-radius: var(--radius-sm);
  transition: width var(--duration-base) var(--ease-standard), filter var(--duration-base) var(--ease-standard);
}
.prod-row-bar:hover, .prod-row-bar:focus-visible { filter: brightness(1.12); outline: none; }
.prod-row-value { font-size: 13px; font-weight: 700; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.prod-tooltip {
  position: fixed; z-index: 1000; background: var(--ink); color: var(--paper); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 12px; line-height: 1.5; box-shadow: var(--shadow-md); pointer-events: none;
  max-width: 260px;
}
.prod-tooltip strong { display: block; margin-bottom: 4px; font-size: 13px; }
.prod-tooltip ul { margin: 6px 0 0; padding-left: 16px; }
.prod-tooltip li { margin-bottom: 2px; }

.badge { display: inline-block; padding: 5px 13px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.badge.ativo { background: var(--green-4); color: var(--green); }
.badge.pending { background: var(--lemon-4); color: #6b6f0f; }
.status-dot {
  display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px;
  border-radius: 50%; font-size: 12px; font-weight: 800; flex-shrink: 0; line-height: 1;
}
.status-dot.pending { background: var(--lemon-4); color: #6b6f0f; }

.visa-check-row { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; color: var(--ink); margin-bottom: 14px; }
.visa-check-row input { width: auto; margin: 0; }

.message-program-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.message-program-check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); font-weight: 600; }
.message-program-check input { width: auto; margin: 0; }
.visa-stage-desc { font-size: 13px; color: var(--slate-50); margin: -6px 0 14px; }
.visa-stage-meta { font-size: 12px; color: var(--slate-50); margin: 2px 0 0; }
.visa-actions-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.doc-block-label { font-weight: 700; font-size: 13px; color: var(--ink); margin-bottom: 8px; }

/* Situação do visto em linguagem simples — é o que pai e aluno leem no topo da aba, e o que
   responde "onde eu acompanho isso". Fica destacado do resto do card de propósito. */
.visa-status-panel { background: var(--paper); border: 1px solid var(--slate-30); border-radius: var(--radius-md); padding: 14px 16px; margin-top: 12px; }
.visa-status-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.visa-status-counter { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--slate-70); }
.visa-status-text { font-size: 14px; line-height: 1.5; color: var(--ink); margin: 10px 0 0; }
.visa-status-next { font-size: 13px; line-height: 1.5; color: var(--slate-70); margin: 8px 0 0; }
.visa-status-pendencias { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.visa-status-pendencias li { background: var(--lemon-4); color: #6b6f0f; border-radius: var(--radius-sm); padding: 8px 10px; font-size: 13px; line-height: 1.4; }
.visa-pos-title { font-size: 14px; color: var(--ink); margin: 18px 0 6px; }
.visa-event-row { align-items: flex-start; }
.visa-event-note { color: var(--slate-50); }
.visa-event-meta { font-size: 12px; color: var(--slate-50); flex-shrink: 0; text-align: right; }
.warn-box { background: var(--lemon-4); color: #6b6f0f; padding: 14px 16px; border-radius: var(--radius-md); font-size: 13px; line-height: 1.5; }
.ds160-group { border: 1px solid var(--slate-30); border-radius: var(--radius-md); padding: 10px 14px; margin-bottom: 12px; }
.ds160-group summary { cursor: pointer; font-weight: 700; font-size: 13px; color: var(--ink); padding: 4px 0; }
.ds160-group .grid-2 { margin-top: 10px; }
.field-hint { font-weight: 400; font-size: 11px; color: var(--slate-50); text-transform: none; letter-spacing: normal; }
input.input-suggested, textarea.input-suggested { border-style: dashed; background: var(--lemon-4); }
.badge.error { background: var(--pink-4); color: var(--pink); }

.drive-path { font-size: 12px; color: var(--slate-50); margin: 10px 0 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.drive-path .drive-link { color: var(--accent-text); font-weight: 700; text-decoration: none; }
.drive-path .drive-link:hover { text-decoration: underline; }

.doc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.doc-block { border: 1px solid var(--slate-30); border-radius: var(--radius-lg); padding: 18px; background: var(--white); display: flex; flex-direction: column; }
.doc-block .cat-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 8px; }
.doc-block .cat-header strong { color: var(--ink); font-size: 14px; font-weight: 700; }
.doc-block .dropzone { margin-top: auto; }

/* Modelo em branco dentro do bloco da categoria: o arquivo que a família baixa, preenche e
   devolve assinado na mesma categoria. Fica acima dos arquivos já enviados e da dropzone. */
.doc-template-box { border: 1px solid var(--slate-30); border-radius: var(--radius-md); background: var(--slate-10); padding: 10px 12px; margin-bottom: 10px; }
.doc-template-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.doc-template-filename { display: block; margin-top: 6px; font-size: 11px; color: var(--slate-50); word-break: break-word; }
.doc-template-instructions { margin: 6px 0 0; font-size: 12px; color: var(--ink); line-height: 1.45; }
.doc-template-actions { display: flex; justify-content: flex-end; margin-bottom: 8px; }
/* Modelo arquivado (histórico) na tela de Modelos: continua legível, mas não compete com o em uso. */
table tr.row-inactive td { opacity: 0.6; }

.dropzone {
  border: 2px dashed var(--slate-30); border-radius: var(--radius-md); padding: 16px; text-align: center; font-size: 13px; color: var(--slate-50); cursor: pointer;
  transition: all var(--duration-base) var(--ease-standard); font-family: var(--font-body);
}
.dropzone.dragover { border-color: var(--pink); background: var(--pink-4); color: var(--pink); }

.file-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; font-size: 13px; border-bottom: 1px dashed var(--slate-30); gap: 10px; }
.file-row:last-child { border-bottom: none; }
.file-row .file-actions { display: flex; flex-wrap: wrap; gap: 6px; flex-shrink: 0; }
.file-row .file-actions button { margin-left: 0; }

/* A linha de arquivo empilhava o nome em cima e esticava os três botões numa faixa cheia — fazia
   sentido quando eles diziam "Visualizar / Baixar / Excluir". Com ícone, o botão é um círculo e a
   linha volta a ser uma linha: nome à esquerda, ações à direita. min-width/overflow-wrap são o que
   deixam um nome de arquivo comprido quebrar em vez de empurrar os botões para fora. */
.file-name { overflow-wrap: anywhere; }

.file-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.doc-thumb { width: 56px; height: 56px; border-radius: var(--radius-sm); object-fit: cover; flex-shrink: 0; cursor: pointer; background: var(--slate-10); }
.doc-thumb-file { display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--purple); background: var(--purple-4); }
.file-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.file-info .file-name { font-weight: 700; color: var(--ink); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-info .file-meta { color: var(--slate-50); font-size: 11px; }

/* ---------- Documentos: revisão por linha ---------- */
.doc-review-list { display: flex; flex-direction: column; gap: 14px; }
.doc-review-row { border: 1px solid var(--slate-30); border-radius: var(--radius-lg); padding: 16px 18px; background: var(--white); }
.doc-review-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.doc-review-title { display: flex; align-items: center; gap: 8px; position: relative; }
.doc-review-title strong { color: var(--ink); font-size: 14px; font-weight: 700; }
.doc-review-badges { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.doc-review-row .file-row { padding: 10px 0; }
.doc-review-row .dropzone { margin-top: 10px; }
.doc-review-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

.help-dot {
  all: unset; cursor: pointer; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--slate-30);
  color: var(--slate-50); font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all var(--duration-base) var(--ease-standard);
}
.help-dot:hover { background: var(--slate-10); color: var(--ink); border-color: var(--slate-50); }
.help-popover {
  position: absolute; top: calc(100% + 10px); left: 0; background: var(--ink); color: #fff; font-size: 12px; line-height: 1.5;
  padding: 10px 12px; border-radius: 8px; width: 280px; box-shadow: var(--shadow-md); z-index: 30;
}
.help-popover::before { content: ''; position: absolute; top: -5px; left: 60px; width: 10px; height: 10px; background: var(--ink); transform: rotate(45deg); }

.agenda-cal-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.agenda-cal-nav-btn {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--slate-30); background: var(--white);
  color: var(--ink); cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: background var(--duration-base) var(--ease-standard);
}
.agenda-cal-nav-btn:hover { background: var(--slate-10); }
.agenda-cal-title { font-weight: 700; font-size: 16px; color: var(--ink); flex: 1; text-align: center; text-transform: capitalize; }
.agenda-cal-today-btn { flex-shrink: 0; }
.agenda-sync-box { background: var(--paper); border: 1px solid var(--slate-10); border-radius: var(--radius-md); padding: 14px 16px; margin-bottom: 18px; }
.agenda-sync-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.agenda-sync-url { display: block; font-size: 12px; color: var(--slate-50); background: var(--slate-10); padding: 8px 10px; border-radius: 8px; overflow-x: auto; white-space: nowrap; }
.agenda-cal-legend { display: flex; gap: 16px; font-size: 12px; color: var(--slate-50); margin-bottom: 14px; }
.agenda-cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.agenda-legend-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.agenda-legend-dot.passado { background: var(--slate-30); }
.agenda-legend-dot.hoje { background: var(--pink-1); }
.agenda-legend-dot.futuro { background: var(--purple-2); }
.agenda-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.agenda-cal-weekday { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--slate-50); text-align: center; padding-bottom: 4px; letter-spacing: 0.03em; }
.agenda-cal-day {
  min-height: 82px; border-radius: 10px; border: 1px solid var(--slate-10); padding: 6px;
  display: flex; flex-direction: column; gap: 3px; position: relative;
}
.agenda-cal-day.empty { border-color: transparent; }
.agenda-cal-day.today { border-color: var(--purple); box-shadow: 0 0 0 1px var(--purple) inset; }
.agenda-cal-day-num { font-size: 12px; font-weight: 700; color: var(--slate-50); }
.agenda-cal-day.today .agenda-cal-day-num { color: var(--purple); }
.agenda-event-chip {
  font-size: 10.5px; font-weight: 600; padding: 3px 6px; border-radius: 6px; cursor: pointer;
  /* Quebra em vez de cortar: o dia cresce e o agendamento continua legível. */
  white-space: normal; overflow-wrap: anywhere; line-height: 1.25; position: relative;
  display: block; text-align: left; text-decoration: none;
}
.agenda-event-chip-label { display: block; }
.agenda-event-chip-who { display: block; font-weight: 500; opacity: 0.78; margin-top: 1px; }
.agenda-event-chip.link:hover { box-shadow: 0 0 0 1px currentColor inset; }
.agenda-event-chip.link:hover .agenda-event-chip-label { text-decoration: underline; }
.agenda-event-chip.futuro { background: var(--purple-4); color: var(--purple); }
.agenda-event-chip.hoje { background: var(--pink-1); color: #fff; }
.agenda-event-chip.passado { background: var(--slate-10); color: var(--slate-50); }
.agenda-event-popover {
  position: absolute; top: calc(100% + 6px); left: 0; background: var(--ink); color: #fff; font-size: 12px;
  border-radius: 10px; box-shadow: var(--shadow-md); z-index: 40; padding: 6px; display: flex; flex-direction: column;
  min-width: 210px; white-space: normal; cursor: default;
}
.agenda-event-popover a, .agenda-event-popover button {
  all: unset; padding: 8px 10px; border-radius: 6px; cursor: pointer; color: #fff; font-size: 12px;
  display: flex; align-items: center; gap: 6px;
}
.agenda-event-popover a:hover, .agenda-event-popover button:hover { background: rgba(255,255,255,0.15); }
.agenda-event-popover-location { padding: 8px 10px; display: flex; align-items: center; gap: 6px; opacity: 0.85; }
.agenda-event-popover-scope { padding: 4px 10px 8px; font-size: 11px; opacity: 0.7; border-bottom: 1px solid rgba(255,255,255,0.15); margin-bottom: 4px; }
.agenda-event-popover button.danger { color: var(--pink-3); }

.status-dot.approved { background: var(--green-vivid); color: #fff; }
.status-dot.rejected { background: var(--pink-2); color: #fff; }

.comment-icon-btn {
  all: unset; cursor: pointer; width: 22px; height: 22px; border-radius: 50%; background: var(--pink-4); color: var(--pink);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background var(--duration-base) var(--ease-standard);
}
.comment-icon-btn:hover { background: var(--pink-3); }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,8,20,0.72); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 20px;
}
.modal-box { background: var(--white); border-radius: var(--radius-lg); padding: 24px; max-width: 420px; width: 100%; box-shadow: var(--shadow-md); }
/* Modais que precisam de mais espaço (ex.: prévia de e-mail, com o próprio layout do e-mail
   pedindo até 520px de largura). */
.modal-box-wide { max-width: 580px; }
.modal-box h3 { margin: 0 0 10px; font-size: 17px; color: var(--ink); }
.modal-message { font-size: 13px; color: var(--slate-50); margin: 0 0 12px; }
.modal-box textarea { width: 100%; min-height: 100px; resize: vertical; font-family: var(--font-body); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.email-preview-frame { width: 100%; height: 420px; border: 1px solid var(--slate-10); border-radius: var(--radius-md); background: #fff; }

/* Aviso na tela, no lugar do alert() do navegador. Fica acima dos outros modais de propósito:
   quase sempre é a resposta a uma ação disparada de dentro de um deles. */
.alert-modal-overlay { z-index: 120; }
.alert-modal-box { max-width: 460px; }
.alert-modal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.alert-modal-head h3 { margin: 0; }
.alert-modal-head.error { color: var(--pink); }
.alert-modal-head.info { color: var(--accent-text); }
.alert-modal-message { font-size: 14px; color: var(--ink); margin: 0 0 18px; white-space: pre-wrap; }

/* Envio de arquivo em curso. Cobre a tela para dizer que está acontecendo — e, de quebra, para
   impedir o segundo envio do mesmo arquivo, que era o que acontecia quando a tela não dizia nada. */
.loading-overlay {
  position: fixed; inset: 0; background: rgba(36,19,41,0.55); display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 20px;
}
.loading-box {
  background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: 22px 26px; display: flex; align-items: center; gap: 16px; max-width: 420px;
}
.loading-texts { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.loading-title { font-size: 14px; color: var(--ink); }
.loading-detail { font-size: 12px; color: var(--slate-50); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loading-spinner {
  width: 26px; height: 26px; flex: none; border-radius: 50%;
  border: 3px solid var(--slate-30); border-top-color: var(--purple);
  animation: gx-spin 700ms linear infinite;
}
@keyframes gx-spin { to { transform: rotate(360deg); } }
/* Quem pediu menos animação continua vendo que algo está em curso, só que sem o giro rápido. */
@media (prefers-reduced-motion: reduce) { .loading-spinner { animation-duration: 2.4s; } }

.doc-preview-box { max-width: 900px; width: 90vw; height: 88vh; display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.doc-preview-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--slate-10); flex-shrink: 0; }
.doc-preview-filename { font-weight: 700; font-size: 14px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-preview-header-actions { display: flex; gap: 8px; flex-shrink: 0; }
.doc-preview-body { flex: 1; overflow: auto; background: var(--slate-10); display: flex; }
.doc-preview-iframe { width: 100%; height: 100%; border: none; flex: 1; }
.doc-preview-image { max-width: 100%; margin: auto; display: block; }
.doc-preview-unsupported { margin: auto; text-align: center; padding: 40px; color: var(--slate-50); font-size: 14px; display: flex; flex-direction: column; gap: 14px; align-items: center; }

/* Separação em pilhas (Pasta aeroporto / Carteira na ICES High School): o título é o que diz onde
   o documento vai parar, então precisa ler como cabeçalho e não como mais um item da lista. */
.checklist-group + .checklist-group { margin-top: 22px; }
.checklist-group-title {
  display: flex; align-items: center; gap: 8px; margin: 0 0 4px; padding-bottom: 8px;
  border-bottom: 1px solid var(--slate-30); font-size: 13px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--slate-50);
}

.checklist-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--slate-30); font-size: 14px; }
.checklist-row:last-child { border-bottom: none; }
/* Item derivado (o do seguro): a caixa mostra o resultado, não é um botão. */
.checklist-row input[type=checkbox]:disabled { cursor: default; opacity: 0.9; }
.checklist-row .meta { color: var(--slate-50); font-size: 12px; margin-left: auto; }
.checklist-row input[type=checkbox] {
  appearance: none; width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--slate-30); background: var(--white);
  cursor: pointer; flex-shrink: 0; position: relative; transition: all var(--duration-base) var(--ease-standard); margin: 0;
}
.checklist-row input[type=checkbox]:checked { background: var(--purple); border-color: var(--purple); }
.checklist-row input[type=checkbox]:checked::after {
  content: "✓"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 13px;
}

.dashboard-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin-bottom: 20px; }
.stat-tile { background: var(--white); border-radius: var(--radius-lg); padding: 20px 22px; box-shadow: var(--shadow-md); }
.stat-tile-brand { background: var(--purple); color: #fff; box-shadow: var(--shadow-brand); }
.stat-tile .stat-label { font-size: 12px; opacity: 0.85; margin-bottom: 6px; }
.stat-tile-brand .stat-label { color: rgba(255,255,255,0.85); }
.stat-tile .stat-value { font-size: 26px; font-weight: 700; color: var(--ink); }
.stat-tile-brand .stat-value { color: #fff; }

.alert-list { display: flex; flex-direction: column; }
.alert-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--slate-10); cursor: pointer; transition: background var(--duration-base) var(--ease-standard); }
.alert-row:last-child { border-bottom: none; }
.alert-row:hover { background: var(--slate-10); }
.alert-icon { flex-shrink: 0; width: 20px; height: 20px; color: var(--accent-text); display: flex; align-items: center; justify-content: center; }
.alert-icon .material-symbols-outlined { font-size: 20px; }
.alert-body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.alert-student { font-weight: 700; font-size: 13px; color: var(--ink); }
.alert-message { font-size: 12px; color: var(--slate-50); }

.students-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }

.back-link { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 16px; color: var(--accent-text); cursor: pointer; font-size: 14px; font-weight: 600; text-decoration: none; }
.back-link:hover { text-decoration: underline; }

/* Linha acima do card do aluno: voltar à esquerda, ações do aluno (arquivar) à direita. */
.detail-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.detail-topbar .back-link { margin-bottom: 0; }
.archived-actions { display: flex; gap: 8px; justify-content: flex-end; white-space: nowrap; }

.agreement-text { white-space: pre-wrap; font-size: 13px; background: var(--slate-10); border: none; border-radius: var(--radius-md); padding: 16px; margin-bottom: 14px; max-height: 260px; overflow-y: auto; }
.agreement-signers { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.agreement-signer-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border: 1px solid var(--slate-30); border-radius: var(--radius-md); }
.agreement-signer-name { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); font-size: 14px; }

.avatar { border-radius: 50%; object-fit: cover; display: inline-block; vertical-align: middle; }
.avatar-placeholder { background: var(--purple-4); color: var(--purple); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.student-name-cell { display: flex; align-items: center; gap: 10px; }
.student-header-top { display: flex; align-items: flex-start; gap: 18px; }
.avatar-upload { position: relative; cursor: pointer; flex-shrink: 0; width: 72px; height: 72px; border-radius: 50%; }
.avatar-upload .avatar-edit-hint {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center;
  background: rgba(36,19,41,0.65); color: #fff; font-size: 10px; font-weight: 700; border-radius: 50%; opacity: 0;
  transition: opacity var(--duration-base) var(--ease-standard);
}
.avatar-upload:hover .avatar-edit-hint { opacity: 1; }
.avatar-flag-badge {
  position: absolute; right: -2px; bottom: -2px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--white); box-shadow: var(--shadow-sm); background: var(--white);
}
.avatar-status-dot {
  position: absolute; top: 3px; right: 3px; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--white); box-shadow: var(--shadow-sm);
}
.avatar-status-dot.active { background: var(--green-vivid); border-color: var(--white); }
.avatar-status-dot.inactive { background: var(--slate-30); }

.progress-ring { position: relative; flex-shrink: 0; }
.progress-ring-track { stroke: var(--slate-10); }
.progress-ring-bar { stroke-linecap: round; transition: stroke-dashoffset 1100ms cubic-bezier(0.4, 0, 0.2, 1); }
.progress-ring-label {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800; color: var(--ink);
}

.pill-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.pill { background: var(--slate-10); color: var(--accent-text); font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: var(--radius-pill); }

.subtabs {
  display: flex; align-items: center; gap: 4px; position: sticky; top: 0; z-index: 5;
  background: var(--paper); padding: 10px 0; margin-bottom: 20px; border-bottom: 1px solid var(--slate-30);
}
.subtabs-group { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.subtabs-group + .subtabs-group:not(.subtabs-end) { margin-left: 10px; padding-left: 10px; border-left: 1px solid var(--slate-30); }
.subtabs-end { margin-left: auto; padding-left: 14px; border-left: 1px solid var(--slate-30); }
.subtabs button {
  all: unset; background: none; color: var(--slate-50); cursor: pointer; font-family: var(--font-body);
  width: 40px; height: 40px; border-radius: var(--radius-pill); flex-shrink: 0; position: relative;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--duration-base) var(--ease-standard);
}
.subtabs-group.phase-application button { color: var(--purple-1); }
.subtabs-group.phase-preparacao button { color: var(--pink-1); }
.subtabs-group.phase-viagem button { color: var(--green-vivid); }
.subtabs button:hover { background: var(--slate-10); color: var(--ink); }
.subtabs button.active { color: #fff; background: var(--purple); }
.subtabs button:disabled { opacity: 0.35; cursor: not-allowed; }
.subtabs button:disabled:hover { background: none; color: var(--slate-50); }

.subtabs button[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(-4px);
  background: var(--ink); color: var(--tooltip-text, #fff); font-size: 12px; font-weight: 600; white-space: nowrap;
  padding: 5px 10px; border-radius: 6px; pointer-events: none; z-index: 20;
  opacity: 0; visibility: hidden; transition: opacity 150ms ease, transform 150ms ease, visibility 150ms;
}
.subtabs button[data-tooltip]:hover::after { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

/* Bolinha de status no canto do ícone da aba: cinza = não feito, verde = concluído,
   vermelho = precisa de ação. O botão já é position: relative. A borda da cor do fundo recorta a
   bolinha do ícone, para ela não se perder em cima do desenho.
   A cor nunca é a única informação: o motivo vai no tooltip e no aria-label do botão. */
.subtab-dot {
  position: absolute; top: 4px; right: 4px; width: 9px; height: 9px; border-radius: 50%;
  border: 2px solid var(--paper); box-sizing: content-box; pointer-events: none;
}
.subtab-dot.pendente { background: var(--slate-30); }
.subtab-dot.ok { background: var(--green-vivid); }
.subtab-dot.alerta { background: var(--pink-2); }
/* Na aba ativa o fundo é roxo, então a borda de recorte acompanha. */
.subtabs button.active .subtab-dot { border-color: var(--purple); }

/* ---------- Timeline ---------- */
.timeline-section { margin-bottom: 26px; }
.timeline-section h3 { font-size: 13px; color: var(--slate-50); text-transform: uppercase; letter-spacing: 0.05em; margin: 0 0 14px; }
.timeline-track { position: relative; padding-left: 36px; }
.timeline-track::before { content: ''; position: absolute; left: 13px; top: 4px; bottom: 4px; width: 2px; background: var(--slate-30); }
/* O círculo alinha pelo centro da PRIMEIRA LINHA DO RÓTULO, deixando o eyebrow (data ou "PENDENTE")
   acima da linha do círculo. Antes ele era alinhado pelo topo do bloco, o que descolava o ícone da
   frase que ele representa. As alturas de linha logo abaixo são fixas para que a conta seja
   determinística e não dependa da fonte que o sistema resolver: 14px do eyebrow + 2px do gap +
   metade dos 20px da primeira linha do rótulo = 26px. */
.timeline-event { position: relative; margin-bottom: 20px; }
.timeline-event:last-child { margin-bottom: 0; }
.timeline-dot {
  position: absolute; left: -36px; top: 26px; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%;
  background: var(--white); border: 2px solid var(--accent-text); color: var(--accent-text);
  display: flex; align-items: center; justify-content: center; z-index: 1; flex-shrink: 0;
}
.timeline-event-body { display: flex; flex-direction: column; gap: 2px; }
.timeline-event-date { font-size: 11px; line-height: 14px; font-weight: 700; color: var(--slate-50); text-transform: uppercase; letter-spacing: 0.03em; }
.timeline-event-label { font-size: 14px; line-height: 20px; color: var(--ink); font-weight: 600; }
.timeline-event-detail { font-size: 12px; color: var(--slate-50); }

/* A etapa pendente era esmaecida com opacity no bloco inteiro. Isso também deixava translúcido o
   fundo do círculo, então a linha vertical da trilha aparecia atravessando o ícone. Agora o
   esmaecimento é feito na cor de cada elemento e o círculo mantém fundo opaco — ele recorta a
   linha em vez de deixá-la passar. O fundo usa var(--white), que é o token de superfície do card
   e já troca sozinho entre o tema claro e o escuro. */
.roadmap-item.pending .timeline-event-label { font-weight: 500; color: var(--slate-50); }
.roadmap-item.pending .timeline-event-date,
.roadmap-item.pending .timeline-event-detail { color: var(--slate-30); }
.roadmap-item.pending .timeline-dot { background: var(--white); border-color: var(--slate-30); color: var(--slate-30); }
.timeline-dot.done { background: var(--green); border-color: var(--green); color: #fff; }

.wizard-steps { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; font-size: 13px; color: var(--slate-50); }
.wizard-step { display: flex; align-items: center; gap: 6px; }
.wizard-step b { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--slate-10); color: var(--slate-70); font-size: 11px; }
.wizard-step.active { color: var(--ink); font-weight: 700; }
.wizard-step.active b { background: var(--pink); color: #fff; }
.wizard-step.done b { background: var(--green); color: #fff; }
.wizard-sep { color: var(--slate-30); }

.notion-guide { font-size: 14px; line-height: 1.6; color: var(--slate-90); max-height: 520px; overflow-y: auto; padding-right: 6px; }
.notion-guide h2 { font-size: 18px; color: var(--ink); margin: 22px 0 8px; }
.notion-guide h3 { font-size: 16px; color: var(--ink); margin: 18px 0 6px; }
.notion-guide h4 { font-size: 14px; color: var(--ink); margin: 14px 0 4px; }
.notion-guide p { margin: 0 0 10px; }
.notion-guide ul, .notion-guide ol { margin: 0 0 10px; padding-left: 22px; }
.notion-guide li { margin-bottom: 4px; }
.notion-guide blockquote { margin: 0 0 10px; padding: 8px 14px; border-left: 3px solid var(--purple-3); background: var(--slate-10); color: var(--slate-70); }
.notion-guide hr { border: none; border-top: 1px solid var(--slate-30); margin: 16px 0; }
.notion-guide figure { margin: 0 0 10px; }
.notion-guide figure img { max-width: 100%; border-radius: var(--radius-sm); }
.notion-guide figcaption { font-size: 12px; color: var(--slate-50); margin-top: 4px; }
.notion-guide details { margin: 0 0 10px; border: 1px solid var(--slate-30); border-radius: var(--radius-sm); padding: 8px 12px; }
.notion-guide details summary { cursor: pointer; font-weight: 700; }
.notion-guide table { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
.notion-guide table td { border: 1px solid var(--slate-30); padding: 6px 10px; }
.notion-callout { background: var(--purple-4); color: var(--purple); border-radius: var(--radius-sm); padding: 10px 14px; margin: 0 0 10px; }
.notion-todo { padding: 2px 0; }

footer.small-note { text-align: center; color: var(--slate-50); font-size: 12px; padding: 20px; }

@media print {
  .sidebar, .subtabs, .content-header .logout-btn, .no-print { display: none !important; }
  body { background: #fff; }
  .app-shell { display: block; }
}

@media (max-width: 720px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; align-items: center; padding: 14px 16px; overflow-x: auto; }
  .sidebar .sidebar-logo { margin: 0 16px 0 0; }
  .sidebar nav { flex-direction: row; }
  .sidebar nav button { border-left: none; border-bottom: 3px solid transparent; white-space: nowrap; }
  .sidebar nav button.active { border-left: none; border-bottom-color: var(--lemon); }
  /* No celular o menu vira uma barra horizontal: os títulos de seção não cabem, e as seções
     viram grupos lado a lado separados por um traço vertical. */
  .nav-group { flex-direction: row; }
  .nav-group + .nav-group { margin-top: 0; margin-left: 12px; padding-left: 12px; border-left: 1px solid rgba(255,255,255,0.12); }
  .nav-group-title { display: none; }
  .login-wrap { flex-direction: column; }
  .login-brand-panel { padding: 32px; min-height: 200px; }
  .grid-2 { grid-template-columns: 1fr; }
}

/* Status do kit de viagem GX: três botões lado a lado, o atual cheio e os outros com contorno. */
.kit-status-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
