/* ==========================================================
   Área do aluno e painel — mobile primeiro
   No celular a navegação fica embaixo (área do polegar);
   no notebook ela sobe para o topo.
   ========================================================== */

body.app { background: var(--canvas); }

/* ---------- Topo ---------- */

.app-topo {
  position: sticky; top: 0; z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
/* Desfoque só no notebook: no celular ele prenderia a barra inferior dentro do topo */
@media (min-width: 1024px) {
  .app-topo { background: rgba(255, 251, 252, .88); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); }
}
.app-topo__linha { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 8px; }
.app-topo__marca img { height: 42px; width: auto; }

.usuario { display: flex; align-items: center; gap: 12px; }
.usuario__texto { display: none; flex-direction: column; text-align: right; font-size: var(--step--1); line-height: 1.3; }
.usuario__texto a { font-size: .8rem; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(140deg, var(--plum-500), var(--plum-700)); color: var(--white); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .9rem; box-shadow: var(--depth-1); }

/* Abas: barra inferior no celular */
.abas {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px);
  border-top: 1px solid var(--line);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  box-shadow: 0 -14px 34px -22px rgba(34, 16, 31, .35);
}
.abas [role="tab"] {
  position: relative; font: inherit; border: 0; background: transparent; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 58px; border-radius: 16px; color: var(--muted); font-size: .72rem; font-weight: 700;
  transition: color .25s, background-color .25s;
}
.abas [role="tab"] svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .35s var(--ease-spring); }
.abas [role="tab"][aria-selected="true"] { color: var(--plum-700); background: var(--blush-50); }
.abas [role="tab"][aria-selected="true"] svg { transform: translateY(-2px) scale(1.08); }
.abas__ponto { position: absolute; top: 10px; right: calc(50% - 18px); width: 9px; height: 9px; border-radius: 50%; background: #D9822B; box-shadow: 0 0 0 2px var(--white); }

.app-main { padding-top: 24px; padding-bottom: calc(110px + env(safe-area-inset-bottom)); }

@media (min-width: 1024px) {
  .app-topo__linha { padding-block: 12px; }
  .app-topo__marca img { height: 52px; }
  .usuario__texto { display: flex; }
  .abas {
    position: static; display: flex; gap: 4px; padding: 6px; border: 0; border-radius: 999px;
    background: var(--blush-50); box-shadow: inset 0 0 0 1px var(--line); backdrop-filter: none;
  }
  .abas [role="tab"] { flex-direction: row; min-height: 46px; padding: 0 20px; border-radius: 999px; font-size: var(--step--1); gap: 8px; }
  .abas [role="tab"] svg { width: 18px; height: 18px; }
  .abas [role="tab"][aria-selected="true"] { background: var(--plum-700); color: var(--white); box-shadow: 0 8px 18px -10px rgba(94, 47, 87, .8); }
  .abas [role="tab"][aria-selected="true"] svg { transform: none; }
  .abas__ponto { top: 8px; right: 10px; }
  .app-main { padding-top: 40px; padding-bottom: 80px; }
}

/* ---------- Painéis ---------- */

.painel { display: flex; flex-direction: column; gap: 20px; animation: fadeUp .45s var(--ease-out) both; }
.painel__cabeca { display: flex; flex-direction: column; gap: 8px; }
.painel__cabeca .lead { font-size: var(--step-0); }
.pequeno { font-size: var(--step--1); }

.grade-inicio { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 700px) { .grade-inicio { grid-template-columns: repeat(2, minmax(0, 1fr)); } .evolucao { grid-column: 1 / -1; } }
@media (min-width: 1280px) { .grade-inicio { grid-template-columns: minmax(300px, 1fr) minmax(300px, 1fr) 2fr; gap: 20px; } .evolucao { grid-column: auto; } }

.cartao { padding: clamp(20px, 2.5vw, 30px); display: flex; flex-direction: column; gap: 14px; }
.cartao h2 { font-size: var(--step-0); font-weight: 700; }
.cartao__topo { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.cartao__valor { white-space: nowrap; font-family: var(--font-display); font-size: clamp(2.4rem, 1.6rem + 2.6vw, 3.6rem); font-weight: 600; line-height: 1; letter-spacing: -.03em; }
.mensalidade.is-paga { background: var(--white); color: var(--ink); border-color: var(--line); }

.numeros { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.numeros p { display: flex; flex-direction: column; font-size: .8rem; color: var(--muted); font-weight: 600; }
.numeros span { font-family: var(--font-display); font-size: var(--step-3); font-weight: 600; line-height: 1.05; color: var(--plum-700); font-variant-numeric: tabular-nums; }

/* Gráfico de linha (SVG) */
.grafico-linha svg { width: 100%; height: auto; overflow: visible; }
.grafico-linha .area { fill: url(#grad-evolucao); }
.grafico-linha .linha { fill: none; stroke: var(--plum-500); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.grafico-linha .ponto { fill: var(--white); stroke: var(--plum-500); stroke-width: 3; }
.grafico-linha .rotulo { font-family: var(--font-body); font-size: 13px; font-weight: 700; fill: var(--plum-700); text-anchor: middle; }
.grafico-linha .eixo-x { font-family: var(--font-body); font-size: 12px; fill: var(--muted); text-anchor: middle; }
.grafico-linha .guia { stroke: #EEDDE7; stroke-dasharray: 4 6; }

.correcao { padding: clamp(20px, 3vw, 36px); display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 900px) { .correcao { grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; } }
.correcao__texto { display: flex; flex-direction: column; gap: 10px; }
.correcao__texto h2 { font-size: var(--step-2); line-height: 1.1; color: var(--ink); }
.correcao__texto p:not(.eyebrow) { color: var(--ink-soft); }
.correcao__texto a { font-weight: 700; }

.competencias { display: flex; flex-direction: column; gap: 12px; }
.comp { display: grid; grid-template-columns: 34px minmax(0, 1fr) 40px; align-items: center; gap: 12px; font-size: var(--step--1); }
.comp__trilho { height: 10px; background: #F3E6EE; border-radius: 999px; overflow: hidden; }
.comp__trilho div { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--lilac), var(--plum-500)); transform-origin: left; animation: growX .9s .2s var(--ease-out) both; }
.comp__valor { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }

/* ---------- Propostas ---------- */

.propostas { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 700px) { .propostas { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; } }
@media (min-width: 1280px) { .propostas { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.proposta { padding: 22px; display: flex; flex-direction: column; gap: 12px; animation: fadeUp .4s var(--ease-out) both; }
.proposta__topo { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.eixo-tag { display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 700; }
.eixo-tag::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.proposta h2 { font-family: var(--font-display); font-size: var(--step-2); font-weight: 560; line-height: 1.12; flex-grow: 1; }
.proposta p { font-size: var(--step--1); color: var(--muted); }
.vazio { padding: 32px; text-align: center; color: var(--muted); background: var(--white); border-radius: var(--radius-m); border: 1.5px dashed var(--field); }

/* ---------- Histórico ---------- */

.resumo-hist { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.resumo-hist > div { padding: 14px; text-align: center; }
.resumo-hist strong { display: block; font-family: var(--font-display); font-size: var(--step-3); font-weight: 600; line-height: 1; color: var(--plum-700); font-variant-numeric: tabular-nums; }
.resumo-hist span { font-size: .78rem; color: var(--muted); font-weight: 600; }
@media (min-width: 700px) { .resumo-hist { max-width: 640px; } .resumo-hist > div { padding: 20px; } }
.nota-pill { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; color: var(--plum-700); font-variant-numeric: tabular-nums; }

/* ---------- Folhas (dialog) ----------
   Celular: sobem de baixo, ocupam a largura toda.
   Notebook: janela central. */
dialog.folha {
  margin: auto auto 0; width: 100%; max-width: 100%; max-height: 92svh; overflow-y: auto;
  border-radius: 28px 28px 0 0;
  padding: 28px var(--gutter) calc(24px + env(safe-area-inset-bottom));
  display: none; flex-direction: column; gap: 16px;
}
dialog.folha[open] { display: flex; animation: sobe .45s var(--ease-out) both; }
@keyframes sobe { from { transform: translateY(100%); } to { transform: none; } }
dialog.folha::before { content: ""; align-self: center; width: 44px; height: 5px; border-radius: 999px; background: #E3CFDA; margin: -12px 0 4px; }
.folha__fechar { position: absolute; top: 12px; right: 12px; }
.folha__fechar button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--blush-50); color: var(--plum-700); font-size: 26px; line-height: 1; cursor: pointer; }
.folha__titulo { font-size: var(--step-2); line-height: 1.1; padding-right: 44px; }
@media (min-width: 700px) {
  dialog.folha { margin: auto; width: min(560px, calc(100% - 48px)); border-radius: var(--radius-l); padding: 36px; }
  dialog.folha[open] { animation: modalIn .4s var(--ease-out) both; }
  dialog.folha::before { display: none; }
}

.envio-opcoes { display: grid; grid-template-columns: 1fr; gap: 12px; }
.envio-opcao {
  display: flex; align-items: center; gap: 16px; padding: 18px; cursor: pointer;
  border: 1.5px solid var(--line); border-radius: 18px; background: var(--white); box-shadow: var(--depth-1);
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.envio-opcao:active { transform: scale(.98); }
.envio-opcao:hover { border-color: var(--lilac); box-shadow: var(--depth-2); }
.envio-opcao:has(input:focus-visible) { outline: 3px solid var(--plum-500); outline-offset: 3px; }
.envio-opcao svg { width: 30px; height: 30px; flex-shrink: 0; fill: none; stroke: var(--plum-500); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.envio-opcao span { display: flex; flex-direction: column; }
.envio-opcao small { color: var(--muted); font-size: var(--step--1); }
.arquivo-escolhido { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--ok-bg); color: var(--ok-fg); font-weight: 700; overflow-wrap: anywhere; animation: fadeUp .3s var(--ease-out) both; }
.arquivo-escolhido svg { width: 22px; height: 22px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; }

.pix-qr { border: 1px solid var(--line); border-radius: 16px; padding: 4px 16px; }
.pix-qr summary { cursor: pointer; font-weight: 700; color: var(--plum-700); padding: 12px 0; min-height: 44px; }
.pix-qr .qr { margin: 8px auto 16px; max-width: 220px; }
dialog.folha > .btn--gold { align-self: flex-start; }

.nota-grande { font-size: var(--step--1); color: var(--muted); font-weight: 600; }
.nota-grande span { font-family: var(--font-display); font-size: var(--step-4); font-weight: 600; color: var(--plum-700); line-height: 1; margin-right: 6px; }
.devolutiva { font-family: var(--font-display); font-size: var(--step-1); line-height: 1.45; color: var(--ink-soft); padding: 16px 18px; background: var(--blush-50); border-radius: 16px; font-variation-settings: "opsz" 24; }

/* ==========================================================
   Painel da equipe
   ========================================================== */

body.admin .app-main { display: flex; flex-direction: column; gap: 20px; }

/* Seções: faixa rolável no celular, barra lateral no notebook */
.secoes { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 4px var(--gutter) 12px; margin-inline: calc(var(--gutter) * -1); }
.secoes::-webkit-scrollbar { display: none; }
.secoes button {
  flex-shrink: 0; font: inherit; font-size: var(--step--1); font-weight: 700; cursor: pointer;
  min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--white); color: var(--ink-soft);
  transition: background-color .2s, color .2s, border-color .2s;
}
.secoes button[aria-current="page"] { background: var(--plum-700); color: var(--white); border-color: var(--plum-700); box-shadow: 0 8px 18px -10px rgba(94, 47, 87, .8); }

.admin-grade { display: block; }
@media (min-width: 1024px) {
  .admin-grade { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: clamp(24px, 3vw, 48px); align-items: start; }
  .secoes { position: sticky; top: 100px; flex-direction: column; overflow: visible; margin: 0; padding: 12px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-m); box-shadow: var(--depth-1); }
  .secoes button { text-align: left; border: 0; border-radius: 12px; padding: 0 14px; }
  .secoes button:hover { background: var(--blush-50); }
}
.conteudo-admin { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 1100px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; } }
.kpi { padding: clamp(16px, 2vw, 24px); display: flex; flex-direction: column; gap: 4px; }
.kpi h2 { font-size: .8rem; font-weight: 600; color: var(--muted); }
.kpi p { white-space: nowrap; font-family: var(--font-display); font-size: clamp(1.6rem, 1rem + 1.5vw, 2.5rem); font-weight: 600; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi small { font-size: .78rem; color: var(--ink-soft); }

.linha { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 1100px) { .linha { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; } .linha--3-2 { grid-template-columns: 3fr 2fr; } }
.bloco { padding: clamp(18px, 2.5vw, 28px); display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.bloco h2 { font-size: var(--step-0); font-weight: 700; }
.bloco__cabeca { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; }
.bloco__cabeca span { font-size: .8rem; color: var(--muted); }
.bloco--destaque { border: 2px solid var(--lilac); }

/* Colunas (CSS puro) */
.colunas { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: clamp(8px, 2vw, 18px); align-items: end; height: 220px; }
.coluna { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; min-width: 0; }
.coluna__valor { font-size: .75rem; font-weight: 700; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.coluna__barra { width: 100%; max-width: 54px; border-radius: 10px 10px 4px 4px; background: linear-gradient(180deg, var(--plum-500), var(--plum-700)); transform-origin: bottom; animation: growY .9s var(--ease-out) both; box-shadow: 0 10px 20px -12px rgba(94, 47, 87, .7); }
.coluna__barra.is-parcial { background: linear-gradient(180deg, var(--lilac), var(--plum-500)); }
.coluna__barra.is-ouro { background: linear-gradient(180deg, var(--gold-soft), var(--gold)); }
.coluna__mes { font-size: .78rem; color: var(--muted); border-top: 1px solid #E7D3DF; width: 100%; text-align: center; padding-top: 6px; }

.barras { display: flex; flex-direction: column; gap: 14px; }
.barra__topo { display: flex; justify-content: space-between; font-size: var(--step--1); margin-bottom: 6px; }
.barra__trilho { height: 12px; background: #F3E6EE; border-radius: 999px; overflow: hidden; }
.barra__trilho div { height: 100%; border-radius: 999px; transform-origin: left; animation: growX .9s var(--ease-out) both; }

.lista-simples { list-style: none; padding: 0; }
.lista-simples li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-top: 1px solid #F0E1EA; }
.lista-simples li > span { display: flex; flex-direction: column; font-size: .8rem; color: var(--muted); }
.lista-simples strong { font-size: var(--step--1); color: var(--ink); }

.filtros { display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 900px) { .filtros { flex-direction: row; align-items: center; justify-content: space-between; } }
.busca { display: flex; align-items: center; gap: 8px; color: var(--muted); background: var(--white); border: 1.5px solid var(--field); border-radius: 14px; padding: 0 14px; }
.busca input { font: inherit; font-size: 1rem; border: 0; padding: 13px 0; width: 100%; min-width: 0; background: transparent; color: var(--ink); }
.busca input:focus { outline: none; }
.busca:focus-within { border-color: var(--plum-500); box-shadow: 0 0 0 4px rgba(200, 140, 183, .35); }
@media (min-width: 900px) { .busca { width: 300px; } }

.acoes { display: flex; flex-wrap: wrap; gap: 8px; }
.table--cards .acoes { justify-content: flex-end; }
@media (max-width: 760px) { .table--cards td .acoes { width: 100%; } .table--cards td .acoes .btn { flex: 1; } }

.lista-eixos { list-style: none; padding: 0; }
.lista-eixos li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid #F0E1EA; }
.eixo-nome { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.eixo-cor { width: 12px; height: 12px; border-radius: 50%; }
.switch { position: relative; width: 52px; height: 32px; flex-shrink: 0; border-radius: 999px; border: 0; padding: 0; cursor: pointer; background: #D9C7D2; transition: background-color .25s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: var(--white); box-shadow: 0 2px 6px rgba(0, 0, 0, .25); transition: transform .35s var(--ease-spring); }
.switch[aria-checked="true"] { background: var(--plum-500); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }

.form-grade { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 700px) { .form-grade { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cheio { grid-column: 1 / -1; } }
.formatos { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 20px; }
.formatos legend { font-weight: 600; font-size: var(--step--1); margin-bottom: 10px; }
.formatos label { display: flex; gap: 10px; align-items: center; min-height: 44px; }
.formatos input { accent-color: var(--plum-500); width: 22px; height: 22px; }
.novo-eixo { display: flex; gap: 8px; align-items: flex-end; }
.novo-eixo .field { flex: 1; }
.notas { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; }
.nota-total strong { font-family: var(--font-display); font-size: var(--step-3); color: var(--plum-700); font-variant-numeric: tabular-nums; }
.tres { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.btn-inicio { align-self: flex-start; }

/* ---------- v3: mais cor e menos texto ---------- */
.cartao__titulo { display: flex; align-items: center; gap: 10px; }
.tile--claro { color: var(--white); background: rgba(255, 255, 255, .14); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2); }
.mensalidade { background: radial-gradient(120% 80% at 100% 0%, rgba(201, 148, 76, .25), transparent 55%), linear-gradient(160deg, #42183C, var(--plum-900)) !important; border-color: transparent !important; box-shadow: var(--depth-dark); }
.mensalidade.is-paga { background: var(--white) !important; border-color: var(--line) !important; box-shadow: var(--depth-1); }
.mensalidade.is-paga .tile--claro { color: var(--tone-teal); background: var(--tone-teal-bg); }
.proposta { border-top: 4px solid var(--eixo, var(--plum-500)); }
.resumo-hist > div { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.kpi { position: relative; }
.kpi .tile { margin-bottom: 8px; }
.evolucao { background: linear-gradient(180deg, var(--white) 0%, #FFF8FB 100%); }

/* ---------- Dados reais (área do aluno e painel) ---------- */
.aviso-envio { padding: 14px 18px; margin: 0 0 16px; border-left: 4px solid var(--tone-gold, #C9944C); font-weight: 600; color: var(--ink-soft); }
#link-grupo { margin-top: 12px; align-self: flex-start; }
.envio-instrucoes { border: 1px solid var(--line); border-radius: 14px; padding: 2px 16px; margin: 4px 0 14px; }
.envio-instrucoes summary { cursor: pointer; font-weight: 700; color: var(--plum-700); padding: 12px 0; min-height: 44px; }
.envio-instrucoes div { white-space: pre-line; max-height: 40vh; overflow: auto; padding-bottom: 14px; color: var(--ink-soft); }
.qr:has(img) { display: block; aspect-ratio: auto; }
.qr img { display: block; width: 100%; height: auto; }
.titulo-lista { margin-top: 28px; }
#lista-propostas li { gap: 12px; }
#lista-propostas li span { display: flex; flex-direction: column; font-size: .85rem; color: var(--muted); }
#lista-propostas li span strong { color: var(--ink); font-size: 1rem; }
.mes-financeiro { max-width: 220px; }
.usuario__texto a { font-size: .8rem; }
