/* Health Physio OS — estilos (identidade: docs/identidade-visual.md) */
:root {
  --primary: #006D77;
  --primary-escuro: #005a62;
  --primary-suave: #dff0f1;
  --navy: #204869;
  --secondary: #83C5BE;
  --accent: #E29578;
  --dark: #1c2930;
  --muted: #5f6e74;
  --line: #e2e9eb;
  --soft: #f3f8f8;
  --branco: #ffffff;

  --ok: #2E7D5B;        --ok-bg: #e0f2e9;   --ok-tx: #1f6b4a;
  --alerta-bg: #f8efd8; --alerta-tx: #7a5a12;
  --erro: #B5532E;      --erro-bg: #fbe6dc; --erro-tx: #8a3a1c;

  --raio: 18px;
  --raio-campo: 12px;
  --sombra: 0 16px 32px rgba(32, 72, 105, .10);
  --gradiente: radial-gradient(circle at 85% 8%, rgba(131,197,190,.30), transparent 38%), linear-gradient(160deg, #204869 0%, #0f5a64 100%);
  --gradiente-card: linear-gradient(135deg, #204869 0%, #006D77 100%);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Lexend', system-ui, sans-serif;
  color: var(--dark);
  background: var(--soft);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); }
a:hover { color: var(--navy); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--secondary); outline-offset: 2px; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 50px; border: 1.5px solid var(--line);
  background: var(--branco); color: var(--dark); font-size: 14px; font-weight: 500;
  cursor: pointer; text-decoration: none; white-space: nowrap; transition: .15s;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primario { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primario:hover { background: var(--primary-escuro); border-color: var(--primary-escuro); color: #fff; }
.btn-perigo { color: var(--erro-tx); }
.btn-perigo:hover { border-color: var(--erro); color: var(--erro-tx); }
.btn-pequeno { min-height: 36px; padding: 0 14px; font-size: 13px; }
.btn-bloco { width: 100%; }
.btn[disabled] { opacity: .55; cursor: wait; }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn-icone { width: 44px; padding: 0; }

/* ---------- Campos ---------- */
.campo { display: flex; flex-direction: column; gap: 6px; }
.campo > label, .campo > .rotulo { font-size: 13px; color: var(--muted); }
.campo input, .campo select, .campo textarea {
  min-height: 48px; border: 1.5px solid transparent; border-radius: var(--raio-campo);
  background: var(--soft); padding: 0 14px; font-size: 15px; outline: none; width: 100%;
}
.campo textarea { padding: 12px 14px; min-height: 90px; resize: vertical; }
.campo input:focus, .campo select:focus, .campo textarea:focus { border-color: var(--primary); background: #fff; }
.campo .ajuda { font-size: 12px; color: var(--muted); }
.linha-campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }

.escolhas { display: flex; flex-wrap: wrap; gap: 8px; }
.escolha {
  min-height: 44px; padding: 0 16px; border-radius: 50px; border: 1.5px solid var(--line);
  background: #fff; cursor: pointer; font-size: 14px;
}
.escolha[aria-checked="true"], .escolha[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 500; }
.escolhas-grandes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.escolhas-grandes .escolha {
  min-height: 64px; border-radius: 14px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px; font-size: 15px;
}
.escolhas-grandes .escolha[aria-checked="true"] { background: var(--primary); border-color: var(--primary); }
.escolhas-grandes svg { width: 22px; height: 22px; }

/* ---------- Etiquetas ---------- */
.etiqueta { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; border-radius: 50px; padding: 4px 10px; white-space: nowrap; }
.et-ok { background: var(--ok-bg); color: var(--ok-tx); }
.et-alerta { background: var(--alerta-bg); color: var(--alerta-tx); }
.et-erro { background: var(--erro-bg); color: var(--erro-tx); }
.et-info { background: var(--primary-suave); color: #1f5f63; }
.et-navy { background: var(--navy); color: #fff; }
.et-neutra { background: var(--soft); color: var(--muted); }

/* ---------- Login ---------- */
.login {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: var(--gradiente);
}
.login-caixa {
  width: 100%; max-width: 400px; background: #fff; border-radius: 24px; padding: 32px 28px;
  box-shadow: 0 30px 60px rgba(0,0,0,.18); display: flex; flex-direction: column; gap: 18px;
}
.login-caixa img { width: 190px; align-self: center; margin-bottom: 4px; }
.login-caixa h1 { font-size: 20px; font-weight: 600; color: var(--navy); text-align: center; }
.login-caixa p { margin: 0; font-size: 14px; color: var(--muted); text-align: center; }
.mensagem { font-size: 14px; border-radius: 12px; padding: 10px 12px; }
.mensagem.erro { background: var(--erro-bg); color: var(--erro-tx); }
.mensagem.ok { background: var(--ok-bg); color: var(--ok-tx); }
.link-botao { background: none; border: none; color: var(--primary); cursor: pointer; font-size: 14px; padding: 8px; text-decoration: underline; min-height: 44px; }

/* ---------- Estrutura ---------- */
.app { min-height: 100vh; display: flex; }
.menu {
  width: 256px; flex-shrink: 0; background: var(--gradiente); color: #fff;
  padding: 24px 16px; display: flex; flex-direction: column; gap: 24px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.menu-logo { width: 168px; margin: 4px 8px 0; display: block; }
.menu nav { display: flex; flex-direction: column; gap: 4px; }
.menu nav a {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px;
  color: #e6f2f2; text-decoration: none; font-size: 15px; min-height: 44px;
}
.menu nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.menu nav a[aria-current="page"] { background: rgba(255,255,255,.16); color: #fff; font-weight: 500; }
.menu nav a svg { width: 20px; height: 20px; flex-shrink: 0; }
.menu nav a .em-breve { margin-left: auto; font-size: 11px; color: #bcd9d9; }
.menu nav a.desativado { opacity: .6; cursor: default; }
.menu-usuario { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: rgba(255,255,255,.10); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--secondary); color: var(--navy); display: grid; place-items: center; font-weight: 600; font-size: 14px; flex-shrink: 0; }
.menu-usuario div { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.menu-perfil { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; flex: 1; color: #fff; text-decoration: none; padding: 4px 6px; border-radius: 10px; min-height: 44px; justify-content: center; }
.menu-perfil:hover, .menu-perfil[aria-current="page"] { background: rgba(255,255,255,.12); color: #fff; }
.menu-usuario b { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-usuario span { font-size: 12px; color: #cfe5e5; }
.menu-usuario button { margin-left: auto; background: none; border: none; color: #fff; cursor: pointer; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; }
.menu-usuario button:hover { background: rgba(255,255,255,.12); }

.barra-celular { display: none; }
.conteudo { flex: 1; min-width: 0; padding: 32px 36px 56px; display: flex; flex-direction: column; gap: 22px; }

.cabecalho { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.cabecalho .titulos { display: flex; flex-direction: column; gap: 4px; }
.sobretitulo { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 1.5px; }
.cabecalho h1 { font-size: 30px; font-weight: 600; color: var(--navy); }
.acoes { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Cartões ---------- */
.cartao { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--raio); padding: 22px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.cartao-topo { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.cartao h2 { font-size: 17px; font-weight: 500; }
.colunas { display: flex; flex-wrap: wrap; gap: 16px; align-items: stretch; }
.colunas > * { flex: 1 1 360px; }
.colunas > .largo { flex: 2 1 520px; }

.indicadores { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.indicador { background: #fff; border: 1px solid var(--line); border-radius: var(--raio); padding: 20px 22px; display: flex; flex-direction: column; gap: 6px; }
.indicador .rotulo { font-size: 13px; color: var(--muted); }
.indicador .valor { font-size: 30px; font-weight: 600; line-height: 1.1; }
.indicador .detalhe { font-size: 13px; color: var(--muted); }
.indicador.destaque { background: var(--gradiente-card); border: none; color: #fff; }
.indicador.destaque .rotulo, .indicador.destaque .detalhe { color: #d7ecec; }
.indicador.atencao { background: var(--erro-bg); border-color: #f3cdbb; color: var(--erro-tx); }
.indicador.atencao .rotulo, .indicador.atencao .detalhe { color: var(--erro-tx); }

.barras { display: flex; flex-direction: column; gap: 14px; }
.barra { display: flex; flex-direction: column; gap: 6px; }
.barra-topo { display: flex; justify-content: space-between; font-size: 14px; }
.barra-trilho { height: 10px; border-radius: 10px; background: var(--soft); overflow: hidden; }
.barra-trilho div { height: 100%; border-radius: 10px; }

.lista { display: flex; flex-direction: column; gap: 10px; }
.item { display: flex; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); }
.item .hora { font-size: 14px; font-weight: 600; color: var(--navy); width: 46px; flex-shrink: 0; }
.item .textos { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.item .textos b { font-size: 14px; font-weight: 500; }
.item .textos span { font-size: 13px; color: var(--muted); }
.item.agora { background: var(--primary-suave); border-color: transparent; }
.item.passado { opacity: .65; }
.aviso { display: flex; gap: 12px; padding: 12px; border-radius: 14px; background: var(--soft); }
.aviso svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 2px; color: var(--primary); }
.aviso div { display: flex; flex-direction: column; gap: 2px; }
.aviso b { font-size: 14px; font-weight: 500; }
.aviso span { font-size: 13px; color: var(--muted); }
.aviso.erro { background: var(--erro-bg); }
.aviso.erro svg, .aviso.erro b, .aviso.erro span { color: var(--erro-tx); }

.tabela-caixa { overflow-x: auto; position: relative; }
table.tabela { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabela th { text-align: left; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; font-weight: 500; padding: 8px 10px; white-space: nowrap; }
.tabela td { padding: 12px 10px; border-top: 1px solid var(--line); vertical-align: middle; }
.tabela td.num, .tabela th.num { text-align: right; white-space: nowrap; }
.tabela .nome { font-weight: 500; }
.tabela .sub { display: block; font-size: 12px; color: var(--muted); }

.vazio { text-align: center; color: var(--muted); padding: 28px 16px; background: var(--soft); border-radius: 14px; font-size: 14px; }
.vazio b { display: block; color: var(--dark); font-weight: 500; margin-bottom: 4px; }

/* ---------- Abas ---------- */
.abas { display: flex; flex-wrap: wrap; gap: 6px; padding: 5px; background: #fff; border: 1px solid var(--line); border-radius: 50px; align-self: flex-start; max-width: 100%; }
.abas a { min-height: 40px; padding: 0 18px; border-radius: 50px; display: inline-flex; align-items: center; gap: 6px; color: #3e4b51; text-decoration: none; font-size: 14px; }
.abas a[aria-current="page"] { background: var(--primary-suave); color: var(--primary-escuro); font-weight: 500; }
.abas .contador { font-size: 12px; background: var(--accent); color: #4d1f0c; border-radius: 50px; padding: 1px 8px; }

/* ---------- Grade do Pilates ---------- */
.grade-topo { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.semana-nav { display: flex; align-items: center; gap: 6px; }
.semana-nav span { font-size: 14px; font-weight: 500; min-width: 150px; text-align: center; }
.legenda { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); }
.amostra-cor { width: 18px; height: 12px; border-radius: 3px; display: inline-block; margin-right: 6px; vertical-align: -1px; box-sizing: border-box; border-left: 4px solid; }
.cores-escolha { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
.cores-escolha .turma-opcao { flex-direction: row; align-items: center; min-height: 44px; }
.grade-caixa { overflow-x: auto; position: relative; }
.grade { display: grid; gap: 8px; font-size: 13px; min-width: 600px; }
.grade .dia { text-align: center; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; padding: 4px 0; }
.grade .dia.hoje { color: var(--primary); font-weight: 600; }
.grade .horario { color: var(--muted); font-weight: 500; padding-top: 12px; }
.grade .vago { border: 1.5px dashed var(--line); border-radius: 10px; min-height: 64px; }
.turma-celula {
  text-align: left; border: none; border-left: 4px solid var(--c, var(--primary)); background: var(--bg, var(--soft));
  border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; min-height: 64px; font-size: 13px;
}
.turma-celula:hover { filter: brightness(.96); }
.turma-celula b { font-weight: 600; color: var(--tx, var(--dark)); }
.turma-celula span { color: #3e4b51; }
.turma-celula .tem-vaga { color: var(--ok-tx); font-weight: 600; }
.turma-celula.selecionada { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--c, var(--primary)); }
.turma-celula.cancelada { opacity: .55; text-decoration: line-through; }
.turma-celula.feriado { opacity: .6; background: repeating-linear-gradient(135deg, var(--bg, var(--soft)), var(--bg, var(--soft)) 8px, #fff 8px, #fff 12px); }
.dia-feriado { display: block; font-size: 11px; font-weight: 600; letter-spacing: .5px; color: var(--erro-tx); }

.chamada-aluno { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); }
.chamada-aluno.reposicao { background: var(--soft); }
.chamada-aluno .topo { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.chamada-aluno .topo div { display: flex; flex-direction: column; min-width: 0; }
.chamada-aluno .topo b { font-size: 15px; font-weight: 500; }
.chamada-aluno .topo span { font-size: 12px; color: var(--muted); }
.botoes-presenca { display: flex; gap: 8px; }
.botoes-presenca button { flex: 1; min-height: 44px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; font-size: 14px; }
.botoes-presenca button[aria-pressed="true"].presente { background: var(--ok); border-color: var(--ok); color: #fff; font-weight: 500; }
.botoes-presenca button[aria-pressed="true"].falta { background: var(--erro); border-color: var(--erro); color: #fff; font-weight: 500; }
.nota { font-size: 12px; color: #1f5f63; background: var(--primary-suave); border-radius: 10px; padding: 8px 10px; }
.trancado-linha svg { width: 18px; height: 18px; flex-shrink: 0; }
.trancado-linha { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; border: 1.5px dashed var(--line); color: var(--muted); font-size: 13px; }

/* ---------- Janela (modal) ---------- */
.janela-fundo { position: fixed; inset: 0; background: rgba(28, 41, 48, .5); display: grid; place-items: center; padding: 16px; z-index: 50; }
.janela { width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow-y: auto; background: #fff; border-radius: 20px; padding: 24px; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 30px 60px rgba(0,0,0,.25); }
.janela-topo { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.janela-topo h2 { font-size: 19px; font-weight: 600; color: var(--navy); }
.janela-rodape { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding-top: 4px; }
.fechar { width: 44px; height: 44px; border-radius: 50%; border: none; background: var(--soft); cursor: pointer; display: grid; place-items: center; }

.turmas-escolha { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.turma-opcao { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--line); cursor: pointer; font-size: 13px; }
.turma-opcao input { position: absolute; opacity: 0; pointer-events: none; }
.turma-opcao:has(input:checked) { border-color: var(--primary); background: var(--primary-suave); }
.turma-opcao:has(input:focus-visible) { outline: 3px solid var(--secondary); }
.turma-opcao.lotada { opacity: .5; cursor: not-allowed; }
.turma-opcao b { font-weight: 500; }
.turma-opcao span { color: var(--muted); font-size: 12px; }
.resumo-valor { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 14px; background: var(--primary-suave); font-size: 14px; }
.resumo-valor b { font-size: 20px; color: var(--primary-escuro); }

/* ---------- Receber ---------- */
.receber { max-width: 560px; width: 100%; display: flex; flex-direction: column; gap: 14px; }
.valor-grande { display: flex; align-items: center; gap: 8px; background: var(--soft); border-radius: 12px; padding: 0 14px; min-height: 56px; border: 2px solid var(--primary); }
.valor-grande span { font-size: 18px; color: var(--muted); }
.valor-grande input { border: none; outline: none; background: transparent; font-size: 24px; font-weight: 600; width: 100%; min-height: 52px; }
.sucesso { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 32px 16px; }
.sucesso .circulo { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); display: grid; place-items: center; }

/* ---------- Avisos rápidos ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--dark); color: #fff; padding: 12px 20px; border-radius: 50px; font-size: 14px; z-index: 80; box-shadow: var(--sombra); max-width: calc(100vw - 32px); }
.toast.erro { background: var(--erro-tx); }
.carregando { display: grid; place-items: center; padding: 48px; color: var(--muted); font-size: 14px; }
.carregando::before { content: ""; width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--primary); animation: girar 0.8s linear infinite; margin-bottom: 10px; }
@keyframes girar { to { transform: rotate(360deg); } }

/* ---------- Celular ---------- */
@media (max-width: 900px) {
  .app { flex-direction: column; }
  .barra-celular {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    background: var(--gradiente); color: #fff; padding: 10px 12px 10px 16px; position: sticky; top: 0; z-index: 30;
  }
  .barra-celular img { height: 36px; }
  .barra-celular button { width: 44px; height: 44px; border-radius: 12px; border: none; background: rgba(255,255,255,.14); color: #fff; display: grid; place-items: center; cursor: pointer; }
  .menu { position: fixed; inset: 0 auto 0 0; width: 280px; max-width: 85vw; z-index: 40; transform: translateX(-100%); transition: transform .2s; height: 100vh; }
  .menu.aberto { transform: none; box-shadow: 0 0 0 100vmax rgba(28,41,48,.45); }
  .menu-logo { display: none; }
  .conteudo { padding: 20px 16px 48px; gap: 18px; }
  .cabecalho h1 { font-size: 24px; }
  .indicador .valor { font-size: 26px; }
  .cartao { padding: 18px; }
  .janela { padding: 20px 16px; border-radius: 18px; }
}

/* ---------- Linhas de mensalidade (início) ---------- */
.linha-mens { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); }
.linha-mens .quem { flex: 1 1 180px; display: flex; flex-direction: column; min-width: 0; }
.linha-mens .quem b { font-size: 15px; font-weight: 500; }
.linha-mens .quem span { font-size: 13px; color: var(--muted); }
.linha-mens .valor { font-weight: 500; white-space: nowrap; }
.linha-mens .lado { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------- Alunos em cartões no celular ---------- */
.alunos-cartoes { display: none; }
@media (max-width: 760px) {
  .alunos-tabela { display: none; }
  .alunos-cartoes { display: flex; flex-direction: column; gap: 10px; }
}

/* ---------- Fechamento ---------- */
.mes-nav { display: flex; align-items: center; gap: 12px; }
.mes-nav b { font-size: 18px; font-weight: 500; color: var(--navy); min-width: 170px; text-align: center; }
a.linha-fech { text-decoration: none; color: inherit; }
a.linha-fech:hover { border-color: var(--primary); }
.linha-fech .lado svg { width: 18px; height: 18px; color: var(--muted); }
.saldo-ok { color: var(--ok-tx); }
.saldo-erro { color: var(--erro-tx); }
.resumo-fech dl { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.resumo-fech dl div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; font-size: 15px; }
.resumo-fech dt span { display: block; font-size: 12px; color: var(--muted); }
.resumo-fech dd { margin: 0; white-space: nowrap; font-weight: 500; }
.saldo-final { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 16px; padding: 14px 16px; border-radius: 14px; background: var(--soft); }
.saldo-final span { font-size: 13px; color: var(--muted); }
.saldo-final b { font-size: 20px; font-weight: 600; }
.nota-fech { font-size: 13px; color: var(--muted); }
.acoes-fech { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.itens-fech { display: flex; flex-direction: column; }
.item-fech { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.item-fech:first-child { border-top: none; padding-top: 0; }
.item-fech .quem { flex: 1 1 220px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.item-fech .quem b { font-size: 15px; font-weight: 500; }
.item-fech .quem span { font-size: 13px; color: var(--muted); }
.item-fech .conta { font-size: 13px; color: var(--muted); white-space: nowrap; }
.item-fech .valor { font-weight: 500; white-space: nowrap; min-width: 96px; text-align: right; }
@media (max-width: 760px) {
  .acoes-fech .btn { flex: 1 1 auto; }
  .item-fech .valor { margin-left: auto; }
}

/* ---------- Agenda ---------- */
.filtro-prof { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 50px; border: 1px solid var(--line); background: #fff; font: inherit; font-size: 13px; color: var(--dark); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--primary-suave); border-color: var(--primary); color: var(--primary-escuro); font-weight: 500; }
.ag-semana { display: grid; grid-template-columns: repeat(var(--dias), minmax(0, 1fr)); gap: 10px; }
.ag-dia { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 8px; border-radius: 14px; background: var(--soft); }
.ag-dia.hoje { background: var(--primary-suave); }
.ag-dia.feriado { background: repeating-linear-gradient(135deg, var(--soft) 0 10px, #eef2f3 10px 20px); }
.ag-dia-topo { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; padding: 2px 4px; }
.ag-dia-topo b { font-size: 14px; font-weight: 600; color: var(--navy); }
.ag-dia-topo span { font-size: 12px; color: var(--muted); }
.ag-evento { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left; padding: 8px 10px; border-radius: 10px; border: none; border-left: 4px solid var(--c); background: #fff; font: inherit; color: var(--dark); cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.ag-evento:hover { background: var(--bg); }
.ag-evento b { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.ag-evento > span { font-size: 12px; color: var(--muted); }
.ag-evento .ag-hora { font-weight: 600; color: var(--tx); }
.ag-evento .ag-linha { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.ag-evento .ag-extra { font-size: 12px; color: var(--muted); }
.ag-evento .ag-aviso { color: var(--alerta-tx); font-weight: 500; }
.ag-evento.st-cancelado, .ag-evento.st-faltou { opacity: .6; }
.ag-evento.st-cancelado b { text-decoration: line-through; }
.ag-evento.pendente { box-shadow: 0 0 0 2px var(--accent) inset; }
.ag-vazio { font-size: 12px; color: var(--muted); padding: 6px 4px; }
.ag-mais { align-self: stretch; min-height: 34px; border: 1px dashed var(--line); background: transparent; border-radius: 10px; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.ag-mais svg { width: 16px; height: 16px; }
.ag-mais:hover { border-color: var(--primary); color: var(--primary); }
.escolhas-pequenas { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.escolhas-pequenas .turma-opcao { position: relative; cursor: pointer; }
.paciente-sel { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--primary-suave); }
.paciente-sel b { font-weight: 500; }
.busca-paciente { display: flex; flex-direction: column; gap: 8px; }
.busca-paciente input { min-height: 48px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--soft); font: inherit; font-size: 15px; }
.resultados { display: flex; flex-direction: column; gap: 4px; }
.resultados button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font: inherit; text-align: left; cursor: pointer; }
.resultados button:hover, .resultados button:focus-visible { border-color: var(--primary); background: var(--primary-suave); }
.resultados button b { font-size: 14px; font-weight: 500; }
.resultados button span, .resultados .nada { font-size: 12px; color: var(--muted); }
@media (max-width: 900px) {
  .ag-semana { grid-template-columns: 1fr; }
  .ag-dia:not(.hoje):has(.ag-vazio) { padding-block: 4px; }
}

/* ---------- Pacientes e prontuário ---------- */
.dados { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.dados div { display: flex; flex-direction: column; gap: 2px; }
.dados dt { font-size: 12px; color: var(--muted); }
.dados dd { margin: 0; font-size: 15px; white-space: pre-line; overflow-wrap: anywhere; }
.subtitulo { margin: 4px 0 0; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.barra-pacote { display: block; height: 6px; border-radius: 6px; background: var(--soft); margin-top: 6px; overflow: hidden; max-width: 260px; }
.barra-pacote i { display: block; height: 100%; background: var(--primary); border-radius: 6px; }
.secao-anamnese { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.secao-anamnese h3 { margin: 0; font-size: 14px; font-weight: 600; color: var(--navy); }
.versoes summary { cursor: pointer; font-size: 13px; color: var(--primary); }
.versoes .lista { margin-top: 8px; align-items: flex-start; }
.evolucoes { display: flex; flex-direction: column; gap: 12px; }
.evolucao { padding: 12px 14px; border-radius: 12px; background: var(--soft); }
.evolucao header { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.evolucao header b { font-size: 14px; font-weight: 600; color: var(--navy); }
.evolucao header span { font-size: 12px; color: var(--muted); }
.evolucao p { margin: 6px 0 0; font-size: 14px; white-space: pre-line; overflow-wrap: anywhere; }
.secao-form { border: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.secao-form legend { font-size: 14px; font-weight: 600; color: var(--navy); margin-bottom: 4px; }
.janela.janela-larga { max-width: 760px; }

.lista-simples { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); }
.lista-simples b { color: var(--dark); font-weight: 500; }
.ag-compromisso { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left; padding: 8px 10px; border-radius: 10px; border: 1.5px dashed var(--c, var(--line)); background: #fff; font: inherit; color: var(--dark); cursor: pointer; }
.ag-compromisso:hover { background: var(--bg, var(--soft)); }
.ag-compromisso b { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.ag-compromisso > span { font-size: 12px; color: var(--muted); }
.ag-compromisso .ag-hora { font-weight: 600; color: var(--tx, var(--navy)); }
.ag-google { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); }

/* ---------- Meu link de agendamento ---------- */
.link-grade { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 16px; align-items: start; }
.link-destaque { grid-column: 1 / -1; }
.link-copiar { display: flex; gap: 10px; }
.link-copiar input { flex: 1; min-width: 0; min-height: 44px; border: 1.5px solid var(--line); border-radius: 50px; padding: 0 16px; background: var(--soft); color: var(--navy); font-weight: 500; }
.link-passos { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
.link-passos li.feito { color: var(--ok-tx); }
.link-passos li.feito::after { content: " ✓"; }
.link-passos b { font-weight: 500; color: var(--dark); }
.link-passos li.feito b { color: inherit; }
.link-ajuda { margin: -6px 0 0; font-size: 13px; color: var(--muted); }
.link-lista { display: flex; flex-direction: column; gap: 8px; }
.link-item { position: relative; display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 12px 44px 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; font: inherit; color: var(--dark); cursor: pointer; }
.link-item:hover { border-color: var(--primary); }
.link-item b { font-weight: 500; font-size: 14px; }
.link-item span { font-size: 13px; color: var(--muted); }
.link-item > svg { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.link-item.inativo { opacity: .6; }
.link-item.estatico { cursor: default; padding-right: 14px; }
.link-item.estatico:hover { border-color: var(--line); }
.link-item.estatico .btn { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
.link-item.estatico:has(.btn) { padding-right: 110px; }
.link-dias { display: flex; flex-direction: column; }
.link-dia { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.link-dia:first-child { border-top: 0; }
.link-dia-nome { width: 72px; font-size: 14px; font-weight: 500; }
.link-faixas { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.link-faixas:empty::before { content: "Não atende"; font-size: 13px; color: var(--muted); align-self: center; }
.link-faixa { display: inline-flex; align-items: center; gap: 4px; background: var(--primary-suave); border-radius: 50px; padding: 3px 4px 3px 10px; }
.link-faixa input { border: 0; background: transparent; font-size: 14px; color: var(--navy); width: 108px; min-height: 32px; }
.link-faixa > span { color: var(--muted); }
.link-x { width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.link-x:hover { background: #fff; color: var(--erro-tx); }
.link-x svg { width: 14px; height: 14px; }
.link-add { width: 36px; padding: 0; }
.link-slug { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: var(--raio-campo); background: var(--soft); overflow: hidden; }
.link-slug span { padding: 0 2px 0 12px; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; }
.link-slug input { flex: 1; min-width: 0; border: 0 !important; background: #fff !important; border-radius: 0 !important; }
.link-check { display: flex; gap: 10px; align-items: center; font-size: 14px; min-height: 44px; cursor: pointer; }
.link-check input { width: 20px; height: 20px; accent-color: var(--primary); }
.form-janela { display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 600px) {
  .link-copiar { flex-direction: column; }
  .link-dia-nome { width: 100%; }
}

/* ---------- Lembretes de WhatsApp ---------- */
.lem-grade { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 16px; align-items: start; }
.lem-lista { display: flex; flex-direction: column; gap: 8px; }
.lem-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.lem-item.feito { background: var(--soft); }
.lem-item .textos { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lem-item .textos b { font-weight: 500; font-size: 14px; }
.lem-item .textos span { font-size: 12px; color: var(--muted); }
.lem-hora { font-weight: 600; color: var(--navy); font-size: 15px; min-width: 44px; }
.lem-item .etiqueta svg { width: 12px; height: 12px; vertical-align: -1px; }

/* ---------- Painel da TV (tela da recepção) ---------- */
.tvc-salas { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 14px; }
.tvc-sala { border: 1px solid var(--line); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.tvc-sala-topo { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tvc-sala-topo b { font-size: 15px; margin-right: auto; }
.tvc-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--soft); }
.tvc-item.chamado { background: #fdeee7; }
.tvc-item.feito { opacity: .55; }
.tvc-item .textos { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tvc-item .textos b { font-weight: 500; font-size: 14px; }
.tvc-item .textos span { font-size: 12px; color: var(--muted); }
.tvc-escolher-sala { max-width: 160px; padding: 6px 8px; border: 1px solid var(--line, #d8e2e4); border-radius: 10px; font: inherit; font-size: 13px; background: #fff; }
.tvc-hora { font-weight: 600; color: var(--navy); min-width: 44px; }
.tvc-cfg-sala { display: grid; grid-template-columns: 1fr 1.4fr 64px; gap: 8px; align-items: center; }
.tvc-cfg-sala input:not([type=checkbox]) { min-height: 40px; border: 1.5px solid var(--line); border-radius: var(--raio-campo); padding: 0 10px; font: inherit; }
@media (max-width: 600px) { .tvc-cfg-sala { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .tvc-item { flex-wrap: wrap; } .tvc-item .btn { margin-left: 54px; } }

/* ---------- Cursos ---------- */
.cur-titulo-secao { font-size: 18px; font-weight: 500; margin: 28px 0 12px; color: var(--navy); }
.cur-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.cur-card { display: flex; flex-direction: column; gap: 14px; }
.cur-card-topo { display: flex; gap: 14px; align-items: flex-start; }
.cur-card-topo .textos { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cur-card-topo h3 { margin: 0; font-size: 16px; font-weight: 500; line-height: 1.3; }
.cur-card-topo .sub { font-size: 13px; color: var(--muted); }
.cur-img { width: 96px; height: 64px; border-radius: 12px; object-fit: cover; flex-shrink: 0; background: var(--soft); }
.cur-img.vazia { display: grid; place-items: center; background: var(--c, var(--primary)); color: #fff; opacity: .85; }
.cur-img.vazia svg { width: 28px; height: 28px; }
.cur-linha { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cur-cat { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 99px; background: var(--cbg); color: var(--c); }
.cur-cat::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.cur-turmas { display: flex; flex-direction: column; gap: 8px; }
.cur-turma { display: grid; grid-template-columns: auto 1fr; gap: 0 10px; padding: 10px 12px; border-radius: 12px; background: var(--soft); color: inherit; text-decoration: none; font-size: 13px; }
.cur-turma b { grid-row: span 2; font-weight: 500; font-size: 14px; align-self: center; }
.cur-turma span { color: var(--muted); }
.cur-turma:hover { background: var(--primary-suave); }
.cur-turma.cancelada { opacity: .55; }
.cur-proximas { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.cur-proxima { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); color: inherit; text-decoration: none; }
.cur-proxima:hover { border-color: var(--c); }
.cur-proxima .textos { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cur-proxima .textos b { font-weight: 500; font-size: 14px; }
.cur-proxima .textos span { font-size: 12px; color: var(--muted); }
.cur-proxima > svg { width: 18px; height: 18px; color: var(--muted); }
.cur-data { width: 48px; height: 52px; border-radius: 12px; background: var(--cbg); color: var(--c); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11px; text-transform: uppercase; flex-shrink: 0; }
.cur-data b { font-size: 20px; line-height: 1; }
.cur-inativos { margin-top: 20px; }
.cur-inativos summary { cursor: pointer; color: var(--muted); padding: 8px 0; }
.cur-legenda { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.cur-itens { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.cur-img-campo { display: flex; gap: 8px; align-items: center; }
.cur-img-campo input { flex: 1; min-width: 0; }
.cur-mods { display: flex; flex-direction: column; gap: 8px; }
.cur-mod { display: grid; grid-template-columns: 74px 1fr 1fr 76px 36px; gap: 8px; align-items: center; }
.cur-mod input { min-height: 40px; border: 1.5px solid var(--line); border-radius: var(--raio-campo); padding: 0 8px; font: inherit; min-width: 0; }
.cur-mod-n { font-size: 13px; font-weight: 500; }
.cur-mod-dia { font-size: 12px; color: var(--muted); }
.cur-voltar { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; }
.cur-voltar svg { width: 14px; height: 14px; }
.cur-encontros { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.cur-encontro { padding: 12px 14px; border-radius: 14px; background: var(--soft); display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.cur-encontro b { font-weight: 500; font-size: 14px; }
.cur-encontro span { color: var(--muted); }
.cur-encontro.passou { opacity: .7; }
.cur-encontro.agora { background: var(--primary-suave); }
.cur-encontro .link-botao { align-self: flex-start; padding: 4px 0; min-height: 0; font-size: 13px; }
.cur-tabela .link-botao.nome { padding: 0; min-height: 0; font-weight: 500; text-decoration: none; color: var(--dark); text-align: left; font-size: 14px; }
.cur-tabela .link-botao.nome:hover { color: var(--primary); text-decoration: underline; }
.cur-pres-th { text-align: center !important; }
.cur-pres-td { text-align: center; padding: 6px !important; }
.cur-pres { width: 36px; height: 36px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; display: inline-grid; place-items: center; }
.cur-pres.p { background: var(--ok-bg); border-color: #b8dfc9; color: var(--ok-tx); }
.cur-pres.f { background: var(--erro-bg); border-color: #f3cdbb; color: var(--erro-tx); }
.cur-pres.fixa { cursor: default; }
.cur-baixa { color: var(--erro-tx); font-weight: 600; }
.cur-valor { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 14px; border-radius: 12px; background: var(--soft); }
.cur-valor b { font-size: 18px; }
.cur-parcelas { display: flex; flex-direction: column; gap: 6px; }
.cur-codigo { width: 100%; font: 12px/1.5 ui-monospace, Menlo, monospace; border: 1.5px solid var(--line); border-radius: var(--raio-campo); padding: 10px; resize: none; margin: 8px 0; background: var(--soft); }
@media (max-width: 600px) {
  .cur-grade { grid-template-columns: 1fr; }
  .cur-mod { grid-template-columns: 1fr 1fr 36px; }
  .cur-mod-n { grid-column: 1 / -1; }
  .cur-mod-dia { display: none; }
}
.cur-pre { border-color: #ecd9a6; margin-bottom: 16px; }
.cur-dados { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--soft); font-size: 13px; color: var(--muted); }
.cur-dados b { font-size: 15px; color: var(--dark); font-weight: 500; }
.cur-nf { font-weight: 400 !important; font-size: 13px; line-height: 1.6; }
.janela > * { flex-shrink: 0; }
.cur-mod .link-x:hover { background: var(--erro-bg); }
