/* CELULAR_V1 (01/12/2026, direção B escolhida pelo Matheus): no celular (até 767 px) a navegação vira uma barra fixa embaixo
   com Início, Seletivas, Chats, Prévias e Mais (Mais abre a gaveta que já existe, com o resto). No computador nada muda. */
#rpBarraCel{display:none}
@media (max-width:767px){
  /* z-index abaixo das janelas (9000+) para não cobrir os botões de salvar delas; a gaveta (12001) fica acima */
  #rpBarraCel{position:fixed;left:0;right:0;bottom:0;z-index:8000;display:grid;grid-template-columns:repeat(var(--rp-itens,5),minmax(0,1fr));
    height:calc(64px + env(safe-area-inset-bottom,0px));padding-bottom:env(safe-area-inset-bottom,0px);box-sizing:border-box;
    background:#070a10;border-top:1px solid var(--divider,#1a2130)}
  #rpBarraCel button{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-height:44px;
    border:0;background:transparent;color:#7d879b;font:600 11px/1.1 Inter,system-ui,sans-serif;cursor:pointer;-webkit-tap-highlight-color:transparent}
  #rpBarraCel button svg{width:22px;height:22px}
  #rpBarraCel button:active{transform:scale(.96)}
  #rpBarraCel button[aria-current="page"]{color:#dbe4ff}
  #rpBarraCel button[aria-current="page"]::before{content:"";position:absolute;top:0;left:50%;width:28px;height:2px;margin-left:-14px;border-radius:2px;background:var(--accent,#3461d1)}
  #rpBarraCel .rp-cel-badge{position:absolute;top:6px;left:50%;margin-left:6px;min-width:16px;height:16px;padding:0 4px;box-sizing:border-box;border-radius:8px;
    background:#e5484d;color:#fff;font:700 10px/16px ui-monospace,SFMono-Regular,Menlo,monospace;text-align:center}
  #rpBarraCel .rp-cel-badge[hidden],#rpBarraCel button[hidden]{display:none}
  #rpBarraCel[hidden]{display:none!important}
  /* a área do painel termina acima da barra (antes ocupava 100dvh e a barra cobriria o fim das telas) */
  html body .app-main{height:calc(100dvh - 64px - env(safe-area-inset-bottom,0px))!important}
  /* o botão ☰ do topo sai: o menu agora abre pelo "Mais" da barra */
  .rp-mobile-menu{display:none!important}
  /* CHATS_DUAS_TELAS_V1: no celular, a lista ocupa a tela; ao tocar num contato, a conversa ocupa a tela com "Voltar" */
  #chatsView #chatsList,#chatsView #chatsThreadPane{width:100%!important;max-width:none!important;min-width:0!important;flex:1 1 auto!important;height:100%!important;max-height:none!important;margin:0!important}
  body:not(.rp-cel-chat-aberto) #chatsView #chatsThreadPane{display:none!important}
  body.rp-cel-chat-aberto #chatsView #chatsList{display:none!important}
  body.rp-cel-chat-aberto #chatsView #chatsThreadPane{display:flex!important;flex-direction:column!important}
  #rpCelVoltarChat{display:flex;align-items:center;gap:6px;flex:0 0 auto;height:44px;padding:0 12px 0 6px;border:0;border-bottom:1px solid var(--divider,#1a2130);
    background:transparent;color:var(--text-primary,#e8ecf4);font:600 14px Inter,system-ui,sans-serif;cursor:pointer;text-align:left}
  #rpCelVoltarChat svg{width:20px;height:20px}
  /* cabeçalho da conversa: botões e etiqueta da entrevista quebram linha em vez de sair da tela */
  #chatsThreadHeader .chat-thread-actions{width:100%!important;max-width:100%!important;flex:1 1 100%!important;box-sizing:border-box!important;flex-wrap:wrap!important;justify-content:flex-start!important}
  #chatsThreadHeader .chat-thread-pair{flex-wrap:wrap!important;row-gap:8px!important;min-width:0!important;max-width:100%!important;justify-content:flex-start!important}
  #chatsThreadHeader .chat-thread-interview{min-width:0!important;max-width:100%!important}
}
/* PLANILHA_CARTOES_V1 (fase 3): Candidatos e Controle do bot viram uma lista de cartões no celular (sem rolagem para o lado).
   Nome em destaque, cada campo com o nome da coluna acima; o "×" de apagar fica no canto; editar continua com toque duplo. */
@media (max-width:767px){
  .table-wrap{overflow-x:hidden!important}
  #grid,#grid tbody{display:block!important;width:100%!important;min-width:0!important;max-width:100%!important;zoom:1!important;table-layout:auto!important}
  #grid thead{display:none!important}
  #grid tr{display:flex!important;flex-direction:column!important;gap:6px;position:relative;width:100%!important;box-sizing:border-box;
    padding:12px 56px 12px 16px!important;border-bottom:1px solid var(--divider,#1a2130)!important;height:auto!important}
  #grid td{display:block!important;position:static!important;width:auto!important;min-width:0!important;max-width:100%!important;height:auto!important;
    max-height:none!important;padding:2px 6px!important;margin:0!important;border:0!important;border-radius:6px;white-space:normal!important;
    overflow-wrap:anywhere;text-align:left!important;font-size:14px;line-height:1.4;box-shadow:none!important}
  #grid td.num-col{display:none!important}
  #grid td.actions-col{display:contents!important}
  #grid td.actions-col .del-btn{position:absolute;top:8px;right:6px;width:44px;height:44px;font-size:20px}
  #grid tr{padding-bottom:56px!important}
  #grid tr.skeleton-row{padding-bottom:12px!important}
  /* fundo neutro nos campos (o verde/amarelo da linha deixava os rótulos ilegíveis); a etapa vira etiqueta colorida */
  #grid td{background:transparent!important;color:inherit!important}
  #grid tr.row-confirmed td[data-col="Etapa"],#grid tr.row-confirmed td[data-col="Status"]{color:#7fd7a9!important}
  #grid tr.row-waiting td[data-col="Etapa"],#grid tr.row-waiting td[data-col="Status"]{color:#f2c674!important}
  #grid tr.row-cancelled td[data-col="Etapa"],#grid tr.row-cancelled td[data-col="Status"]{color:#f08a8d!important}
  /* fechado: só o essencial; "Ver todos os campos" abre o resto do cartão */
  #grid tr:not(.rp-aberto) td[data-col]:not([data-col="Nome (parcial)"]):not([data-col="NomeCompleto"]):not([data-col="Telefone"]):not([data-col="Etapa"]):not([data-col="Status"]):not([data-col="Dia Oferecido"]):not([data-col="Entrevista Online"]):not([data-col="ReuniaoAgendada"]){display:none!important}
  #grid .rp-cel-mais{display:flex!important;position:absolute;left:10px;bottom:6px;align-items:center;gap:4px;height:44px;padding:0 6px;border:0;background:transparent;
    color:#7f9cf0;font:600 13px Inter,system-ui,sans-serif;cursor:pointer}
  #grid td[data-col]::before{content:attr(data-col);display:block;font-size:11px;font-weight:600;color:var(--text-muted,#8b94a8);margin-bottom:1px;letter-spacing:.01em}
  #grid td[data-col="NomeCompleto"]::before{content:"Nome completo"}
  #grid td[data-col="ReuniaoAgendada"]::before{content:"Reunião agendada"}
  #grid td[data-col="DataHoraContato"]::before{content:"Data do contato"}
  #grid td[data-col="CurriculoDescricao"]::before{content:"Currículo"}
  #grid td[data-col="Observacoes"]::before{content:"Observações"}  #grid td[data-col="Nome (parcial)"],#grid td[data-col="NomeCompleto"]{order:-1;font-size:16px;font-weight:700}
  #grid td[data-col="Nome (parcial)"]::before,#grid td[data-col="NomeCompleto"]::before{display:none}
  #grid td[data-col]:empty::after{content:"—";color:var(--text-muted,#8b94a8)}
  #grid tr.skeleton-row td{min-height:14px}
}
#grid .rp-cel-mais{display:none}
/* SELETIVAS_LINHA_GESTORES_V1 (02/12/2026, pedido do Matheus: "como no /gestores do celular"): linha compacta por candidato —
   nome em negrito, telefone pequeno, botões baixos (36 px, 13 px) lado a lado, sem rótulos "Presença"/"Acompanhamento"
   e sem a caixa escura por dentro. Só celular. */
@media (max-width:767px){
  html body #planilhaView.sessoes-active #sesLista .ses-fixa tr{padding:12px 14px!important;background:transparent!important;box-shadow:none!important}
  html body #planilhaView.sessoes-active #sesLista .ses-fixa td{padding:2px 0!important;background:transparent!important;box-shadow:none!important}
  html body #planilhaView.sessoes-active #sesLista .ses-fixa td:nth-child(3),
  html body #planilhaView.sessoes-active #sesLista .ses-fixa td:nth-child(4){padding-top:8px!important}
  html body #planilhaView.sessoes-active #sesLista .ses-fixa td:nth-child(3)::before,
  html body #planilhaView.sessoes-active #sesLista .ses-fixa td:nth-child(4)::before{content:none!important;display:none!important}
  html body #planilhaView.sessoes-active #sesLista .ses-fixa .ses-nome{font-size:15px!important;font-weight:600!important;line-height:1.3!important}
  html body #planilhaView.sessoes-active #sesLista .ses-fixa .ses-phone-copy{font-size:12px!important;color:var(--text-muted,#8b94a8)!important;text-decoration:none!important;border-bottom:0!important}
  html body #planilhaView.sessoes-active #sesLista .ses-fixa .ses-pres-wrap,
  html body #planilhaView.sessoes-active #sesLista .ses-fixa .ses-acomp,
  html body #planilhaView.sessoes-active #sesLista .ses-fixa .ses-toggle,
  html body #planilhaView.sessoes-active #sesLista .ses-fixa .ses-toggle-sel{gap:6px!important}
  html body #planilhaView.sessoes-active #sesLista .ses-fixa .ses-pb,
  html body #planilhaView.sessoes-active #sesLista .ses-fixa .ses-ac{font-size:13px!important;height:36px!important;min-height:36px!important;padding:0 11px!important;border-radius:7px!important;line-height:1.2!important}
}
/* SELETIVAS_BARRA_CEL_V1 (02/12/2026, pedido do Matheus pelo print do celular): a linha "+ Adicionar manualmente", lupa e imprimir
   ficava sozinha, alinhada à direita, com botões altos, encostando na borda e deixando um vão grande. No celular:
   linha 1 = ‹ data › + três ícones de 40 px ("Adicionar" vira "+"); linha 2 = Presencial/Online na largura toda. Computador sem mudança. */
@media (max-width:767px){
  html body #planilhaView.sessoes-active #sessoesDia.ses-toolbar-v88 .ses-head{display:flex!important;flex-wrap:wrap!important;align-items:center!important;gap:8px 6px!important;margin-bottom:8px!important}
  html body #planilhaView.sessoes-active #sessoesDia.ses-toolbar-v88 .ses-head .ses-date,
  html body #planilhaView.sessoes-active #sessoesDia.ses-toolbar-v88 .ses-head .ses-tools-r,
  html body #planilhaView.sessoes-active #sessoesDia.ses-toolbar-v88 .ses-head .ses-actions{display:contents!important}
  html body #planilhaView.sessoes-active #sessoesDia.ses-toolbar-v88 #sesPrev{order:1!important}
  html body #planilhaView.sessoes-active #sessoesDia.ses-toolbar-v88 #sesCalWrap{order:2!important;flex:1 1 0%!important;min-width:0!important;width:auto!important}
  html body #planilhaView.sessoes-active #sessoesDia.ses-toolbar-v88 #sesData{width:100%!important;min-width:0!important;max-width:none!important;height:36px!important;box-sizing:border-box!important;padding:0 4px!important;font-size:14px!important;text-align:center!important}
  html body #planilhaView.sessoes-active #sessoesDia.ses-toolbar-v88 #sesNext{order:3!important}
  html body #planilhaView.sessoes-active #sessoesDia.ses-toolbar-v88 #sesManualAbrir{order:4!important}
  html body #planilhaView.sessoes-active #sessoesDia.ses-toolbar-v88 #sesBusca{order:5!important;flex:0 0 auto!important;margin:0!important}
  html body #planilhaView.sessoes-active #sessoesDia.ses-toolbar-v88 #sesImprimir{order:6!important}
  html body #planilhaView.sessoes-active #sessoesDia.ses-toolbar-v88 #sesModalidadeToolbarV88{order:7!important;flex:1 1 100%!important;margin:0!important}
  html body #planilhaView.sessoes-active #sessoesDia.ses-toolbar-v88 #sesManual{order:8!important;flex:1 1 100%!important}
  html body #planilhaView.sessoes-active #sessoesDia.ses-toolbar-v88 #sesPrev,
  html body #planilhaView.sessoes-active #sessoesDia.ses-toolbar-v88 #sesNext,
  html body #planilhaView.sessoes-active #sessoesDia.ses-toolbar-v88 #sesManualAbrir,
  html body #planilhaView.sessoes-active #sessoesDia.ses-toolbar-v88 #sesBuscaAbrir,
  html body #planilhaView.sessoes-active #sessoesDia.ses-toolbar-v88 #sesImprimir{width:36px!important;min-width:36px!important;height:36px!important;min-height:36px!important;padding:0!important;margin:0!important;flex:0 0 36px!important;box-sizing:border-box!important;justify-content:center!important;align-items:center!important}
  /* "+ Adicionar manualmente" vira "+" (o texto continua para leitor de tela); o display fica com o JS, que esconde o botão para quem não pode adicionar */
  html body #planilhaView.sessoes-active #sessoesDia.ses-toolbar-v88 #sesManualAbrir{font-size:0!important;line-height:0!important}
  html body #planilhaView.sessoes-active #sessoesDia.ses-toolbar-v88 #sesManualAbrir::before{content:"+";font-size:22px;line-height:1;font-weight:500}
  html body #planilhaView.sessoes-active #sessoesDia.ses-toolbar-v88 #sesModalidadeToolbarV88 .ses-mode-toggle{width:100%!important;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html body #planilhaView.sessoes-active #sessoesDia.ses-toolbar-v88 #sesModalidadeToolbarV88 .ses-mode-btn{height:36px!important;min-height:36px!important;justify-content:center!important}
}
/* FASE5_V1: Usuários em cartões no celular */
@media (max-width:767px){
  #usersView table,#usersView tbody{display:block!important;width:100%!important;min-width:0!important}
  #usersView thead{display:none!important}
  #usersView tbody tr{display:flex!important;flex-wrap:wrap;gap:8px 16px;padding:12px 16px!important;border-bottom:1px solid var(--divider,#1a2130)!important}
  #usersView tbody td{display:block!important;padding:0!important;border:0!important;width:auto!important;min-width:0!important;flex:1 1 40%;font-size:13px}
  #usersView tbody td:nth-child(1){flex:1 1 100%;font-size:15px;font-weight:700}
  #usersView tbody td:nth-child(6){flex:1 1 100%}
  #usersView tbody td:nth-child(6) button{min-height:40px}
  #usersView tbody td:nth-child(2)::before{content:"Tipo de acesso"}
  #usersView tbody td:nth-child(3)::before{content:"Cliente"}
  #usersView tbody td:nth-child(4)::before{content:"Status"}
  #usersView tbody td:nth-child(5)::before{content:"Criado em"}
  #usersView tbody td:nth-child(n+2):nth-child(-n+5)::before{display:block;font-size:11px;font-weight:600;color:var(--text-muted,#8b94a8);margin-bottom:2px}
  #usersView .users-head{flex-shrink:0!important;height:auto!important}
  #usersView .users-head-acoes{width:100%!important}
  #usersView .table-wrap{flex:1 1 auto!important;min-height:0!important}
  #usersView tbody td[colspan]{flex:1 1 100%}
  #usersView tbody td[colspan]::before{display:none!important;content:none!important}
}
/* PREVIAS_UMA_ETAPA_V1 (fase 4): uma etapa por vez no celular, pílulas no topo e "Mover" em cada cartão */
#rpCelEtapas,.rp-cel-mover{display:none}
#rpCelFolha{position:fixed;inset:0;z-index:12500;display:flex;align-items:flex-end;background:rgba(2,4,8,.6)}
#rpCelFolha[hidden]{display:none}
#rpCelFolha .rp-cel-folha-painel{width:100%;box-sizing:border-box;max-height:80dvh;overflow:auto;background:var(--bg-elevated,#0b0f17);border-top:1px solid #222a3b;
  border-radius:16px 16px 0 0;padding:8px 16px calc(16px + env(safe-area-inset-bottom,0px));display:flex;flex-direction:column;gap:2px;font-family:Inter,system-ui,sans-serif;color:var(--text-primary,#e8ecf4)}
#rpCelFolha .rp-cel-folha-alca{align-self:center;width:40px;height:4px;border-radius:2px;background:#2a3246;margin-bottom:8px}
#rpCelFolha .rp-cel-folha-titulo{font-size:16px;font-weight:700}
#rpCelFolha .rp-cel-folha-sub{font-size:13px;color:var(--text-muted,#8b94a8);margin-bottom:8px}
#rpCelFolha .rp-cel-folha-lista button,#rpCelFolha .rp-cel-folha-cancelar{width:100%;min-height:48px;border:0;border-bottom:1px solid var(--divider,#161d2b);background:transparent;
  color:inherit;font:500 15px Inter,system-ui,sans-serif;text-align:left;cursor:pointer}
#rpCelFolha .rp-cel-folha-cancelar{border-bottom:0;color:var(--text-muted,#8b94a8);text-align:center;margin-top:6px}
@media (max-width:767px){
  #rpCelEtapas{display:flex;gap:8px;overflow-x:auto;padding:8px 16px 12px;border-bottom:1px solid var(--divider,#1a2130);scrollbar-width:none}
  #rpCelEtapas button{flex:0 0 auto;height:36px;padding:0 12px;border-radius:18px;border:1px solid #222a3b;background:transparent;color:#aab3c5;
    font:600 13px Inter,system-ui,sans-serif;white-space:nowrap;cursor:pointer}
  #rpCelEtapas button[aria-selected="true"]{border-color:var(--accent,#3461d1);background:rgba(52,97,209,.16);color:#dbe4ff}
  #rpCelEtapas button span{font-family:ui-monospace,SFMono-Regular,Menlo,monospace}
  #crmBoard{display:block!important;overflow-x:hidden!important}
  #crmBoard .crm-column{width:100%!important;min-width:0!important;max-width:none!important;flex:none!important}
  #crmBoard .crm-column.rp-cel-oculta{display:none!important}
  #crmBoard .crm-column-drop{max-height:none!important}
  #crmBoard .rp-cel-mover{display:inline-flex;align-items:center;justify-content:center;margin-top:8px;height:36px;padding:0 14px;border-radius:10px;
    border:1px solid #2a3246;background:transparent;color:#dbe1ee;font:600 13px Inter,system-ui,sans-serif;cursor:pointer}
}
body.light-theme #rpCelEtapas button{border-color:#d4dae6;color:#4a5468}
body.light-theme #rpCelEtapas button[aria-selected="true"]{background:rgba(52,97,209,.1);color:#1d3f9e}
body.light-theme #crmBoard .rp-cel-mover{border-color:#cbd5e1;color:#1a1f2b}
body.light-theme #rpCelFolha .rp-cel-folha-painel{background:#ffffff;border-top-color:#dbe1ec;color:#1a1f2b}
body.light-theme #grid tr.row-confirmed td[data-col="Etapa"],body.light-theme #grid tr.row-confirmed td[data-col="Status"]{color:#1f7a4c!important}
body.light-theme #grid tr.row-waiting td[data-col="Etapa"],body.light-theme #grid tr.row-waiting td[data-col="Status"]{color:#8a5a00!important}
body.light-theme #grid tr.row-cancelled td[data-col="Etapa"],body.light-theme #grid tr.row-cancelled td[data-col="Status"]{color:#b4232a!important}
#rpCelVoltarChat{display:none}
@media (max-width:767px){body.rp-cel-chat-aberto #rpCelVoltarChat{display:flex}}
body.light-theme #rpBarraCel{background:#ffffff;border-top-color:#dbe1ec}
body.light-theme #rpBarraCel button{color:#5b6477}
body.light-theme #rpBarraCel button[aria-current="page"]{color:#1d3f9e}
@media print{#rpBarraCel{display:none!important}}
