/* ============================================================
 * Coachecom Coach — Tela "Meus Clientes" V3.5 (Marco 5.6)
 * ------------------------------------------------------------
 * Refinamento do V3 (Marco 5.1) com base no design exportado pelo
 * Claude Design (handoff "redesign-clientes-e-liderados"). Variantes
 * locked pelo usuário (memory: project_redesign_clientes_v35):
 *
 *   • view:        grid + list (toggle com persist localStorage)
 *   • stats:       chips (pílulas horizontais com count colorido)
 *   • mais opções: drawer (painel lateral com tiles 2× + search)
 *
 * Marco 5.5 mantido — header flat, sem eyebrow "Área do profissional"
 * (alinhamento visual com PDIC V3 .page-head).
 *
 * Estrutura (arquitetura de classes):
 *   .coach-page                 wrapper full-height
 *   .coach-hero                 título + subtítulo (flat)
 *   .kpi-chip-row               stats em pílulas (DS, 4 filtros)
 *   .coach-toolbar              barra split 3-col (Novo + busca + view)
 *     .tb-left / .tb-center / .tb-right
 *     .new-wrap > .coach-new-menu (dropdown rich)
 *     .open-search-bar           trigger do filter-drawer-v3 global
 *     .filter-badge              contador de filtros ativos
 *     .search-wrap > .search-input + .search-clear
 *     .result-count + .rc-term   counter com destaque do termo
 *     .view-toggle > .vt-btn     segmentado grid/list
 *   .active-chips                strip de filtros aplicados
 *   .coach-grid                  grid responsivo de cards
 *   .coachee-card                card individual (avatar inline)
 *     .card-status-header        gradient + badge com blur
 *     .cc-body / .cc-top / .cc-meta / .cc-actions / .cc-more-btn
 *   .coach-table-wrap > .coach-table   modo lista
 *   .ma-drawer / .ma-drawer-backdrop   drawer "Mais opções" GLOBAL
 *     .ma-drawer-head + .ma-drawer-search + .ma-drawer-body
 *     .ma-drawer-group > .ma-drawer-grid > .ma-tile
 *   .coach-empty                 empty state
 *   .coach-pagination            paginação (envolve $paginacao CI)
 *   .modal-v3 (#modal-new-cliente) modal de convites refinado
 *     .modal-head-row + .modal-head-icon
 *     .csv-drop-zone + .invite-row + .summary-pill
 *
 * Status colors (3 estados — semântica universal):
 *   active           verde   #047857 / bg #ecfdf5 / solid #059669
 *   awaiting         laranja #b45309 / bg #fffbeb / solid #d97706
 *   finished         cinza   #475569 / bg #f1f5f9 / solid #64748b
 *
 * Tenant-aware: --primary herda cor do owner (override em
 * template_sistema.php). Cores de status são fixas semânticas.
 *
 * Carregamento (Coaches::include_assets em controllers/coach/Coaches.php):
 *   set_tema('headerinc', load_css(['coach-v3'], 'assets/css'), FALSE);
 *   set_tema('footerinc', load_js(['coach-v3'], 'assets/js'), FALSE);
 * ============================================================ */


/* ─── Default size for SVG icons emitted by coach_icon() ─── */
/*
 * O helper PHP coach_icon($name) emite <svg class="coach-ico"> sem
 * width/height inline — o tamanho default seria 300×150 (CSS spec
 * pra SVG inline). Definimos um fallback de 1em (segue font-size do
 * parent). Cada contexto que precisa de tamanho diferente sobrescreve
 * via selectors mais específicos abaixo.
 */
.coach-ico {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  vertical-align: middle;
  display: inline-block;
  fill: none;
}
.btn .coach-ico    { width: 16px; height: 16px; }
.btn-sm .coach-ico { width: 14px; height: 14px; }


/* ─── Local vars (cores de status — não estão em tokens.css) ─ */

:root {
  /* foreground (texto/borda em badges) — escurecido em relação aos
     tokens globais pra contraste em fundos washed */
  --coach-active-fg:    #047857;
  --coach-awaiting-fg:  #b45309;
  --coach-finished-fg:  #475569;
  /* background washed (chips, badges minimal) */
  --coach-active-bg:    #ecfdf5;
  --coach-awaiting-bg:  #fffbeb;
  --coach-finished-bg:  #f1f5f9;
  /* solid (gradient do header, dot do badge minimal) */
  --coach-active-solid:    #059669;
  --coach-awaiting-solid:  #d97706;
  --coach-finished-solid:  #64748b;
}


/* ─── Page wrapper ─────────────────────────────────────────── */

.coach-page {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--ink);
}


/* ─── Hero (flat — alinhado com PDIC V3 .page-head) ────────── */

.coach-hero {
  background: transparent;
  /* Marco 5.47 — padding-top 20px convencao do projeto pra dar respiro
     visual entre o topbar e o titulo. Aplicado tambem em .sessoes-hero
     e .ns-page-head pra manter consistencia entre telas. */
  padding: 20px 0 0;
  margin-bottom: 22px;
}

.coach-hero__title {
  /* !important vence evolvingcycle/style.css:34 que aplica
     "Inria Sans" !important em h1 globalmente (senão o título cai
     na fonte legada em vez da display do DS). */
  font-family: var(--font-display) !important;
  /* Marco 9C — tamanho padronizado com o cabeçalho transversal do DS
     (report-page-v3 / dashboard / consent): 30px desktop, 24px mobile. */
  font-size: 30px;
  line-height: 1.15;
  font-weight: 700;
  color: var(--fg-1);
  letter-spacing: -0.025em;
  margin: 0;
}

.coach-hero__subtitle {
  /* !important vence o mesmo `p { "Inria Sans" !important }` legado. */
  font-family: var(--font-sans) !important;
  font-size: 14px;
  color: var(--fg-4);
  margin: 6px 0 0;
  max-width: 64ch;
  line-height: 1.5;
}

/* Marco 5.11 — Hero "Resultado da pesquisa" (.is-search)
   Eyebrow vira hero-back link; subtitulo destaca contagem (<strong>)
   e termo (<em class="rc-term">). Espelha app2.jsx:255-269 do design. */
.coach-hero.is-search { margin-bottom: 18px; }

.coach-hero__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .88px;
  text-transform: uppercase;
  color: var(--fg-5);
  text-decoration: none;
  margin-bottom: 6px;
  transition: color var(--duration, 150ms);
}
.coach-hero__back:hover,
.coach-hero__back:focus-visible { color: var(--primary-fg); text-decoration: none; }
.coach-hero__back svg,
.coach-hero__back .coach-ico { width: 12px; height: 12px; }

.coach-hero__subtitle strong { color: var(--fg-1); font-weight: 700; }
.coach-hero__subtitle .rc-term {
  color: var(--fg-1);
  font-style: normal;
  font-weight: 600;
}


/* ─── Stats — CHIPS ────────────────────────────────────────────
   Removido: os chips de Coachees e de Convites viraram .kpi-chip
   (report-toolbar-v3.css, bundle) — o mesmo componente que Cargos,
   Créditos, Pré-mapeamento, PS e Líderes usam agora. O estado ativo
   mora em [data-active], não em .is-active. ────────────────────── */

/* Marco 6.236 — respiro entre os chips e a toolbar. O .kpi-chip-row do
   DS não traz margem (cada consumidor espaça: .credits-stats 16px,
   .cargos-stats 20px); nas telas do coach (Clientes e Convites) ele
   entrava "pelado" e colava na toolbar logo abaixo. Escopado em
   .coach-page__inner > para não atingir os outros consumidores do DS —
   em Líderes a row é flex:1 DENTRO de uma toolbar e margem quebraria
   o alinhamento vertical. */
.coach-page__inner > .kpi-chip-row {
  margin-bottom: 16px;
}


/* ─── Toolbar split 3-col ──────────────────────────────────── */

.coach-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-card);
}
.tb-left   { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.tb-center { flex: 1; min-width: 0; }
.tb-right  { display: flex; gap: 12px; align-items: center; flex-shrink: 0; }


/* ─── "Novo cliente" dropdown rico ─────────────────────────── */

.new-wrap, .coach-new-wrapper { position: relative; }

.coach-new-toggle {
  /* já usa .btn .btn-primary — só ajustes leves para incluir o chevron */
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.coach-new-toggle .chevron {
  width: 14px; height: 14px;
  opacity: .85;
  transition: transform var(--duration);
}
.new-wrap.is-open .coach-new-toggle .chevron,
.coach-new-wrapper.is-open .coach-new-toggle .chevron { transform: rotate(180deg); }

.coach-new-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--bg);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  min-width: 280px;
  box-shadow: var(--shadow-pop);
  z-index: 20;
  overflow: hidden;
  padding: 6px;
  display: none;
}
.new-wrap.is-open .coach-new-menu,
.coach-new-wrapper.is-open .coach-new-menu { display: block; }

.coach-new-menu .new-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.coach-new-menu .new-item:hover { background: var(--surface-muted); text-decoration: none; color: inherit; }
.coach-new-menu .new-item .ni-icon {
  width: 18px; height: 18px;
  color: var(--primary-fg);
  margin-top: 2px;
  flex-shrink: 0;
}
.coach-new-menu .new-item .ni-t {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13.5px;
  color: var(--fg-1);
}
.coach-new-menu .new-item .ni-s {
  font-size: 12px;
  color: var(--fg-4);
  margin-top: 2px;
}


/* ─── Search input ─────────────────────────────────────────── */

.coach-toolbar .search-wrap {
  position: relative;
}
.coach-toolbar .search-wrap .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--fg-5);
  pointer-events: none;
}
.coach-toolbar .search-input {
  width: 100%;
  height: 40px;
  padding: 0 36px 0 38px;
  border: 1px solid var(--border-default);
  border-radius: 10px;
  background: var(--bg);
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--fg-2);
  transition: border-color var(--duration), box-shadow var(--duration);
}
.coach-toolbar .search-input::placeholder { color: var(--fg-5); }
.coach-toolbar .search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29,78,216,.12);
}
.coach-toolbar .search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--fg-4);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
}
.coach-toolbar .search-clear.is-visible { display: inline-flex; }
.coach-toolbar .search-clear:hover { background: var(--surface-muted); color: var(--fg-2); }
.coach-toolbar .search-clear svg,
.coach-toolbar .search-clear i { width: 14px; height: 14px; }


/* ─── Filter badge (contador de filtros ativos) ────────────── */

.filter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--primary);
  color: var(--on-accent, #fff);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 10.5px;
  border-radius: 999px;
  margin-left: 2px;
}


/* ─── Result count com destaque do termo ───────────────────── */

.result-count {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--fg-4);
  white-space: nowrap;
}
.result-count strong { color: var(--fg-1); font-weight: 700; }
.result-count .rc-term {
  color: var(--fg-1);
  font-style: normal;
  font-weight: 600;
}


/* ─── View toggle grid/list ────────────────────────────────── */

.view-toggle {
  display: inline-flex;
  background: var(--surface-muted);
  border-radius: 9px;
  padding: 3px;
  gap: 2px;
}
.vt-btn {
  width: 32px;
  height: 28px;
  border-radius: 7px;
  border: 0;
  background: transparent;
  color: var(--fg-4);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--duration), color var(--duration);
}
.vt-btn:hover { color: var(--fg-2); }
.vt-btn.is-on {
  background: var(--bg);
  color: var(--primary-fg);
  box-shadow: var(--shadow-sm);
}
.vt-btn svg, .vt-btn i { width: 15px; height: 15px; }


/* ─── Active filter chips strip (Tela 2) ───────────────────── */

.active-chips {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  margin-bottom: 16px;
  background: var(--bg);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
}
.active-chips .ac-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--fg-4);
  padding-right: 8px;
  border-right: 1px solid var(--border-muted);
}
.active-chips .ac-label svg,
.active-chips .ac-label i { width: 14px; height: 14px; }
.active-chips .ac-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.active-chips .ac-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 8px 0 12px;
  border-radius: 999px;
  border: 1px solid #b9c8f0;          /* mix(primary 25%, border) approx */
  background: var(--primary-soft);
  color: var(--primary-fg);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
  transition: background var(--duration), border-color var(--duration);
}
.active-chips .ac-chip:hover {
  background: #dbeafe;
  color: var(--primary-fg);
  text-decoration: none;
}
.active-chips .ac-chip svg,
.active-chips .ac-chip i { width: 13px; height: 13px; opacity: .7; flex-shrink: 0; }
.active-chips .ac-clear { color: var(--fg-4); margin-left: auto; }


/* ─── Filter drawer — chips groups (extends filter-drawer-v3.css) ──
 *
 * O componente .filter-drawer-v3 (assets/css/filter-drawer-v3.css)
 * já provê painel/backdrop/header/footer. Aqui adicionamos os
 * sub-componentes específicos da Lista de Clientes V3.5:
 *   .filter-drawer-v3__chips  grupo de chips em flex-wrap
 *   .filter-chip              chip individual (label + radio escondido)
 *   .filter-drawer-v3__row    linha 2-col (para range de data)
 */
.filter-drawer-v3__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border-default);
  border-radius: 999px;
  background: var(--bg);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--fg-2);
  cursor: pointer;
  user-select: none;
  transition: background var(--duration), border-color var(--duration), color var(--duration);
  margin: 0;
}
.filter-chip:hover {
  border-color: var(--border-strong);
  background: var(--surface-muted);
}
.filter-chip input[type=radio],
.filter-chip input[type=checkbox] {
  position: absolute;
  width: 0; height: 0;
  opacity: 0;
  pointer-events: none;
}
.filter-chip.is-active {
  background: var(--primary-soft);
  color: var(--primary-fg);
  border-color: var(--primary);
}

.filter-drawer-v3__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.filter-drawer-v3__row .filter-drawer-v3__field-hint {
  margin-top: 4px;
}


/* ─── Cards grid ───────────────────────────────────────────── */

.coach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(304px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
/* [hidden] padrao do browser perde para .coach-grid (display:grid) — forca */
.coach-grid[hidden],
.coach-table-wrap[hidden] { display: none !important; }


/* ─── Coachee card (V3.5 — avatar inline, badge no header) ── */

.coachee-card {
  position: relative;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border-default);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  transition: transform var(--duration), box-shadow var(--duration), border-color var(--duration);
}
.coachee-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(11,18,32,.10);
  border-color: var(--border-strong);
}

/* Status header: gradient + pattern + badge com blur */
.card-status-header {
  position: relative;
  height: 64px;
  padding: 12px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  overflow: hidden;
}
.card-status-header .header-pattern {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,.18) 1px, transparent 1.5px);
  background-size: 14px 14px;
  opacity: .6;
}
.card-status-header .status-badge {
  position: relative;
  background: rgba(255,255,255,.2);
  color: #fff;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.25);
}
.card-status-header .status-badge svg,
.card-status-header .status-badge i { color: #fff; }

/* Gradiente do header — varia por status */
.coachee-card.status-active    .card-status-header { background: linear-gradient(135deg, var(--coach-active-solid)    0%, color-mix(in srgb, var(--coach-active-solid)    75%, #000) 100%); }
.coachee-card.status-awaiting  .card-status-header { background: linear-gradient(135deg, var(--coach-awaiting-solid)  0%, color-mix(in srgb, var(--coach-awaiting-solid)  75%, #000) 100%); }
.coachee-card.status-finished  .card-status-header { background: linear-gradient(135deg, var(--coach-finished-solid)  0%, color-mix(in srgb, var(--coach-finished-solid)  75%, #000) 100%); }

/* Body */
.cc-body {
  padding: 12px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.cc-top {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cc-top-text { flex: 1; min-width: 0; }
.cc-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15.5px;
  color: var(--fg-1);
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cc-role {
  font-family: var(--font-sans);
  font-size: 12.5px;
  color: var(--fg-4);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Linhas de meta (email/phone/sessões) */
.cc-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cc-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 12.5px;
  color: var(--fg-3);
  min-width: 0;
}
.cc-line svg,
.cc-line i {
  width: 13px;
  height: 13px;
  color: var(--fg-5);
  flex: 0 0 auto;
}
.cc-line > span:not(.cc-extra) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.cc-extra {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  background: var(--primary-soft);
  color: var(--primary-fg);
  padding: 1px 6px;
  border-radius: 999px;
}

/* Actions: Sessões (primary) + Opções (secondary)
 * Marco 6.184 — Pesquisas saiu (vai pro drawer de Opções). O grid passa
 * de 1fr 1fr auto (3 colunas com ... ícone) pra 1fr 1fr (2 botões iguais
 * com label). O .cc-more-btn herda largura 100% via .cc-actions .btn. */
.cc-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: auto;
  padding-top: 4px;
  border-top: 1px dashed var(--border-muted);
}
.cc-actions .btn { width: 100%; }

/* .cc-more-btn no contexto de lista (icon-only) mantém o tamanho compacto;
 * no contexto do grid do card (com label "Opções") herda largura do grid. */
.row-actions .cc-more-btn,
.icon-btn-h.cc-more-btn {
  width: 34px;
  padding: 0;
}
.cc-more-btn.is-open {
  background: var(--surface-muted);
  color: var(--fg-1);
}


/* ─── Avatar override dentro do card (helper avatar_html) ──── */

/* avatar-v3 helper gera <span class="avatar-v3 avatar-v3--md avatar-v3--circle">
   — no card V3.5 ele é INLINE (não sobreposto ao header), só ajusta um pouco
   de spacing/shadow pra contraste */
.coachee-card .avatar-v3 {
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(11,18,32,.08);
}

/* Marco 6.186 — densidade comfy: avatar 56px, padding generoso.
   Sobrescreve o tamanho `md` (48px) do token --avatar-v3--md so' no
   contexto do card pra bater com o spec do mockup oficial
   (Lista de Clientes.html, cards.jsx: density==='compact'?44:56). */
.coachee-card.dens-comfy .avatar-v3--md {
  --av-size: 56px;
  --av-font: 18px;
}
.coachee-card.dens-comfy .cc-body {
  padding: 16px 18px 16px;
}

/* Spec do mockup pra densidade compact — disponivel pra alternar via JS
   ou template caso seja necessario no futuro (turmas, etc). */
.coachee-card.dens-compact { border-radius: 12px; }
.coachee-card.dens-compact .avatar-v3--md {
  --av-size: 44px;
  --av-font: 16px;
}
.coach-grid.dens-compact {
  grid-template-columns: repeat(auto-fill, minmax(264px, 1fr));
  gap: 12px;
}


/* ─── Status badge (pill com ícone) ───────────────────────── */

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  line-height: 1.4;
  flex-shrink: 0;
}
.status-badge svg,
.status-badge i { width: 12px; height: 12px; }

/* Minimal variant (modo lista): só dot + texto, sem bg */
.status-badge--minimal {
  padding: 0;
  background: transparent !important;
  font-weight: 500;
  gap: 6px;
}
.status-badge--minimal .dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex: 0 0 auto;
  box-shadow: 0 0 0 3px color-mix(in oklab, currentColor 12%, transparent);
}

/* Cor por status — só nas TDs da tabela (minimal). No card o badge
   está dentro do header gradient e usa --header-* (transparente/blur). */
.status-active   { --status-fg: var(--coach-active-fg);   --status-bg: var(--coach-active-bg);   --status-solid: var(--coach-active-solid); }
.status-awaiting { --status-fg: var(--coach-awaiting-fg); --status-bg: var(--coach-awaiting-bg); --status-solid: var(--coach-awaiting-solid); }
.status-finished { --status-fg: var(--coach-finished-fg); --status-bg: var(--coach-finished-bg); --status-solid: var(--coach-finished-solid); }


/* ─── Modo lista (tabela) ──────────────────────────────────── */

.coach-table-wrap {
  background: var(--bg);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
}
.coach-table {
  width: 100%;
  border-collapse: collapse;
}
.coach-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--fg-4);
  padding: 12px 16px;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border-default);
}
.coach-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-muted);
  vertical-align: middle;
  font-size: 13.5px;
  color: var(--fg-3);
  /* evolvingcycle/style.css:5331 centraliza TODA td/th da aplicacao; os
     th daqui ja venciam por especificidade e as celulas ficavam
     centralizadas sob cabecalhos alinhados a esquerda. */
  text-align: left;
}
.coach-table tbody tr:hover td { background: rgba(29,78,216,.025); }
.coach-table tbody tr:last-child td { border-bottom: 0; }

.row-name-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.row-name-text { min-width: 0; }
.row-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--fg-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-cargo {
  font-size: 11.5px;
  color: var(--fg-4);
  margin-top: 1px;
}
.row-email { color: var(--fg-3); max-width: 240px; }
.row-email span {
  display: inline-block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
.row-phone {
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.row-actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
  align-items: center;
}
.row-status .status-badge--minimal { color: var(--status-fg); }
.row-status .status-badge--minimal .dot { background: var(--status-solid); }


/* ─── Icon button (reusado em row-actions, header-actions) ── */

.icon-btn-h {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-3);
  cursor: pointer;
  position: relative;
  text-decoration: none;
  transition: background var(--duration), border-color var(--duration);
}
.icon-btn-h:hover {
  background: var(--surface-muted);
  color: var(--fg-1);
  text-decoration: none;
}
.icon-btn-h svg,
.icon-btn-h i { width: 18px; height: 18px; }

/* Tooltip proprio (substitui o title nativo, que abria por cima dos
   botoes vizinhos da mesma linha). Balao acima do botao, centralizado.
   Usa data-tip pra NAO reintroduzir o tooltip do browser. */
.icon-btn-h[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  padding: 5px 9px;
  border-radius: 7px;
  background: var(--fg-1, #0f172a);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration), visibility var(--duration);
}
.icon-btn-h[data-tip]:hover::after,
.icon-btn-h[data-tip]:focus-visible::after {
  opacity: 1;
  visibility: visible;
}
/* Dentro da tabela o balao centralizado estourava ~39px a direita do
   .coach-table-wrap; como o wrap tem overflow:hidden, o hover rolava o
   container (scrollLeft) e comia os avatares da primeira coluna. Ancorar
   pela direita mantem o balao dentro da area visivel.
   NAO troque o overflow do wrap por visible: a tabela escapa do card. */
.row-actions .icon-btn-h[data-tip]::after {
  left: auto;
  right: 0;
  transform: none;
}


/* ─── Empty state ──────────────────────────────────────────── */

.coach-empty {
  background: var(--bg);
  border: 1px dashed var(--border-strong);
  border-radius: 14px;
  padding: 80px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 24px;
}
.coach-empty__icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--primary-soft);
  color: var(--primary-fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}
.coach-empty__icon svg,
.coach-empty__icon i { width: 28px; height: 28px; }
.coach-empty__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  color: var(--fg-1);
  margin: 0 0 6px;
  letter-spacing: -.01em;
}
.coach-empty__text {
  font-family: var(--font-sans);
  color: var(--fg-4);
  max-width: 44ch;
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.5;
}


/* ─── Pagination V3 (envolve $paginacao do CI) ─────────────── */

.coach-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 4px 4px;
  margin-bottom: 8px;
}
/* createPaginate emite <a> e <span> intercalados.
   Span "ativo" é a página atual; outros <a> são links de páginas. */
.coach-pagination a,
.coach-pagination span,
.coach-pagination strong {
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--fg-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--duration), color var(--duration);
}
.coach-pagination a:hover {
  background: var(--surface-muted);
  color: var(--fg-1);
  text-decoration: none;
}
.coach-pagination .ativo,
.coach-pagination .active,
.coach-pagination strong {
  background: var(--primary);
  color: var(--on-accent, #fff);
}


/* ─── Drawer "Mais opções" (GLOBAL, 1× no DOM) ─────────────── */

.ma-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11,18,32,.40);
  z-index: 1100;
  display: flex;
  justify-content: flex-end;
  animation: ma-fade-in 150ms ease-out;
}
.ma-drawer-backdrop[hidden] { display: none; }

.ma-drawer {
  width: 460px;
  max-width: 92vw;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: -10px 0 30px rgba(0,0,0,.18);
  animation: ma-slide-in 200ms ease-out;
}

.ma-drawer-head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ma-drawer-coachee {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
.ma-drawer-coachee .avatar-v3 { flex-shrink: 0; }
.ma-drawer-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--fg-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ma-drawer-meta {
  font-size: 12.5px;
  color: var(--fg-4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

.ma-drawer-search {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-muted);
  position: relative;
}
.ma-drawer-search svg,
.ma-drawer-search i.search-icon-inside {
  position: absolute;
  left: 32px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--fg-5);
}
.ma-drawer-search input {
  width: 100%;
  height: 40px;
  padding: 0 14px 0 38px;
  border: 1px solid var(--border-default);
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 14px;
  background: var(--bg);
  color: var(--fg-2);
}
.ma-drawer-search input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29,78,216,.12);
}

.ma-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 20px 20px;
}
.ma-drawer-group { margin-top: 16px; }
.ma-drawer-group:first-child { margin-top: 8px; }
.ma-drawer-group-h {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-5);
  margin-bottom: 8px;
}
.ma-drawer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.ma-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border-default);
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--fg-2);
  text-decoration: none;
  transition: border-color var(--duration), background var(--duration);
}
.ma-tile:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-fg);
  text-decoration: none;
}
.ma-tile-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--fg-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.ma-tile-icon svg,
.ma-tile-icon i { width: 16px; height: 16px; }
.ma-tile:hover .ma-tile-icon {
  background: var(--bg);
  color: var(--primary-fg);
}
.ma-tile-label { flex: 1; min-width: 0; }

/* Variants: danger + primary (pendente) */
.ma-tile.is-danger { color: var(--danger); }
.ma-tile.is-danger:hover {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}
.ma-tile.is-danger .ma-tile-icon {
  background: var(--danger-soft);
  color: var(--danger);
}
.ma-tile.is-danger:hover .ma-tile-icon {
  background: var(--bg);
  color: var(--danger);
}
.ma-tile.is-primary {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-fg);
  font-weight: 600;
}
.ma-tile.is-primary .ma-tile-icon {
  background: var(--primary);
  color: var(--on-accent, #fff);
}

/* Hidden template (cada card renderiza um <template class=coachee-actions-template>) */
template.coachee-actions-template { display: none; }

@keyframes ma-slide-in { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes ma-fade-in  { from { opacity: 0; } to { opacity: 1; } }


/* ─── Modal V3 — invite (#modal-new-cliente) ──────────────── */
/*
 * Override do Bootstrap 3 .modal: o modal continua sendo aberto via
 * $('#modal-new-cliente').modal('show') — apenas o visual do conteúdo
 * é V3. .modal-v3 é adicional para localizar overrides.
 */

#modal-new-cliente .modal-dialog {
  width: auto;
  max-width: 720px;
  margin: 30px auto;
}
#modal-new-cliente .modal-content {
  border: 0;
  border-radius: 16px;
  box-shadow: var(--shadow-modal);
  overflow: hidden;
}
#modal-new-cliente .modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-muted);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
#modal-new-cliente .modal-header .close {
  margin: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: transparent;
  color: var(--fg-4);
  opacity: 1;
  font-size: 20px;
  line-height: 1;
  font-weight: 500;
  transition: background var(--duration), color var(--duration);
  text-shadow: none;
}
#modal-new-cliente .modal-header .close:hover {
  background: var(--surface-muted);
  color: var(--fg-1);
}
#modal-new-cliente .modal-body {
  padding: 22px 24px;
  max-height: 60vh;
  overflow-y: auto;
}
#modal-new-cliente .modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border-muted);
  background: var(--surface-muted);
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.modal-head-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}
.modal-head-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary-fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.modal-head-icon svg,
.modal-head-icon i { width: 20px; height: 20px; }
.modal-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-5);
  display: block;
  margin-bottom: 2px;
}
#modal-new-cliente .modal-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  color: var(--fg-1);
  margin: 0;
  letter-spacing: -.01em;
  line-height: 1.3;
}
.modal-intro {
  font-size: 13.5px;
  color: var(--fg-3);
  margin: 0 0 14px;
  line-height: 1.5;
}

/* CSV drop zone */
.csv-drop-zone {
  border: 2px dashed var(--border-default);
  border-radius: 12px;
  padding: 18px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 150ms;
  background: var(--surface-muted);
  margin-bottom: 8px;
}
.csv-drop-zone:hover,
.csv-drop-zone.is-dragover {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.csv-drop-zone .csv-drop-icon {
  width: 28px;
  height: 28px;
  color: var(--primary-fg);
  margin-bottom: 6px;
}
.csv-drop-zone .csv-drop-main {
  font-size: 14px;
  color: var(--fg-2);
}
.csv-drop-zone .csv-drop-main strong {
  color: var(--fg-1);
  font-weight: 600;
}
.csv-drop-zone .csv-drop-hint {
  font-size: 11.5px;
  color: var(--fg-4);
  margin-top: 4px;
  font-family: var(--font-mono);
}

/* OU separator */
.modal-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 12px;
  color: var(--fg-4);
}
.modal-divider::before,
.modal-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-default);
}
.modal-divider span {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* Invite rows (gerados pelo form() em js_coache.js) */
.formularios { display: flex; flex-direction: column; gap: 4px; max-height: none; overflow: visible; }
.formulario.invite-row {
  display: grid;
  grid-template-columns: 28px 1fr 36px;
  gap: 10px;
  align-items: start;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-muted);
}
.formulario.invite-row:last-child { border-bottom: none; }
.invite-row__index {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--fg-4);
  background: var(--surface-muted);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  margin-top: 6px;
}
.invite-row__inputs {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 8px;
}
.invite-row__inputs .form-group { margin: 0; }
.invite-row__inputs .form-control {
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--border-default);
  background: var(--bg);
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--fg-2);
  transition: border-color var(--duration), box-shadow var(--duration);
  box-shadow: none;
}
.invite-row__inputs .form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29,78,216,.12);
}
/* BS3 has-error/has-success — re-skin pra V3 */
.invite-row__inputs .has-error .form-control { border-color: var(--danger); }
.invite-row__inputs .has-error .form-control:focus { box-shadow: 0 0 0 3px rgba(220,38,38,.15); }
.invite-row__inputs .has-success .form-control { border-color: var(--success); }
.invite-row__inputs .form-control-feedback { display: none; } /* esconde glyphicon legacy */

.invite-row__remove {
  /* Marco 6.212 — force static pra garantir grid placement (CSS
     legacy aplicava position:absolute, fazendo o X aparecer no
     canto esquerdo do modal, sobrepondo o index "1"). */
  position: static !important;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--fg-4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-top: 4px;
}
.invite-row__remove:hover { background: var(--danger-soft); color: var(--danger); }
.invite-row__remove svg,
.invite-row__remove i { width: 14px; height: 14px; }

/* "Adicionar outro convite" button (manual add row) */
.invite-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 6px 10px;
  border: 0;
  background: transparent;
  color: var(--primary-fg);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px;
}
.invite-add-btn:hover { background: var(--primary-soft); }
.invite-add-btn svg,
.invite-add-btn i { width: 14px; height: 14px; }

/* Summary pills (footer) */
.invite-summary {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}
.summary-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.summary-pill svg,
.summary-pill i { width: 11px; height: 11px; }
.summary-pill--ok { background: var(--success-soft); color: var(--success); }
.summary-pill--err { background: var(--danger-soft); color: var(--danger); }

/* Marco 6.212 — refinos do modal Novo Cliente ou Liderado.
   Esconde o input file nativo (atributo hidden estava sendo ignorado
   por algum reset global). Drop zone usa este input via .click(). */
#modal-new-cliente #list_csv {
  display: none !important;
}

/* Intro hint complementar (texto secundario menor abaixo do main) */
.modal-intro__hint {
  display: block;
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--fg-4);
  line-height: 1.4;
}

/* Field error inline (msg vermelha pequena abaixo do input).
   Aparece junto com .is-error no .form-control. */
.invite-row__inputs .field-error {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-family: var(--font-sans);
  font-size: 11.5px;
  color: var(--danger, #b91c1c);
  font-weight: 500;
}
.invite-row__inputs .field-error svg,
.invite-row__inputs .field-error i {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
}

/* Border vermelha no input invalido (.is-error) — Marco 6.212.
   Equivalente moderno do has-error legacy. */
.invite-row__inputs .form-control.is-error {
  border-color: var(--danger, #b91c1c);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .12);
}


/* ─── Refinamentos do core (vindos do bundle v2) ──────────── */

/* Search icon dentro do .ma-drawer-search aceita <svg> também (v1 só <i>). */
.ma-drawer-search > :is(svg, i) {
  position: absolute;
  left: 32px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--fg-5);
  pointer-events: none;
  flex: 0 0 16px;
}

/* Nav toast — fallback do roteador para ações sem tela dedicada.
   Aparece bottom-center, sem interação (auto-dismiss via JS). */
.nav-toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 12px;
  background: #0f172a;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 12px 30px rgba(15,23,42,.18), 0 2px 6px rgba(15,23,42,.12);
  z-index: 1300;
  pointer-events: none;
  animation: nav-toast-pop 220ms ease-out;
}
.nav-toast.is-leaving { animation: nav-toast-out 180ms ease-in forwards; }
.nav-toast .coach-ico { width: 16px; height: 16px; color: #60a5fa; }
@keyframes nav-toast-pop {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes nav-toast-out {
  from { opacity: 1; transform: translate(-50%, 0); }
  to   { opacity: 0; transform: translate(-50%, 12px); }
}


/* ─── Modal M02 — Dados do cliente (.cdm-*) ───────────────── */
/*
 * Modal "Dados do cliente" — substitui o bootbox.alert legado.
 * Hero grande com gradient (cor por status), avatar circular, grid
 * de cards de pesquisas, banner de devolutiva, quick actions.
 *
 * Renderizado em DOIS lugares:
 *   - O wrapper #modal-client-data fica em view_coache.php (BS3 modal)
 *   - O conteudo (hero + body + foot) vem do controller getDataCoache
 *     que renderiza application/views/coach/coaches/data-coachee.php
 *
 * O AJAX legado de .btn_data_cliente substitui .modal-content do
 * BS3 modal; o markup retornado ja inclui as classes V3.5.
 */
#modal-client-data .modal-dialog { width: auto; max-width: 880px; margin: 30px auto; }
#modal-client-data .modal-content {
  border: 0;
  border-radius: 16px;
  box-shadow: var(--shadow-modal);
  overflow: hidden;
  background: var(--bg);
}
/* Desktop: empurra um pouco pra baixo no viewport pra dar peso visual */
@media (max-width: 991px) {
  #modal-client-data .modal-dialog { width: 95vw; }
}

.cdm-hero {
  position: relative;
  color: #fff;
  padding: 28px 28px 32px;
  /* Cor por status — fallback usando vars do projeto */
  background: linear-gradient(135deg, var(--coach-active-solid) 0%, color-mix(in srgb, var(--coach-active-solid) 75%, #000) 100%);
}
.cdm-hero[data-status="active"] {
  background: linear-gradient(135deg, var(--coach-active-solid) 0%, color-mix(in srgb, var(--coach-active-solid) 70%, #000) 100%);
}
.cdm-hero[data-status="awaiting"] {
  background: linear-gradient(135deg, var(--coach-awaiting-solid) 0%, color-mix(in srgb, var(--coach-awaiting-solid) 70%, #000) 100%);
}
.cdm-hero[data-status="finished"] {
  background: linear-gradient(135deg, var(--coach-finished-solid) 0%, color-mix(in srgb, var(--coach-finished-solid) 70%, #000) 100%);
}

.cdm-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 9px;
  background: rgba(255,255,255,.15);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-shadow: none;
  opacity: 1;
  transition: background var(--duration);
}
.cdm-close:hover { background: rgba(255,255,255,.28); color: #fff; opacity: 1; }
.cdm-close .coach-ico { width: 18px; height: 18px; }

.cdm-hero-inner {
  display: flex;
  gap: 22px;
  align-items: flex-start;
}
.cdm-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  border: 3px solid rgba(255,255,255,.85);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 32px;
  letter-spacing: -.01em;
  color: #fff;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
}
.cdm-avatar.has-img { background-color: transparent; }

.cdm-meta { flex: 1; min-width: 0; padding-top: 4px; }
.cdm-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.2);
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 8px;
  color: #fff;
}
.cdm-status-dot { width: 6px; height: 6px; border-radius: 50%; background: #fff; }

.cdm-name {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.018em;
  line-height: 1.1;
  margin: 0 0 14px;
  color: #fff;
}

.cdm-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}
.cdm-contact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,.92);
  text-decoration: none;
  font-size: 13px;
}
.cdm-contact:hover { color: #fff; text-decoration: underline; }
.cdm-contact .coach-ico { width: 14px; height: 14px; }
.cdm-contact--ghost { color: rgba(255,255,255,.7); cursor: default; }
.cdm-contact--ghost:hover { color: rgba(255,255,255,.7); text-decoration: none; }

/* Body */
.cdm-body {
  max-height: 60vh;
  overflow-y: auto;
  padding: 22px 24px;
}

/* Banner de devolutiva pendente */
.devolutiva-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--warning-soft);
  border: 1px solid #fde68a;
  border-radius: 10px;
  margin-bottom: 20px;
}
.devolutiva-banner__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(217,119,6,.15);
  color: var(--warning);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.devolutiva-banner__icon .coach-ico { width: 18px; height: 18px; }
.devolutiva-banner__text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.devolutiva-banner__text strong { font-weight: 600; color: var(--fg-1); font-size: 14px; }
.devolutiva-banner__text span { font-size: 12.5px; color: var(--fg-3); }
.devolutiva-banner__actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* Quick actions */
.cdm-quick-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.cdm-quick-actions .btn {
  flex: 1;
  min-width: 150px;
  justify-content: center;
}

/* Section */
.cdm-section { margin-bottom: 8px; }
.cdm-section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}
.cdm-section-head h3 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  margin: 0;
  color: var(--fg-1);
}
.cdm-section-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-4);
  font-weight: 600;
  letter-spacing: .03em;
}

/* Profile cards grid */
.profile-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.profile-card {
  background: var(--bg);
  border: 1.5px solid var(--border-default);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 150ms;
}
.profile-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.profile-card.is-filled {
  background: linear-gradient(180deg, #fff 0%, #f0fdf4 100%);
}
.profile-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}
.profile-card__icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Marco 6.220 — usa tokens do owner (--brand-primary cascade do Marco 6.174)
     em vez de --primary fixo. Garante que o icone do card puxa a cor da marca
     configurada pelo dono atual. */
  background: var(--brand-wash, var(--primary-soft, #eff6ff));
  color: var(--primary-fg, var(--brand-primary));
}
.profile-card__icon .coach-ico { width: 16px; height: 16px; }
/* Marco 6.220 — Removidas as variantes por categoria (.is-insights e
   .is-bemestar) que usavam roxo (#7c3aed) e verde (--success) hardcoded.
   User reportou que Indice de positividade, Tetrade do tempo, Linguagem
   de valorizacao e outros NAO puxavam a cor do owner — porque o seletor
   .profile-card[data-cat="bemestar"] .profile-card__icon sobrescrevia
   o default com --success (verde fixo do design system, nao a brand do
   owner). Agora todos usam --brand-primary/--brand-wash uniformemente. */

.profile-card__status {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--fg-4);
}
.profile-card__status.is-ok { color: var(--success); }

.profile-card__title {
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--fg-1);
  line-height: 1.25;
}
/* Marco 6.198 — TEST: oculta o valor do resultado dentro dos profile-cards
   pra deixar todos cards com a mesma altura/alinhados. Usuario quer
   testar como fica sem mostrar "Dominante Influente" / "59.17%" /
   "Importante: 36.78%..." em cima dos cards.
   Pra reverter, basta tirar o display:none. */
.profile-card__value {
  display: none;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--primary-fg);
  letter-spacing: -.01em;
  margin-top: 2px;
  word-break: break-word;
  line-height: 1.35;
}
.profile-card__value .bold { font-weight: 700; color: var(--fg-1); }

.profile-card__cta,
.profile-card__link {
  background: none;
  border: none;
  padding: 0;
  color: var(--primary-fg);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  margin-top: 4px;
  text-decoration: none;
}
.profile-card__cta:hover { text-decoration: underline; }
.profile-card__link { color: var(--fg-3); }
.profile-card__link:hover { color: var(--primary-fg); }
.profile-card__cta .coach-ico,
.profile-card__link .coach-ico { width: 12px; height: 12px; margin-left: 4px; }

/* ── Marco 6.240 — Dados do Cliente: busca + grupos de pesquisas ──
   Busca no padrão .perm-search e headers no padrão .perm-section__header
   (modal Liberar ferramentas), adaptados pro corpo do cdm. */
.cdm-search {
  position: relative;
  margin-bottom: 16px;
}
.cdm-search > .coach-ico {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--fg-5);
  pointer-events: none;
}
.cdm-search input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 38px;
  border: 1px solid var(--border-default);
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 13.5px;
  color: var(--fg-1);
  background: var(--bg);
  transition: border-color var(--duration), box-shadow var(--duration);
}
.cdm-search input::placeholder { color: var(--fg-5); }
.cdm-search input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent);
}

.cdm-group { margin-bottom: 14px; }
.cdm-group__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  background: var(--surface-muted, #f1f5f9);
  border: 0;
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
  user-select: none;
  transition: background var(--duration);
}
.cdm-group__header:hover { background: #e9eef5; }
.cdm-group__header:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}
.cdm-group__title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.cdm-group__chevron {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-4);
  transition: transform var(--duration);
}
.cdm-group__chevron .coach-ico { width: 12px; height: 12px; }
.cdm-group.is-collapsed .cdm-group__chevron { transform: rotate(-90deg); }
.cdm-group__icon {
  display: inline-flex;
  align-items: center;
  width: 16px;
  height: 16px;
  color: var(--fg-4);
}
.cdm-group__icon .coach-ico { width: 16px; height: 16px; }
.cdm-group__label {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.cdm-group__count {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--fg-4);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.cdm-group__grid { margin-top: 10px; }
.cdm-group.is-collapsed .cdm-group__grid,
.cdm-group.is-collapsed .cdm-group__empty,
.cdm-group.is-collapsed .cdm-group__none { display: none; }
.cdm-group__empty,
.cdm-group__none {
  margin-top: 10px;
  padding: 14px 16px;
  border: 1.5px dashed var(--border-default);
  border-radius: 12px;
  font-size: 13px;
  color: var(--fg-4);
}
.cdm-group__empty[hidden] { display: none; }

/* Foot — ID + Fechar */
#modal-client-data .modal-foot,
#modal-client-data .cdm-foot {
  padding: 14px 24px;
  border-top: 1px solid var(--border-muted);
  background: var(--surface-muted);
  display: flex;
  align-items: center;
  gap: 12px;
}
.cdm-foot__id {
  flex: 1;
  font-size: 12px;
  color: var(--fg-4);
  font-family: var(--font-mono);
}

/* Mobile responsivo do M02 */
/*
 * Marco 6.227 — o bloco antigo NAO ganhava do bootstrap-modal-v3.css, que
 * aplica `.modal { padding: 24px !important }`, `.modal-dialog { margin: 0
 * auto !important }` e `.modal-content { border-radius: var(--radius-xl)
 * !important; max-height: calc(100vh - 48px) }`. Resultado medido em 390px:
 *   - dialog com width:100vw dentro de um .modal com 24px de padding
 *     -> vazava ~24px a direita (o 3o quick action saia cortado da tela);
 *   - border-radius 14px + backdrop aparecendo nas bordas em vez do
 *     sheet full-bleed que o mockup pede;
 *   - min-height:100vh (coach-v3) x max-height:100vh-48px (bootstrap):
 *     min-height vence, o .cdm-foot ia parar fora da area visivel e o
 *     ultimo profile-card ficava cortado atras do rodape.
 * Agora as tres declaracoes usam !important pra empatar com o shell BS3, e
 * o .modal-content (que ja e flex column) distribui hero/body/foot: o body
 * fica com o scroll (flex:1) e o rodape encosta no fim da tela.
 */
@media (max-width: 600px) {
  .cdm-hero-inner { flex-direction: column; gap: 14px; align-items: center; text-align: center; }
  .cdm-contacts { justify-content: center; }

  #modal-client-data { padding: 0 !important; }
  #modal-client-data .modal-dialog {
    width: 100%;
    max-width: 100%;
    margin: 0 !important;
    min-height: 100vh;
    min-height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    align-items: stretch;
  }
  #modal-client-data .modal-content {
    border-radius: 0 !important;
    min-height: 100vh;
    min-height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
  }

  .cdm-hero { border-radius: 0; padding: 22px 20px 26px; flex-shrink: 0; }

  /* Body vira a area rolavel do sheet — sem o max-height:60vh, que criava
     um segundo scroll dentro de um modal que ja ocupa a tela inteira. */
  .cdm-body {
    padding: 18px 16px;
    max-height: none;
    flex: 1 1 auto;
    min-height: 0;
  }

  /* Quick actions: 1 botao por linha, largura total, rotulo centralizado
     (padrao do DS). Com `flex: 1` + `white-space: nowrap` os rotulos
     estouravam a caixa — "Realizar pesquisas" precisava de 140px e
     recebia 111px.
     ATENCAO: o container continua `row` + `wrap`. Trocar pra
     `flex-direction: column` quebra o `flex: 1 1 100%` do DS, porque em
     coluna o eixo principal e' o VERTICAL: o flex-basis 100% passa a valer
     pra altura e o flex-shrink esmaga os botoes (medido: 22px em vez de
     44px). Em `row` + `wrap` o basis 100% e' o que forca 1 por linha. */
  .cdm-quick-actions { flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .cdm-quick-actions .btn {
    flex: 1 1 100%;
    width: 100% !important;
    min-width: 0;
    height: 44px !important;
    flex-shrink: 0;
    justify-content: center !important;
  }

  /* Banner de devolutiva: empilha texto e acoes em vez de espremer 3
     colunas em 390px. */
  .devolutiva-banner { flex-wrap: wrap; gap: 12px 14px; }
  .devolutiva-banner__text { flex: 1 1 0; min-width: 0; }
  .devolutiva-banner__actions { flex: 1 1 100%; flex-wrap: wrap; }
  .devolutiva-banner__actions .btn {
    flex: 1 1 100%;
    width: 100% !important;
    height: 44px !important;
    flex-shrink: 0;
    justify-content: center !important;
  }

  /* Rodape fixo no fim do sheet, botao ocupando a linha. */
  #modal-client-data .cdm-foot {
    flex-shrink: 0;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  }
  #modal-client-data .cdm-foot .btn {
    flex: 1 1 100%;
    width: 100% !important;
    height: 44px !important;
    flex-shrink: 0;
    justify-content: center !important;
  }
}


/* ─── Modal M06 — Tarefas do cliente (.tarefas-*) ─────────── */
/*
 * Lista de tarefas do cliente. Aberto por .cc-tasks-trigger no
 * drawer "Mais opcoes" (substitui o trigger legacy #get-tasks no
 * contexto da Lista de Clientes). Cards de tarefa com checkbox
 * quick-complete, progress bar, filter tabs, e collapsible section
 * para concluidas.
 *
 * Edicao/criacao/exclusao ainda delega ao #modalAlterTarefas legacy
 * (sub-marco 5.7-c portara o M10 V3).
 */
#modal-client-tasks .modal-dialog { width: auto; max-width: 720px; margin: 30px auto; }
#modal-client-tasks .modal-content {
  border: 0;
  border-radius: 16px;
  box-shadow: var(--shadow-modal);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 60px);
}
@media (max-width: 991px) {
  #modal-client-tasks .modal-dialog { width: 95vw; }
}

.tarefas-modal { padding: 0; display: flex; flex-direction: column; min-height: 0; }
#modal-client-tasks .modal-header,
.tarefas-modal .modal-head {
  padding: 18px 22px 16px;
  background: var(--bg);
  border: 0;
  border-radius: 16px 16px 0 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

/* Marco 6.210 — eyebrow do header M06: uppercase + mono + letter-spacing
   pra match com mockup "Tarefas do Cliente.html" (texto fica
   "TAREFAS · NOME CLIENTE" estilo metadata).
   Marco 6.211 — tight spacing entre eyebrow e h2 (mockup spec: ~2px).
   O h2 herdava margin-top: 20px do browser default — zerado aqui. */
#modal-client-tasks .cc-eyebrow,
#modal-client-tasks .modal-head-text .cc-eyebrow {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-5, #64748b);
  display: block;
  margin: 0 0 2px;
  line-height: 1.4;
}
#modal-client-tasks .modal-head-text h2,
#modal-client-tasks #mct-title {
  margin: 0;
  font-family: var(--font-display, "Inria Sans", serif);
  font-weight: 700;
  font-size: 19px;
  line-height: 1.25;
  letter-spacing: -.01em;
  color: var(--fg-1);
}

/* Sticky toolbar — filter tabs + counter + Nova tarefa */
.tarefas-toolbar {
  position: sticky;
  top: 0;
  z-index: 4;
  background: var(--bg);
  border-bottom: 1px solid var(--border-muted);
  padding: 12px 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.tarefas-filters {
  display: inline-flex;
  background: var(--surface-muted);
  border-radius: 9px;
  padding: 3px;
  gap: 2px;
}
.tarefas-filter-btn {
  height: 30px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 12.5px;
  color: var(--fg-4);
  border-radius: 7px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background var(--duration), color var(--duration);
  white-space: nowrap;
}
.tarefas-filter-btn:hover { color: var(--fg-2); }
.tarefas-filter-btn.is-on {
  background: var(--bg);
  color: var(--primary-fg);
  box-shadow: var(--shadow-sm);
}
.tarefas-filter-count {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 10px;
  background: var(--surface-muted);
  color: var(--fg-3);
  padding: 1px 6px;
  border-radius: 999px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
.tarefas-filter-btn.is-on .tarefas-filter-count {
  background: var(--primary-soft);
  color: var(--primary-fg);
}

.tarefas-counter {
  font-family: var(--font-sans);
  font-size: 12.5px;
  color: var(--fg-4);
  white-space: nowrap;
}
.tarefas-counter strong {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--fg-1);
  font-variant-numeric: tabular-nums;
}
.tarefas-counter-sub { color: var(--fg-4); margin-left: 2px; }

.tarefas-toolbar #new-task,
.tarefas-toolbar .cc-task-new {
  margin-left: auto;
}

/* Body scrollable */
.tarefas-body.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 22px 22px;
  background: var(--surface-muted);
  min-height: 240px;
  max-height: none;
}

/* Section (Ativas / Concluidas) */
.tarefas-section + .tarefas-section { margin-top: 18px; }
.tarefas-section__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 4px 8px;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: default;
  color: inherit;
}
.tarefas-section__head--toggle {
  cursor: pointer;
  border-radius: 8px;
  padding: 6px 8px;
  margin: -6px -8px 4px;
  transition: background var(--duration);
}
.tarefas-section__head--toggle:hover {
  background: rgba(15,23,42,.06);
}
.tarefas-section__title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.tarefas-section__title .coach-ico { width: 13px; height: 13px; color: var(--primary-fg); }
.tarefas-completas .tarefas-section__title .coach-ico { color: var(--success); }
.tarefas-section__count {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 10.5px;
  background: var(--bg);
  color: var(--fg-3);
  border: 1px solid var(--border-default);
  padding: 2px 8px;
  border-radius: 999px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}
.tarefas-section__chev {
  margin-left: auto;
  color: var(--fg-4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--duration);
}
.tarefas-section__chev .coach-ico { width: 16px; height: 16px; }
.tarefas-section__head--toggle:not(.is-open) + .tarefas-list { display: none; }
.tarefas-section__head--toggle.is-open .tarefas-section__chev { transform: rotate(180deg); }

.tarefas-section__empty {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--fg-4);
  flex-wrap: wrap;
}
.tarefas-section__empty .coach-ico { width: 15px; height: 15px; color: var(--fg-5); flex: 0 0 auto; }

.tarefas-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Card individual de tarefa */
.task-card {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  transition: border-color var(--duration), box-shadow var(--duration), background var(--duration);
  position: relative;
}
.task-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card);
}
.task-card.is-late {
  border-left: 3px solid var(--danger);
  padding-left: 14px;
}
.task-card.is-completed {
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.task-card.is-completed .task-card__title {
  color: var(--fg-3);
  text-decoration: line-through;
  text-decoration-color: var(--fg-5);
  text-decoration-thickness: 1.5px;
}
.task-card.is-completed .task-card__desc { color: var(--fg-4); }
.task-card.is-completed .task-card__progress { display: none; }

/* Filter visibility (controlado por JS via classes no .task-card) */
.task-card[data-bucket="completed"] { display: none; }
.task-card[data-bucket="active"]    { display: grid; }
.tarefas-section.tarefas-completas .task-card[data-bucket="completed"] { display: grid; }
.tarefas-section.tarefas-completas .task-card[data-bucket="active"]    { display: none; }
/* Quando filter=todas: ambas sections visiveis. Quando ativas: so .tarefas-ativas.
   Quando concluidas: so .tarefas-completas. Controle via class no body do modal: */
.tarefas-modal[data-filter="ativas"]     .tarefas-completas,
.tarefas-modal[data-filter="concluidas"] .tarefas-ativas { display: none; }

/* Checkbox (quick complete) */
.task-card__checkbox {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  border: 2px solid var(--border-strong);
  border-radius: 6px;
  background: var(--bg);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0;
  transition: border-color var(--duration), background var(--duration), transform var(--duration);
}
.task-card__checkbox:hover:not(:disabled) {
  border-color: var(--success);
  background: #ecfdf5;
}
.task-card__checkbox.is-checked {
  background: var(--success);
  border-color: var(--success);
  cursor: default;
}
.task-card__checkbox.is-checked .coach-ico {
  width: 14px;
  height: 14px;
  color: #fff;
  stroke-width: 3;
}
.task-card__checkbox:disabled { cursor: default; }

.task-card__main { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.task-card__title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14.5px;
  line-height: 1.4;
  color: var(--fg-1);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.task-card__desc {
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.45;
  color: var(--fg-3);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.task-card__meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 2px;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--fg-4);
}
.task-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.task-meta-item .coach-ico { width: 13px; height: 13px; color: var(--fg-5); }
.task-meta-item.is-late { color: var(--danger); font-weight: 600; }
.task-meta-item.is-late .coach-ico { color: var(--danger); }
.task-meta-item--tag {
  background: var(--surface-muted);
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--fg-3);
  font-size: 11.5px;
}
.task-meta-item--tag .coach-ico { color: var(--fg-5); }

/* Marco 6.209 — chip "+N" pequeno (extra count em lembretes etc) */
.task-meta-extra {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 10px;
  background: var(--surface-muted);
  color: var(--fg-3);
  padding: 1px 5px;
  border-radius: 999px;
  margin-left: 2px;
  line-height: 1.5;
}

/* Marco 6.209 — highlight pulse animation apos complete de tarefa */
.task-card.is-highlighted {
  animation: tarefa-pulse 1.6s ease-out;
}
@keyframes tarefa-pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in oklab, var(--success-fg) 35%, transparent); }
  60%  { box-shadow: 0 0 0 8px color-mix(in oklab, var(--success-fg) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* Progress bar */
.task-card__progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}
.task-progress-track {
  flex: 1;
  height: 6px;
  background: var(--surface-muted);
  border-radius: 999px;
  overflow: hidden;
}
.task-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
  transition: width 320ms var(--ease);
}
.task-progress-fill--complete { background: var(--success); }
.task-progress-fill--success  { background: var(--success); }
.task-progress-fill--progress { background: var(--primary); }
.task-progress-fill--warning  { background: var(--warning); }

.task-progress-pct {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  min-width: 36px;
  text-align: right;
  color: var(--fg-3);
}
.task-progress-pct--complete { color: var(--success); }
.task-progress-pct--success  { color: var(--success); }
.task-progress-pct--progress { color: var(--primary-fg); }
.task-progress-pct--warning  { color: var(--warning); }

.task-card__actions {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  padding-top: 2px;
}
.task-card__actions .btn-ghost {
  height: 32px;
  width: 32px;
  padding: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
}
.task-card__actions .btn-ghost.is-danger { color: var(--danger); }
.task-card__actions .btn-ghost.is-danger:hover { background: var(--danger-soft); }

/* Empty state cheio (sem tarefas) */
.tarefas-empty {
  padding: 44px 24px 36px;
  text-align: center;
  background: var(--bg);
  border: 1px dashed var(--border-strong);
  border-radius: 14px;
  margin-bottom: 14px;
}
.tarefas-empty__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 16px;
  background: var(--primary-soft);
  color: var(--primary-fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tarefas-empty__icon .coach-ico { width: 28px; height: 28px; }
.tarefas-empty--success .tarefas-empty__icon {
  background: var(--success-soft);
  color: var(--success);
}
.tarefas-empty__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--fg-1);
  letter-spacing: -.005em;
  margin: 0 0 6px;
}
.tarefas-empty__text {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--fg-4);
  max-width: 42ch;
  margin: 0 auto 18px;
  line-height: 1.5;
}

/* Modal footer V3 (overrides BS3 .modal-footer) */
#modal-client-tasks .modal-footer,
.tarefas-modal .modal-foot {
  padding: 14px 22px;
  border-top: 1px solid var(--border-muted);
  background: var(--bg);
  border-radius: 0 0 16px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  #modal-client-tasks .modal-dialog {
    width: 100vw;
    max-width: 100vw;
    margin: 0;
  }
  #modal-client-tasks .modal-content { border-radius: 0; max-height: 100vh; min-height: 100vh; }
  .tarefas-modal .modal-head { border-radius: 0; padding: 14px 16px; }
  .tarefas-toolbar { padding: 10px 16px; gap: 8px; }
  .tarefas-toolbar #new-task,
  .tarefas-toolbar .cc-task-new {
    margin-left: 0;
    flex: 1 1 auto;
    order: 3;
  }
  .tarefas-counter { width: 100%; order: 2; }
  .tarefas-filters { order: 1; flex: 1 1 auto; }
  .tarefas-filter-btn { flex: 1; justify-content: center; }
  .tarefas-body.modal-body { padding: 12px 14px 18px; }
  .task-card {
    padding: 12px 14px;
    grid-template-columns: 24px 1fr;
    gap: 12px 10px;
  }
  .task-card__actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
    border-top: 1px dashed var(--border-muted);
    padding-top: 8px;
    margin-top: 4px;
  }
  .task-card.is-late { padding-left: 12px; }
  .task-card__title { font-size: 14px; }
  .task-card__meta { font-size: 11.5px; gap: 10px; }
}


/* ─── Form M10 — Editar / Criar tarefa (.te-* / .te-form-v3) ─ */
/*
 * Markup V3 do form de edicao de tarefa, renderizado dentro do
 * #modalAlterTarefas (BS3, em modal_tarefas.php — wrapper compartilhado
 * com 4 telas). O view coach/view_form_tarefa.php emite o conteudo
 * com classe .te-form-v3 wrapper, escopando os styles. Header e foot
 * do BS3 modal continuam legacy (sem mexer pra nao quebrar outras telas).
 *
 * Origem: docs/redesign-clientes-liderados/v2/tasks-modal.css
 * (task-edit-modal — sections + fields + chips + lembretes + slider).
 */
.te-form-v3 {
  background: var(--surface-muted);
  padding: 4px 0 14px;
  margin: -12px -14px -14px;
  /* Compensa o padding default do BS3 modal-body pra ficar bleed. */
}

.te-form-v3 .te-section {
  background: var(--bg);
  border: 1px solid var(--border-default);
  border-radius: 14px;
  margin: 14px 14px 0;
  overflow: hidden;
}
.te-form-v3 .te-section__head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--border-muted);
  background: rgba(241, 245, 249, .3);
}
.te-form-v3 .te-section__num {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary-fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.te-form-v3 .te-section__title {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.te-form-v3 .te-section__title .coach-ico {
  width: 13px;
  height: 13px;
  color: var(--primary-fg);
}
.te-form-v3 .te-section__hint {
  font-family: var(--font-sans);
  font-size: 11.5px;
  color: var(--fg-4);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}
.te-form-v3 .te-section__body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Field (label + input) */
.te-form-v3 .te-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}
.te-form-v3 .te-field > label {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 12.5px;
  color: var(--fg-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}
.te-form-v3 .te-required { color: var(--danger); font-weight: 700; }
.te-form-v3 .te-optional {
  color: var(--fg-5);
  font-weight: 400;
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: .04em;
  margin-left: 4px;
}
.te-form-v3 .te-input,
.te-form-v3 textarea.te-input {
  width: 100%;
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--border-default);
  background: var(--bg);
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--fg-1);
  box-sizing: border-box;
  transition: border-color var(--duration), box-shadow var(--duration);
  box-shadow: none;
}
.te-form-v3 textarea.te-input {
  height: auto;
  min-height: 84px;
  padding: 10px 14px;
  resize: vertical;
  line-height: 1.5;
}
.te-form-v3 .te-input::placeholder,
.te-form-v3 textarea.te-input::placeholder { color: var(--fg-5); }
.te-form-v3 .te-input:focus,
.te-form-v3 textarea.te-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29,78,216,.12);
}
.te-form-v3 .te-input.is-invalid { border-color: var(--danger); }

/* Input com icone leading */
.te-form-v3 .te-input-wrap { position: relative; }
.te-form-v3 .te-input-wrap > .coach-ico {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--fg-5);
  pointer-events: none;
}
.te-form-v3 .te-input-wrap .te-input { padding-left: 36px; }
.te-form-v3 .te-input--date {
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .02em;
}

.te-form-v3 .te-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* All-day checkbox row */
.te-form-v3 .te-checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--fg-2);
  cursor: pointer;
  font-weight: 500;
  user-select: none;
}
.te-form-v3 .te-checkbox-inline input[type=checkbox] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  margin: 0;
}

/* Repetição chips */
.te-form-v3 .te-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.te-form-v3 .te-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-default);
  background: var(--bg);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--fg-3);
  transition: background var(--duration), border-color var(--duration), color var(--duration);
  font-weight: 500;
}
.te-form-v3 .te-chip:hover {
  border-color: var(--border-strong);
  color: var(--fg-1);
  background: var(--surface-muted);
}
.te-form-v3 .te-chip .coach-ico { width: 12px; height: 12px; opacity: .55; }
.te-form-v3 .te-chip.is-on {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-fg);
  font-weight: 600;
}
.te-form-v3 .te-chip.is-on .coach-ico { opacity: 1; }

/* Lembretes (notifications) */
.te-form-v3 .te-lembretes-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.te-form-v3 .te-lembrete-row {
  display: grid;
  grid-template-columns: 80px 140px 1fr 28px;
  gap: 8px;
  align-items: center;
  padding: 6px 8px 6px 4px;
  background: var(--surface-muted);
  border-radius: 10px;
  border: 1px solid transparent;
  transition: border-color var(--duration), background var(--duration);
}
.te-form-v3 .te-lembrete-row:hover {
  background: #f0f4ff;
  border-color: var(--border-muted);
}
.te-form-v3 .te-lembrete-row .te-input {
  height: 32px;
  font-size: 13px;
  background: var(--bg);
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  padding: 0 6px;
}
.te-form-v3 .te-lembrete-row select.te-input {
  height: 32px;
  font-size: 12.5px;
  padding: 0 28px 0 10px;
  background-color: var(--bg);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  cursor: pointer;
  text-align: left;
}
.te-form-v3 .te-lembrete-row__remove {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 0;
  background: transparent;
  color: var(--fg-4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--duration), color var(--duration);
}
.te-form-v3 .te-lembrete-row__remove:hover {
  background: var(--danger-soft);
  color: var(--danger);
}
.te-form-v3 .te-lembrete-row__remove .coach-ico { width: 14px; height: 14px; }


/* ─── Marco 6.55 — linha de lembrete adicionada (partial notification.php:
 * markup BS3 legado com #nmethod/#ntime/#ntype/.nclose + <style> inline que
 * força background:#FFF !important) repaginada V3 DENTRO do #modalAlterTarefas.
 * Override escopado (não toca o partial compartilhado com a agenda legacy);
 * vence o inline via especificidade id+id + !important. ─────────────────── */
#modalAlterTarefas #notifications .notification {
  display: flex !important;
  align-items: center;
  gap: 8px;
  width: 100%;
  float: none;
  margin: 0;
  padding: 6px 8px 6px 10px;
  background: var(--surface-muted);
  border: 1px solid transparent;
  border-radius: 10px;
  transition: border-color var(--duration), background var(--duration);
}
#modalAlterTarefas #notifications .notification:hover {
  border-color: var(--border-muted);
}
#modalAlterTarefas #notifications .notification > section {
  float: none;
  width: auto;
  padding: 0;
  margin: 0;
}
#modalAlterTarefas #notifications .notification #nmethod,
#modalAlterTarefas #notifications .notification #ntype {
  min-width: 120px;
}
#modalAlterTarefas #notifications .notification #ntime {
  width: 56px !important;
  text-align: center;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
#modalAlterTarefas #notifications .notification input,
#modalAlterTarefas #notifications .notification select {
  height: 34px !important;
  width: 100%;
  background-color: var(--bg) !important;
  border: 1px solid var(--border-default) !important;
  border-radius: 8px !important;
  color: var(--fg-1) !important;
  font-family: var(--font-sans);
  font-size: 12.5px;
  padding: 0 10px;
  outline: none;
  box-shadow: none !important;
}
#modalAlterTarefas #notifications .notification input:focus,
#modalAlterTarefas #notifications .notification select:focus {
  border-color: var(--primary) !important;
}
#modalAlterTarefas #notifications .notification select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 26px;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5'><polyline points='6 9 12 15 18 9'/></svg>") !important;
  background-repeat: no-repeat !important;
  background-position: right 8px center !important;
}
/* botão remover — .nclose com <i class="fa fa-times-circle"> */
#modalAlterTarefas #notifications .notification .nclose {
  float: none;
  width: 28px;
  min-width: 28px;
  height: 28px;
  margin-left: auto;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--duration);
}
#modalAlterTarefas #notifications .notification .nclose:hover {
  background: var(--danger-soft);
}
#modalAlterTarefas #notifications .notification .nclose i {
  padding: 0 !important;
  font-size: 15px !important;
  color: var(--danger) !important;
  line-height: 1;
}


.te-form-v3 .te-presets-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.te-form-v3 .te-preset {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px dashed var(--border-strong);
  color: var(--fg-3);
  font-family: var(--font-sans);
  font-size: 12px;
  cursor: pointer;
  transition: background var(--duration), border-color var(--duration), color var(--duration);
}
.te-form-v3 .te-preset:hover {
  border-style: solid;
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-fg);
}
.te-form-v3 .te-preset .coach-ico { width: 12px; height: 12px; }

.te-form-v3 .te-empty-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 12.5px;
  color: var(--fg-4);
  padding: 8px 0 2px;
  font-style: italic;
}
.te-form-v3 .te-empty-line .coach-ico { width: 13px; height: 13px; color: var(--fg-5); }

/* Progresso (slider V3 nativo) */
.te-form-v3 .te-progress {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.te-form-v3 .te-progress__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.te-form-v3 .te-progress__label {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--fg-2);
}
.te-form-v3 .te-progress__value {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  color: var(--fg-1);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  line-height: 1;
}
.te-form-v3 .te-progress__value-sym {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg-4);
}
.te-form-v3 .te-progress__value--success { color: var(--success); }
.te-form-v3 .te-progress__value--warning { color: var(--warning); }
.te-form-v3 .te-progress__value--danger  { color: var(--danger); }

.te-form-v3 .te-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: var(--border-default);
  background-image: linear-gradient(to right, var(--te-slider-fill, var(--primary)) 0%, var(--te-slider-fill, var(--primary)) var(--te-fill-pct, 0%), transparent var(--te-fill-pct, 0%), transparent 100%);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
  margin: 0;
}
.te-form-v3 .te-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--te-slider-fill, var(--primary));
  cursor: grab;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
  transition: transform .12s;
}
.te-form-v3 .te-slider::-webkit-slider-thumb:hover { transform: scale(1.12); }
.te-form-v3 .te-slider::-webkit-slider-thumb:active { cursor: grabbing; }
.te-form-v3 .te-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--te-slider-fill, var(--primary));
  cursor: grab;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
}
.te-form-v3 .te-slider-marks {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--fg-5);
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
.te-form-v3 .te-progress__shortcut { display: flex; }
.te-form-v3 .te-shortcut-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 12.5px;
  cursor: pointer;
  margin-left: auto;
}
.te-form-v3 .te-shortcut-btn:hover {
  background: var(--success-solid);
  color: #fff;
}
.te-form-v3 .te-shortcut-btn .coach-ico { width: 14px; height: 14px; }


/* ============================================================
 * Marco 6.55 — widget de progresso V3 no #tarefas-slider
 * (.delegado-tarefa), FORA do .te-form-v3. Reusa o design
 * .te-progress/.te-slider re-escopado sob `#tarefas-slider.te-progress-host`
 * (classe que generate_slider_task adiciona ao #tarefas-slider).
 * Vale no líder e nas sessões do coach — ambos carregam este CSS.
 * ============================================================ */
#tarefas-slider.te-progress-host {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 4px 2px 2px;
}
#tarefas-slider.te-progress-host .te-progress-caption {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-2);
}
#tarefas-slider.te-progress-host .te-progress-participantes { margin: 0; }
#tarefas-slider.te-progress-host .te-progress {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface-muted);
  border: 1px solid var(--border-default);
  border-radius: 12px;
}
#tarefas-slider.te-progress-host .te-progress__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
#tarefas-slider.te-progress-host .te-progress__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--fg-2);
}
#tarefas-slider.te-progress-host .te-progress__value {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  color: var(--fg-1);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  line-height: 1;
}
#tarefas-slider.te-progress-host .te-progress__value-sym {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-4);
}
#tarefas-slider.te-progress-host .te-progress__value--success { color: var(--success); }
#tarefas-slider.te-progress-host .te-progress__value--warning { color: var(--warning); }
#tarefas-slider.te-progress-host .te-progress__value--danger  { color: var(--danger); }
#tarefas-slider.te-progress-host .te-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: var(--border-default);
  background-image: linear-gradient(to right, var(--te-slider-fill, var(--primary)) 0%, var(--te-slider-fill, var(--primary)) var(--te-fill-pct, 0%), transparent var(--te-fill-pct, 0%), transparent 100%);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
  margin: 0;
}
#tarefas-slider.te-progress-host .te-slider:disabled { cursor: default; opacity: .9; }
#tarefas-slider.te-progress-host .te-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--te-slider-fill, var(--primary));
  cursor: grab;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
  transition: transform .12s;
}
#tarefas-slider.te-progress-host .te-slider:disabled::-webkit-slider-thumb { cursor: default; }
#tarefas-slider.te-progress-host .te-slider::-webkit-slider-thumb:hover { transform: scale(1.12); }
#tarefas-slider.te-progress-host .te-slider::-webkit-slider-thumb:active { cursor: grabbing; }
#tarefas-slider.te-progress-host .te-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--te-slider-fill, var(--primary));
  cursor: grab;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
}
#tarefas-slider.te-progress-host .te-slider-marks {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--fg-5);
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
#tarefas-slider.te-progress-host .te-progress__shortcut { display: flex; }
#tarefas-slider.te-progress-host .te-shortcut-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 12.5px;
  cursor: pointer;
  margin-left: auto;
}
#tarefas-slider.te-progress-host .te-shortcut-btn:hover { background: var(--success-solid); color: #fff; }
#tarefas-slider.te-progress-host .te-shortcut-btn:disabled { opacity: .5; cursor: not-allowed; }
#tarefas-slider.te-progress-host .te-shortcut-btn--ghost {
  margin-left: 0;
  background: transparent;
  color: var(--fg-2);
  border-color: var(--border-default);
}
#tarefas-slider.te-progress-host .te-shortcut-btn--ghost:hover { background: var(--surface-muted); color: var(--fg-1); }


/* Mobile */
@media (max-width: 600px) {
  .te-form-v3 .te-section { margin: 12px 8px 0; }
  .te-form-v3 .te-grid-2 { grid-template-columns: 1fr; }
  .te-form-v3 .te-lembrete-row { grid-template-columns: 64px 1fr 28px; }
  .te-form-v3 .te-lembrete-row__when { display: none; }
}


/* ─── M10 V3.5 — Modal wrapper (#modalAlterTarefas) ─────────
 *
 * Marco 5.14: header/footer BS3 do wrapper #modalAlterTarefas
 * substituidos por markup V3 (.modal-head + .te-foot). Mantemos
 * o wrapper BS3 .modal/.modal-dialog pra compat com handlers
 * legacy ($.modal('show')).
 *
 * Aplicado via classe .te-modal no wrapper.
 * --------------------------------------------------------- */

.te-modal .modal-content {
  border-radius: 16px;
  border: 0;
  box-shadow: var(--shadow-modal, 0 10px 25px -5px rgba(11,18,32,.22), 0 8px 10px -6px rgba(11,18,32,.10));
}

.te-modal .modal-head {
  padding: 18px 22px 14px;
  background: var(--bg);
  border: 0;
  border-bottom: 1px solid var(--border-muted);
  border-radius: 16px 16px 0 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.te-modal .modal-head .modal-head-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}
.te-modal .modal-head .modal-head-text { min-width: 0; }
.te-modal .modal-head .modal-head-text h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  color: var(--fg-1);
  margin: 0;
  letter-spacing: -.01em;
}
.te-modal .modal-head .modal-head-text .cc-eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-5);
  margin-bottom: 2px;
}

/* Variante de cor do icone — warning/orange pra tarefas */
.modal-head-icon--tarefa {
  background: var(--warning-soft) !important;
  color: var(--warning) !important;
}

/* Footer V3 — Excluir esquerda + Cancelar/Salvar direita */
.te-modal .te-foot,
.modal-foot.te-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  background: var(--bg);
  border-top: 1px solid var(--border-muted);
  border-radius: 0 0 16px 16px;
}
.te-foot__left { display: flex; align-items: center; gap: 8px; }
.te-foot__spacer { flex: 1; }
.te-foot__right { display: flex; align-items: center; gap: 8px; }

/* Botao ghost com tom danger (Excluir) — versao global,
   complementa .task-card__actions .btn-ghost.is-danger ja escopado */
.btn.btn-ghost {
  background: transparent;
  border: 1px solid transparent;
  color: var(--fg-3);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 13.5px;
  cursor: pointer;
  transition: background var(--duration), color var(--duration), border-color var(--duration);
}
.btn.btn-ghost:hover { background: var(--surface-muted, #f1f5f9); color: var(--fg-1); }
.btn.btn-ghost.is-danger { color: var(--danger); }
.btn.btn-ghost.is-danger:hover { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.btn.btn-ghost .coach-ico { width: 14px; height: 14px; }

/* Botao salvar primary com icone */
.te-modal .btn.btn-primary .coach-ico { width: 14px; height: 14px; }

/* Mobile — empilha excluir embaixo */
@media (max-width: 540px) {
  .te-modal .te-foot { flex-wrap: wrap; }
  .te-foot__left { order: 2; width: 100%; justify-content: center; }
  .te-foot__spacer { display: none; }
  .te-foot__right { order: 1; width: 100%; justify-content: space-between; }
  .te-foot__right .btn { flex: 1; justify-content: center; }
}


/* ─── Modal M05 — Objetivos do cliente (.objs-* / .obj-*) ── */
/*
 * Lista de objetivos compartilhados com o coach. Renderizado dentro
 * do #modal-generic .modal-body via load_view (handler .obj em
 * js_coache.js:235). O wrapper BS3 do #modal-generic continua legacy;
 * so o conteudo da view coach/list_objects.php e V3.5.
 *
 * Sub-modal de validacao (M04) reusa o mesmo #modal-generic com
 * footer custom (#confirm-check-obj, #request-check-obj). Handlers
 * legacy em js_coache.js:270+ permanecem inalterados.
 */
.objs-modal { padding: 0; }

.objs-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 4px 0 14px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border-muted);
}
.objs-filters {
  display: inline-flex;
  background: var(--surface-muted);
  border-radius: 9px;
  padding: 3px;
  gap: 2px;
  flex-wrap: wrap;
}
.objs-filter-btn {
  height: 30px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 12.5px;
  color: var(--fg-4);
  border-radius: 7px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background var(--duration), color var(--duration);
  white-space: nowrap;
}
.objs-filter-btn:hover { color: var(--fg-2); }
.objs-filter-btn.is-on {
  background: var(--bg);
  color: var(--primary-fg);
  box-shadow: var(--shadow-sm);
}
.objs-filter-count {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 10px;
  background: var(--surface-muted);
  color: var(--fg-3);
  padding: 1px 6px;
  border-radius: 999px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
.objs-filter-btn.is-on .objs-filter-count {
  background: var(--primary-soft);
  color: var(--primary-fg);
}
.objs-counter {
  font-family: var(--font-sans);
  font-size: 12.5px;
  color: var(--fg-4);
  margin-left: auto;
  white-space: nowrap;
}
.objs-counter strong {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--fg-1);
  font-variant-numeric: tabular-nums;
}

.objs-body {
  max-height: 60vh;
  overflow-y: auto;
  padding: 14px 2px 8px;
}

.objs-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Filtering: data-filter no .objs-modal controla quais cards aparecem */
.objs-modal[data-filter="in_progress"] .obj-card:not([data-bucket="in_progress"]),
.objs-modal[data-filter="completed"]   .obj-card:not([data-bucket="completed"]),
.objs-modal[data-filter="pending"]     .obj-card:not([data-bucket="pending"]) {
  display: none;
}

/* Card de objetivo */
.obj-card {
  background: var(--bg);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  padding: 16px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color var(--duration), box-shadow var(--duration);
}
.obj-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card);
}
.obj-card.is-late {
  border-left: 3px solid var(--danger);
  padding-left: 16px;
}

.obj-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* Status pill */
.obj-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 11.5px;
  border: 1px solid transparent;
}
.obj-status .coach-ico { width: 12px; height: 12px; }
.obj-status--pending    { background: var(--surface-muted); color: var(--fg-3); border-color: var(--border-default); }
.obj-status--in_progress { background: var(--primary-soft); color: var(--primary-fg); border-color: rgba(29,78,216,.2); }
.obj-status--validated  { background: var(--success-soft); color: var(--success); border-color: #a7f3d0; }
.obj-status--completed  { background: var(--success-soft); color: var(--success); border-color: #a7f3d0; }
.obj-status--adjustments{ background: var(--warning-soft); color: var(--warning); border-color: #fde68a; }

.obj-updated {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-sans);
  font-size: 11.5px;
  color: var(--fg-4);
}
.obj-updated .coach-ico { width: 12px; height: 12px; color: var(--fg-5); }

.obj-card__title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--fg-1);
  margin: 0;
}

.obj-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--fg-4);
}
.obj-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.obj-meta-item .coach-ico { width: 13px; height: 13px; color: var(--fg-5); }
.obj-meta-item.is-late { color: var(--danger); font-weight: 600; }
.obj-meta-item.is-late .coach-ico { color: var(--danger); }

.obj-progress {
  display: flex;
  align-items: center;
  gap: 12px;
}
.obj-progress-track {
  flex: 1;
  height: 6px;
  background: var(--surface-muted);
  border-radius: 999px;
  overflow: hidden;
}
.obj-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
  transition: width 320ms var(--ease);
}
.obj-progress-fill--success { background: var(--success); }
.obj-progress-fill--warning { background: var(--warning); }
.obj-progress-fill--danger  { background: var(--danger); }
.obj-progress-pct {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  min-width: 36px;
  text-align: right;
  color: var(--fg-3);
}

.obj-card__foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-muted);
}
.obj-card__spacer { flex: 1; }

/* Validated badge (substitui o botao validar quando ja validado) */
.obj-card__foot .is-validated {
  color: var(--success);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
}
.obj-card__foot .is-validated .coach-ico { width: 14px; height: 14px; }

/* Empty state */
.objs-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 24px 36px;
  background: var(--bg);
  border: 1px dashed var(--border-strong);
  border-radius: 14px;
}
.objs-empty__icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--primary-soft);
  color: var(--primary-fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.objs-empty__icon .coach-ico { width: 28px; height: 28px; }
.objs-empty h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--fg-1);
  margin: 0 0 6px;
}
.objs-empty p {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--fg-4);
  max-width: 42ch;
  margin: 0 0 16px;
  line-height: 1.5;
}


/* ─── Sub-modal M04 — Validar plano de acao (.check-obj-*) ── */
/*
 * Renderizado pelo handler .check-obj (js_coache.js:270) substituindo
 * o .modal-body do #modal-generic. Mostra contexto do objetivo + 2
 * textareas (comentarios / sugestoes). Botoes salvar ficam no footer
 * legacy (#confirm-check-obj, #request-check-obj).
 */
.co-card {
  background: var(--surface-muted);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.co-card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.co-card__icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary-fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.co-card__icon .coach-ico { width: 16px; height: 16px; }
.co-card__title {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-4);
  margin: 0;
}
.co-card__client {
  font-family: var(--font-sans);
  font-size: 12.5px;
  color: var(--fg-3);
}
.co-card__client strong {
  color: var(--fg-1);
  font-weight: 600;
}
.co-card__desc {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 14px;
  color: var(--fg-1);
  line-height: 1.45;
}
.co-form { display: flex; flex-direction: column; gap: 14px; }
.co-field { display: flex; flex-direction: column; gap: 6px; }
.co-field label {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 12.5px;
  color: var(--fg-2);
  margin: 0;
}
.co-field textarea {
  width: 100%;
  min-height: 80px;
  padding: 10px 14px;
  border: 1px solid var(--border-default);
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 13.5px;
  color: var(--fg-1);
  resize: vertical;
  line-height: 1.5;
  box-shadow: none;
  transition: border-color var(--duration), box-shadow var(--duration);
}
.co-field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29,78,216,.12);
}


/* ─── Modal M03 — Liberar ferramentas / Permissoes (.perm-*) ─ */
/*
 * Lista de toggles de permissoes do cliente. Re-skin sobre o markup
 * legacy de coach/list_permissions.php (.onoffswitch-container com
 * label + input checkbox + onoffswitch BS3). O wrapper .perm-modal
 * adiciona a toolbar V3 (search + filter + bulk) e re-estiliza os
 * toggles existentes com cards V3.5 sem mexer nos IDs/classes que
 * o handler #change-permissions le pra salvar.
 *
 * Origem visual: docs/redesign-clientes-liderados/v2/permissions-modal.jsx
 */

/* Marco 6.188 — Constrain modal-generic width quando a view ativa
   e o list_permissions.php. Spec do mockup (permissions-modal.css:6):
     .modal-v3--lg { max-width: 760px; width: 92vw; }
   #modal-generic e' compartilhado por varias views (pesquisas,
   indicators, etc), entao o constraint usa :has() pra so' aplicar
   quando a .perm-modal esta presente no body. */
#modal-generic .modal-dialog:has(.perm-modal),
#modal-generic.has-perm-modal .modal-dialog {
  width: 92vw;
  max-width: 760px;
  margin: 30px auto;
}

/* Limpa o padding do .modal-body quando contem .perm-modal — o
   wrapper interno ja gerencia padding por secao. */
#modal-generic .modal-body:has(.perm-modal) {
  padding: 0 !important;
}

/* Modal-header em contexto V3 — remove a borda pesada do BS3,
   alinha o titulo e da estilo de eyebrow + clean.
   !important porque outro rule de .modal-header (legacy) usa
   !important pra padding 18px 22px. */
#modal-generic:has(.perm-modal) .modal-header {
  border-bottom: 1px solid var(--border-muted) !important;
  padding: 18px 20px 16px !important;
}
#modal-generic:has(.perm-modal) .modal-header .modal-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--fg-1);
  margin: 0;
  letter-spacing: -.01em;
}

/* Marco 6.194 — head rico: icon box + eyebrow + h2. Match com
   permissions-modal.jsx:278-290. Vive dentro do .modal-title legacy
   pra reaproveitar o button.close do BS3 ao lado. */
.perm-modal-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.perm-modal-head__icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--brand-wash, #eff6ff);
  color: var(--primary-fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.perm-modal-head__icon i,
.perm-modal-head__icon svg {
  width: 18px;
  height: 18px;
}
.perm-modal-head__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.perm-modal-head__eyebrow {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-5);
}
.perm-modal-head__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--fg-1);
  letter-spacing: -.01em;
  line-height: 1.2;
}
#modal-generic:has(.perm-modal) .modal-header .close {
  font-size: 24px;
  font-weight: 400;
  color: var(--fg-4);
  opacity: 1;
  text-shadow: none;
}
#modal-generic:has(.perm-modal) .modal-header .close:hover {
  color: var(--fg-1);
}

/* Modal-footer em contexto V3 — fundo claro + border-radius nas
   bordas inferiores do modal-content (BS3 default e' branco).
   Marco 6.191 — footer agora pode ter 2 blocos verticais:
   credits-banner (info/danger) + permissions-actions. Removi o padding
   padrao porque cada bloco tem o seu. */
#modal-generic:has(.perm-modal) .modal-footer {
  background: var(--surface-muted, #f1f5f9) !important;
  border-top: 1px solid var(--border-muted) !important;
  padding: 0 !important;
  border-radius: 0 0 8px 8px;
  display: flex;
  flex-direction: column;
}

/* ─── Marco 6.207/6.208 — modal Nova/Editar Tarefa V3 (#modalAlterTarefas) ──
 * Wrapper BS3 legacy compartilhado em 4 telas (view_coache, sessoes,
 * list_leaders_leds, view_gerenciar). Sobrescrevo o shell BS3 (dialog
 * width, header, body, footer) pra alinhar com o look V3 dos outros
 * modais (Realizar Pesquisa, Liberar Ferramentas, Dados do Cliente)
 * + alinhamento com o mockup Claude Design "Editar Tarefa.html".
 *
 * Body ja' usa .te-form-v3 — todos os estilos te-* funcionam aqui sem
 * scoping extra. So preciso ajustar o shell BS3 pra V3.
 *
 * Marco 6.208 — Refino visual conforme mockup tasks-modal.css:
 *  - Body bg surface-muted (cinza claro)
 *  - Sections como cards brancos com border + radius 14px (igual mockup)
 *  - Icon-box header com gradient sutil (.modal-head-icon--tarefa)
 *  - Sub-header de contexto (Sessao + Cliente)
 *  - Footer com layout te-foot (Excluir esquerda, Cancelar+Salvar direita)
 */
#modalAlterTarefas .modal-dialog {
  width: 92vw;
  max-width: 760px;
  margin: 30px auto;
}
#modalAlterTarefas .modal-content {
  border: 1px solid var(--border-muted);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, .15);
  overflow: hidden;
}
#modalAlterTarefas .modal-header {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border-muted);
  background: var(--surface-1, var(--bg));
  border-radius: 16px 16px 0 0;
  position: relative;
  display: block;
}
#modalAlterTarefas .modal-header .modal-title {
  margin: 0;
  padding-right: 32px;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.2;
}
#modalAlterTarefas .modal-header .close {
  position: absolute;
  top: 18px;
  right: 18px;
  font-size: 24px;
  font-weight: 400;
  color: var(--fg-4);
  opacity: 1;
  text-shadow: none;
  padding: 0;
  margin: 0;
  background: transparent;
  border: 0;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
#modalAlterTarefas .modal-header .close:hover {
  color: var(--fg-1);
  background: var(--surface-muted);
}

/* Icon-box variante "tarefa" — gradient tint + tamanho 44px (mockup spec) */
#modalAlterTarefas .perm-modal-head__icon.modal-head-icon--tarefa {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg,
    color-mix(in oklab, var(--brand-wash, #eff6ff) 90%, #fff),
    color-mix(in oklab, var(--brand-wash, #eff6ff) 50%, #fff));
  color: var(--primary-fg);
}
#modalAlterTarefas .perm-modal-head__icon.modal-head-icon--tarefa svg,
#modalAlterTarefas .perm-modal-head__icon.modal-head-icon--tarefa i {
  width: 22px;
  height: 22px;
}
#modalAlterTarefas .perm-modal-head__title {
  font-size: 19px;
}

/* Sub-header de contexto (Sessao + Cliente) — so visivel em edit mode */
#modalAlterTarefas .perm-modal-head__sub {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
  font-family: var(--font-sans);
  font-size: 12.5px;
  color: var(--fg-4);
}
#modalAlterTarefas .perm-modal-head__sub[hidden] { display: none; }
#modalAlterTarefas .perm-modal-head__sub svg,
#modalAlterTarefas .perm-modal-head__sub i {
  width: 12px;
  height: 12px;
  color: var(--fg-5);
}
#modalAlterTarefas .perm-modal-head__sub strong {
  font-weight: 600;
  color: var(--fg-2);
}
#modalAlterTarefas .perm-modal-head__sub em {
  font-style: normal;
  color: var(--fg-5);
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: .04em;
}

/* Body com bg surface-muted; sections viram cards brancos */
#modalAlterTarefas .modal-body {
  padding: 0 22px 18px;
  max-height: calc(85vh - 160px);
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--surface-muted, #f8fafc);
  /* Marco 6.55 — esconde a barra de rolagem (mantém scroll por roda/trackpad). */
  scrollbar-width: none;         /* Firefox */
  -ms-overflow-style: none;      /* Edge/IE legacy */
}
#modalAlterTarefas .modal-body::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* Marco 6.55 — remove o scroll ANINHADO do #tarefas-slider (inline
 * height:190px;overflow-y:auto do modal_tarefas.php): quando o widget de
 * progresso V3 está ativo, o container cresce e flui no modal-body, sem
 * barra interna. Só vale sob .te-progress-host (widget renderizado). */
#tarefas-slider.te-progress-host {
  height: auto !important;
  overflow: visible !important;
}
#modalAlterTarefas .modal-body .te-form-v3 {
  padding: 0;
}
#modalAlterTarefas .modal-body .te-section {
  background: var(--bg);
  border: 1px solid var(--border-default);
  border-radius: 14px;
  margin-top: 14px;
  overflow: hidden;
}
#modalAlterTarefas .modal-body .te-section:first-child { margin-top: 14px; }

/* Footer com layout te-foot (Excluir left / Cancelar+Salvar right) */
#modalAlterTarefas .modal-footer.te-foot {
  padding: 12px 22px;
  background: var(--bg);
  border-top: 1px solid var(--border-muted);
  border-radius: 0 0 16px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
}
#modalAlterTarefas .te-foot__left { flex-shrink: 0; }
#modalAlterTarefas .te-foot__spacer { flex: 1; }
#modalAlterTarefas .te-foot__right {
  display: flex;
  gap: 8px;
  align-items: center;
}
#modalAlterTarefas .btn.btn-ghost.is-danger { color: var(--danger-fg, #b91c1c); }
#modalAlterTarefas .btn.btn-ghost.is-danger:hover {
  background: var(--danger-bg, #fef2f2);
  color: var(--danger-fg, #b91c1c);
}

/* Estado is-busy: spinner + disabled visual */
#modalAlterTarefas .btn.is-busy {
  opacity: .65;
  cursor: not-allowed;
  pointer-events: none;
}
#modalAlterTarefas .btn.is-busy .te-btn-icon { display: none; }
#modalAlterTarefas .btn .te-spinner {
  display: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  animation: modal-tarefas-spin 720ms linear infinite;
}
#modalAlterTarefas .btn.is-busy .te-spinner { display: inline-block; }
@keyframes modal-tarefas-spin { to { transform: rotate(360deg); } }

/* Empty-line de lembretes — visivel so quando #notifications esta vazio */
#modalAlterTarefas .te-lembretes-list:empty + .te-lembretes-empty { display: flex; }
#modalAlterTarefas .te-lembretes-list:not(:empty) + .te-lembretes-empty { display: none; }

/* ─── Credits banner (Marco 6.191) ───────────────────────────
 * Inline no footer do modal de Liberar Ferramentas. Simula consumo
 * de creditos em tempo real conforme novas ferramentas sao liberadas.
 * 3 variantes:
 *   - info (default): "consumira X creditos, restarao Y"
 *   - info ("only blocking"): "nenhum credito sera consumido"
 *   - danger: "creditos insuficientes" + save disabled
 * Spec: permissions-modal.css:266 (credits-banner).
 */
.credits-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--warning-bg, #fffbeb);
  border-bottom: 1px solid color-mix(in oklab, var(--warning-fg, #b45309) 18%, var(--border-default, #e2e8f0));
  color: var(--warning-fg, #92400e);
}
.credits-banner[hidden] { display: none; }
.credits-banner .coach-ico,
.credits-banner svg,
.credits-banner i {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.credits-banner__text {
  flex: 1;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.45;
}
.credits-banner__text strong {
  font-family: var(--font-display);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: inherit;
}

.credits-banner--info {
  background: #eff6ff;
  color: #1e40af;
  border-bottom-color: color-mix(in oklab, #1d4ed8 18%, var(--border-default, #e2e8f0));
}
.credits-banner--info strong { color: #1e40af; }

.credits-banner--danger {
  background: var(--danger-soft, #fef2f2);
  color: var(--danger, #991b1b);
  border-bottom-color: color-mix(in oklab, var(--danger, #dc2626) 22%, var(--border-default, #e2e8f0));
}
.credits-banner--danger strong { color: var(--danger, #991b1b); }

/* ─── Permissions actions row ───────────────────────────────
 * Summary + Cancel + Save inline no footer, abaixo do banner. */
.permissions-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--surface-muted, #f1f5f9);
}
.permissions-actions .actions-summary {
  flex: 1;
  font-family: var(--font-sans);
  font-size: 12.5px;
  color: var(--fg-4);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.permissions-actions .actions-summary i,
.permissions-actions .actions-summary svg {
  width: 14px;
  height: 14px;
  color: var(--fg-5);
}
.permissions-actions .btn:disabled,
.permissions-actions .btn.is-disabled {
  opacity: .55;
  cursor: not-allowed;
}

.perm-modal { padding: 4px 0 0; }

/* ─── Modal "Realizar pesquisa" (Marco 6.204 M04) ─────────────
 * Reusa o scaffold do #modal-generic (head rico + footer V3,
 * Marco 6.188/6.194) mas com lista de pesquisas no padrao
 * .permission-row simplificado: icon + name + CTA "Realizar".
 *
 * Scope: aplicado via :has(.pesq-list) — quando o modal-body
 * contem essa classe, ativa os mesmos overrides de header/dialog
 * width usados pra Liberar Ferramentas. */
#modal-generic .modal-dialog:has(.pesq-list),
#modal-generic.has-pesq-list .modal-dialog {
  width: 92vw;
  max-width: 640px;
  margin: 30px auto;
}
#modal-generic .modal-body:has(.pesq-list) {
  padding: 0 !important;
}
#modal-generic:has(.pesq-list) .modal-header {
  border-bottom: 1px solid var(--border-muted) !important;
  padding: 18px 20px 16px !important;
}
#modal-generic:has(.pesq-list) .modal-footer {
  background: var(--surface-muted, #f1f5f9) !important;
  border-top: 1px solid var(--border-muted) !important;
  padding: 14px 20px !important;
  border-radius: 0 0 8px 8px;
  display: flex;
  justify-content: flex-end;
}

.pesq-list {
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.pesq-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-muted);
  background: var(--bg);
  transition: background var(--duration);
}
.pesq-item:hover { background: var(--bg-soft); }
.pesq-item:last-child { border-bottom: none; }
.pesq-item__icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--brand-wash, #eff6ff);
  color: var(--primary-fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.pesq-item__icon .coach-ico { width: 16px; height: 16px; }
.pesq-item__main { min-width: 0; }
.pesq-item__name {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14px;
  color: var(--fg-1);
  line-height: 1.35;
}
.pesq-item__cta {
  flex-shrink: 0;
}

/* Empty state */
.pesq-empty {
  padding: 48px 24px;
  text-align: center;
}
.pesq-empty .coach-ico {
  width: 32px;
  height: 32px;
  color: var(--fg-5);
  margin-bottom: 12px;
}
.pesq-empty__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  color: var(--fg-2);
  margin: 0 0 4px;
}
.pesq-empty__desc {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--fg-4);
  margin: 0;
}

.perm-toolbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px 14px;
  align-items: center;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: var(--bg);
  border: 1px solid var(--border-default);
  border-radius: 12px;
}
.perm-search {
  position: relative;
}
.perm-search > .coach-ico {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--fg-5);
  pointer-events: none;
}
.perm-search input {
  width: 100%;
  height: 38px;
  padding: 0 36px 0 38px;
  border: 1px solid var(--border-default);
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 13.5px;
  color: var(--fg-1);
  background: var(--bg);
  transition: border-color var(--duration), box-shadow var(--duration);
}
.perm-search input::placeholder { color: var(--fg-5); }
.perm-search input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29,78,216,.12);
}

.perm-filters {
  display: inline-flex;
  background: var(--surface-muted);
  border-radius: 9px;
  padding: 3px;
  gap: 2px;
}
.perm-filter-btn {
  height: 30px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 12.5px;
  color: var(--fg-4);
  border-radius: 7px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background var(--duration), color var(--duration);
  white-space: nowrap;
}
.perm-filter-btn:hover { color: var(--fg-2); }
.perm-filter-btn.is-on {
  background: var(--bg);
  color: var(--primary-fg);
  box-shadow: var(--shadow-sm);
}
.perm-filter-count {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 10px;
  background: var(--surface-muted);
  color: var(--fg-3);
  padding: 1px 6px;
  border-radius: 999px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
.perm-filter-btn.is-on .perm-filter-count {
  background: var(--primary-soft);
  color: var(--primary-fg);
}

.perm-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--border-muted);
  padding-top: 10px;
}
.perm-counter {
  font-family: var(--font-sans);
  font-size: 12.5px;
  color: var(--fg-4);
}
.perm-counter strong {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--fg-1);
  font-variant-numeric: tabular-nums;
}
.perm-bulk {
  margin-left: auto;
  display: inline-flex;
  gap: 6px;
}
.perm-bulk-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  background: var(--bg);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--fg-2);
  cursor: pointer;
  transition: border-color var(--duration), background var(--duration);
}
.perm-bulk-btn:hover { border-color: var(--primary); color: var(--primary-fg); }
.perm-bulk-btn .coach-ico { width: 12px; height: 12px; }
.perm-bulk-btn.is-danger:hover { border-color: var(--danger); color: var(--danger); }


/* Dirty counter — Marco 5.10 — visivel quando ha alteracoes pendentes */
.perm-counter--dirty {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: var(--warning-bg);
  color: var(--warning-fg);
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
}
.perm-counter--dirty .coach-ico { width: 13px; height: 13px; }
.perm-counter--dirty strong {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--warning-fg);
  font-variant-numeric: tabular-nums;
}
.perm-counter--dirty[hidden] { display: none; }


/* Container raiz (#opcionais) e body do modal */
.perm-modal__body { padding: 0; }
.perm-modal #opcionais {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0;
}
.perm-modal h5 {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin: 18px 4px 8px;
  padding: 0;
}


/* ─── Categoria colapsavel (.perm-section) ─────────────────── */
/*
 * Marco 6.189 — Reescrito 1:1 com mockup (permissions-modal.css:101).
 * Sections sao agrupamentos colapsaveis com header sticky monocromatico
 * (eyebrow style) e rows flat com border-bottom. NAO mais cards.
 */
.perm-section {
  padding-bottom: 4px;
  background: var(--bg);
}
.perm-section[hidden] { display: none; }

.perm-section__header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 20px;
  background: var(--surface-muted, #f1f5f9);
  border: 0;
  border-bottom: 1px solid var(--border-muted);
  text-align: left;
  cursor: pointer;
  user-select: none;
  transition: background var(--duration);
}
.perm-section__header:hover { background: #e9eef5; }
.perm-section__header:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

/* Marco 6.194 — agrupa esquerda (chevron+icon+label) e direita (count+bulk)
   pra match spec mockup (permissions-modal.jsx:370-384). */
.perm-section__title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.perm-section__meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.perm-section__chevron {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-4);
  transition: transform var(--duration);
}
.perm-section__chevron .coach-ico { width: 12px; height: 12px; }
.perm-section.is-collapsed .perm-section__chevron { transform: rotate(-90deg); }

.perm-section__icon {
  display: inline-flex;
  align-items: center;
  width: 16px;
  height: 16px;
  color: var(--fg-4);
}
.perm-section__icon .coach-ico { width: 16px; height: 16px; }

.perm-section__label {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-3);
}

.perm-section__count {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--fg-4);
  font-variant-numeric: tabular-nums;
}
.perm-section__count strong {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--fg-3);
  font-variant-numeric: tabular-nums;
}

.perm-section__bulk {
  padding: 4px 10px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--primary-fg);
  background: transparent;
  border: 0;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  transition: background var(--duration);
  white-space: nowrap;
}
.perm-section__bulk:hover,
.perm-section__bulk:focus-visible {
  background: var(--brand-wash, #eff6ff);
  outline: none;
}

.perm-section__body {
  display: flex;
  flex-direction: column;
  padding: 0;
  background: var(--bg);
}
.perm-section.is-collapsed .perm-section__body { display: none; }


/* ─── Row de permissao individual (.permission-row) ─────────── */
/*
 * Marco 6.189 — Match 1:1 com permissions-modal.css:144.
 * Grid 36px / 1fr / auto — icone esquerda, nome+descricao centro,
 * toggle direita. Rows sao flat com border-bottom (NAO mais cards).
 * Toggle e' .toggle-v3 (substitui o BS3 onoffswitch legacy).
 *
 * Hooks legacy preservados:
 *   - input.leaders-permissions, stm attr, id="acesso-X" (js_coache.js:521)
 *   - .yes_disabled, .add-statement-extra (handlers auxiliares)
 */
.permission-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border-muted);
  background: var(--bg);
  transition: background var(--duration);
  position: relative;
}
.permission-row:hover { background: var(--bg-soft); }
.permission-row:last-child { border-bottom: none; }
.permission-row[hidden] { display: none !important; }

/* Marco 6.196 — highlight breve quando o usuario abre o modal via
   "Solicitar" no modal Dados do Cliente. Brand-wash com border-left
   colorida que fade out em ~2.4s. */
@keyframes perm-row-highlight {
  0%   { background: var(--brand-wash, #eff6ff); box-shadow: inset 4px 0 0 0 var(--brand-primary, #1d4ed8); }
  85%  { background: var(--brand-wash, #eff6ff); box-shadow: inset 4px 0 0 0 var(--brand-primary, #1d4ed8); }
  100% { background: var(--bg); box-shadow: inset 0 0 0 0 transparent; }
}
.permission-row.is-highlight {
  animation: perm-row-highlight 2400ms ease-out both;
}

/* Dirty state — barra lateral warning + bg amber suave + badge inline */
.permission-row.is-changed::before {
  content: "";
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--warning-fg);
  border-radius: 0 2px 2px 0;
}
.permission-row.is-changed { background: var(--warning-bg); }
.permission-row.is-changed:hover { background: color-mix(in oklab, var(--warning-bg) 60%, var(--bg)); }

.permission-row__icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--surface-muted);
  color: var(--fg-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.permission-row__icon .coach-ico { width: 16px; height: 16px; }
.permission-row.is-on .permission-row__icon {
  background: var(--brand-wash, #eff6ff);
  color: var(--primary-fg);
}

.permission-row__main { min-width: 0; }
.permission-row__name {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14px;
  color: var(--fg-1);
  display: flex;
  align-items: center;
  gap: 8px;
}
.permission-row__name label {
  margin: 0;
  cursor: pointer;
  font-weight: inherit;
  color: inherit;
}
.permission-row__name .badge-changed {
  display: none;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--warning-fg);
  background: var(--bg);
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid color-mix(in oklab, var(--warning-fg) 30%, var(--border-default));
}
.permission-row.is-changed .badge-changed { display: inline-flex; }

.permission-row__desc {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--fg-4);
  margin-top: 2px;
  line-height: 1.45;
}

/* ─── Toggle V3 (.toggle-v3) ─────────────────────────────────
 * Marco 6.189 — port do permissions-modal.css:201-238. Substitui o
 * BS3 onoffswitch (que ficava com Sim/Não em texto e visual quadrado).
 * Width 40px, height 22px, slider circular branco que translada 18px.
 * Verde quando :checked (usa --success-fg).
 */
.toggle-v3 {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
  margin: 0;
}
.toggle-v3 input[type="checkbox"] {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.toggle-v3__slider {
  position: absolute;
  inset: 0;
  background: var(--border-strong);
  border-radius: 11px;
  transition: background var(--duration) var(--ease);
  cursor: pointer;
}
.toggle-v3__slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2px;
  top: 2px;
  background: #fff; /* knob do toggle: branco nos dois temas */
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(11, 18, 32, .2);
  transition: transform var(--duration) var(--ease);
}
/* Marco 6.192 — toggle ON usa --brand-primary (= --owner-accent, ja
   coberto pelo inline override em template_sistema/empresa.php) em vez
   do --success-fg fixo. Mockup original usava success-fg porque era
   single-tenant Coachecom; no white-label cada owner pinta o toggle
   na cor da sua marca. */
.toggle-v3 input:checked + .toggle-v3__slider {
  background: var(--brand-primary, var(--owner-accent, #1d4ed8));
}
.toggle-v3 input:checked + .toggle-v3__slider::before {
  transform: translateX(18px);
}
.toggle-v3 input:disabled + .toggle-v3__slider {
  opacity: .5;
  cursor: not-allowed;
}
.toggle-v3 input:focus-visible + .toggle-v3__slider {
  box-shadow: 0 0 0 3px rgba(29, 78, 216, .25);
}


/* ─── Empty state da busca (.permissions-empty) ─────────────── */
.permissions-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px 16px;
  text-align: center;
  background: var(--surface-card);
  border: 1px dashed var(--border-default);
  border-radius: 12px;
}
.permissions-empty[hidden] { display: none; }
.permissions-empty > .coach-ico {
  width: 36px;
  height: 36px;
  color: var(--fg-5);
  margin-bottom: 4px;
}
.permissions-empty__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  color: var(--fg-2);
  margin: 0;
}
.permissions-empty__desc {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--fg-4);
  margin: 0;
  max-width: 360px;
}
.permissions-empty__btn {
  margin-top: 6px;
  padding: 7px 14px;
  background: var(--brand-primary);
  color: var(--on-accent, #fff);
  border: 0;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--duration);
}
.permissions-empty__btn:hover { background: var(--brand-hover); }


/* ─── Responsivo (@media ≤640px) ─────────────────────────────── */
@media (max-width: 640px) {
  .perm-section__header {
    grid-template-columns: 28px 1fr auto auto;
    gap: 8px;
  }
  .perm-section__count { display: none; }
  .perm-section__bulk {
    padding: 3px 8px;
    font-size: 11px;
  }
  .permission-row {
    grid-template-columns: 32px 1fr auto;
    gap: 10px;
    padding: 10px;
  }
  .permission-row__badge {
    grid-column: 2 / 4;
    grid-row: 2;
    justify-self: start;
    margin-top: 2px;
  }
  .permission-row.is-changed {
    grid-template-rows: auto auto;
  }
  .permission-row__icon {
    width: 32px;
    height: 32px;
  }
  .permission-row__icon .coach-ico { width: 16px; height: 16px; }
}


/* ─── Modal M07 — Diario positivo (.dp-*) ─────────────────── */
/*
 * Lista de perguntas do diario positivo do cliente. Renderizado em
 * #modal-generic .modal-body via refresh_question() (handler legacy
 * #verTextoDiario). 3 sub-views: lista (view_diarioPositivo),
 * banco de templates (view_perguntas_banco), editar pergunta
 * (view_action_pergunta).
 *
 * IDs/classes preservados: #criar, #buscarPerguntaBanco, #actionPergunta,
 * #insertPerguntaPadrao, #textAreaPergunta, #publicado, #plu1/#plu2,
 * #salvarPerguntaCoachee, #delete.
 */
.dp-modal { padding: 4px 0 0; }

.dp-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 4px 0 12px;
  border-bottom: 1px solid var(--border-muted);
  margin-bottom: 12px;
}
.dp-filters {
  display: inline-flex;
  background: var(--surface-muted);
  border-radius: 9px;
  padding: 3px;
  gap: 2px;
}
.dp-filter-btn {
  height: 30px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 12.5px;
  color: var(--fg-4);
  border-radius: 7px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.dp-filter-btn:hover { color: var(--fg-2); }
.dp-filter-btn.is-on {
  background: var(--bg);
  color: var(--primary-fg);
  box-shadow: var(--shadow-sm);
}
.dp-filter-count {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 10px;
  background: var(--surface-muted);
  color: var(--fg-3);
  padding: 1px 6px;
  border-radius: 999px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
.dp-filter-btn.is-on .dp-filter-count { background: var(--primary-soft); color: var(--primary-fg); }
.dp-actions {
  margin-left: auto;
  display: inline-flex;
  gap: 6px;
}

.dp-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dp-modal[data-dp-filter="publicadas"] .dp-pergunta[data-status="0"],
.dp-modal[data-dp-filter="despublicadas"] .dp-pergunta[data-status="1"] { display: none; }

.dp-pergunta {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  transition: border-color var(--duration), box-shadow var(--duration);
}
.dp-pergunta:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card);
}
.dp-pergunta[data-status="0"] {
  background: var(--surface-muted);
  opacity: .82;
}
.dp-pergunta__text {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 14px;
  color: var(--fg-1);
  line-height: 1.45;
  margin: 0;
}
.dp-pergunta__status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 11.5px;
  border: 1px solid transparent;
}
.dp-pergunta__status .coach-ico { width: 11px; height: 11px; }
.dp-pergunta__status--on {
  background: var(--success-soft);
  color: var(--success);
  border-color: #a7f3d0;
}
.dp-pergunta__status--off {
  background: var(--surface-muted);
  color: var(--fg-4);
  border-color: var(--border-default);
}
.dp-pergunta__edit {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--border-default);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-3);
  cursor: pointer;
  transition: border-color var(--duration), color var(--duration);
}
.dp-pergunta__edit:hover {
  border-color: var(--primary);
  color: var(--primary-fg);
}
.dp-pergunta__edit .coach-ico { width: 14px; height: 14px; }

/* Empty state pra primeiro uso */
.dp-empty {
  background: var(--bg);
  border: 1px dashed var(--border-strong);
  border-radius: 14px;
  padding: 36px 24px;
}
.dp-empty__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 16px;
  background: var(--primary-soft);
  color: var(--primary-fg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.dp-empty__icon .coach-ico { width: 28px; height: 28px; }
.dp-empty h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--fg-1);
  text-align: center;
  margin: 0 0 8px;
}
.dp-empty__list {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--fg-3);
  line-height: 1.6;
  padding-left: 18px;
  margin: 0 0 16px;
}
.dp-empty__list li + li { margin-top: 6px; }

/* Marco 6.213 — Empty state refinado (match mockup diario-modal.jsx:920-942).
   Title em display weight 700, text centrado max-width, steps com icon+span
   em vez de bullets, 2 CTAs alinhados (sem "ou" textual). */
.dp-empty__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--fg-1);
  text-align: center;
  margin: 0 0 8px;
  letter-spacing: -.005em;
}
.dp-empty__text {
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--fg-4);
  text-align: center;
  max-width: 50ch;
  margin: 0 auto 18px;
}
.dp-empty__text strong { color: var(--fg-2); font-weight: 600; }
.dp-empty__steps {
  list-style: none;
  padding: 0;
  margin: 0 auto 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
}
.dp-empty__steps li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface-muted);
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--fg-2);
}
.dp-empty__steps li .coach-ico {
  width: 16px;
  height: 16px;
  color: var(--primary-fg);
  flex-shrink: 0;
}

.dp-empty__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.dp-empty__cta .dp-or { color: var(--fg-5); font-size: 12px; }


/* Banco de perguntas (sub-modal) */
.dp-banco {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dp-banco__item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border-default);
  border-radius: 10px;
}
.dp-banco__item:hover { border-color: var(--primary); background: var(--primary-soft); }
.dp-banco__text {
  font-family: var(--font-sans);
  font-size: 13.5px;
  color: var(--fg-1);
  line-height: 1.45;
  margin: 0;
}


/* Editar pergunta (sub-modal) */
.dp-edit-form { display: flex; flex-direction: column; gap: 14px; }
.dp-edit-form textarea {
  width: 100%;
  min-height: 100px;
  padding: 12px 14px;
  border: 1px solid var(--border-default);
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--fg-1);
  resize: vertical;
  line-height: 1.5;
  box-shadow: none;
}
.dp-edit-form textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29,78,216,.12);
}
.dp-edit-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-sans);
  font-size: 12.5px;
  color: var(--fg-4);
}
.dp-edit-meta strong { color: var(--fg-1); font-weight: 600; }
.dp-publish-toggle {
  display: inline-flex;
  background: var(--surface-muted);
  border-radius: 9px;
  padding: 3px;
  gap: 2px;
}
.dp-publish-toggle label {
  height: 30px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 12.5px;
  color: var(--fg-4);
  border-radius: 7px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}
.dp-publish-toggle label.active {
  background: var(--bg);
  color: var(--primary-fg);
  box-shadow: var(--shadow-sm);
}
.dp-publish-toggle input[type=radio] {
  position: absolute;
  width: 0; height: 0;
  opacity: 0;
}


/* ─── Marco 5.15 — M07 V3.5 (header + acoes inline + sub-modais) ─ */

/* Esconde o header BS3 do #modal-generic / bootbox quando o body
   contem um .dp-modal__head (a view ja renderiza seu proprio header V3).
   Usa :has() — Chrome 105+ / Safari 15.4+ / Firefox 121+. */
.modal-content:has(> .modal-body .dp-modal__head) > .modal-header {
  display: none;
}
.modal-body > .dp-modal { padding-top: 0; }

/* Header V3 dedicado dos sub-modais do diario positivo
   (substitui o .modal-title BS3 do #modal-generic com markup mais rico).
   Marco 6.214 — display flex pra acomodar .dp-modal__close (X) na direita. */
.dp-modal__head,
.dp-edit-modal .dp-modal__head,
.dp-banco-modal .dp-modal__head {
  margin: -4px 0 16px;
  padding: 12px 0 14px;
  border-bottom: 1px solid var(--border-muted);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.dp-modal__head-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

/* Marco 6.214 — Botao X de fechar no header dos sub-modais do M07.
   O X nativo do shell #modal-generic (BS3 .close) e' escondido por
   `.modal-content:has(...dp-modal__head) > .modal-header { display: none }`,
   entao precisamos do nosso proprio botao dentro do .dp-modal__head.
   data-dismiss="modal" dispara o close do BS3 ($('#modal-generic').modal('hide')). */
.dp-modal__close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--fg-4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  margin: 0;
  transition: background var(--duration), color var(--duration);
}
.dp-modal__close:hover {
  background: var(--surface-muted);
  color: var(--fg-1);
}
.dp-modal__close:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.dp-modal__close .coach-ico {
  width: 18px;
  height: 18px;
}
.dp-modal__head-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary-fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dp-modal__head-icon .coach-ico { width: 20px; height: 20px; }
/* Marco 5.16 — variante do icon-head pro Sumario de carreiras */
.dp-modal__head-icon--sumario {
  background: var(--warning-soft);
  color: var(--warning);
}
.dp-modal__head-text { flex: 1; min-width: 0; }
.dp-modal__head-text .cc-eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-5);
  margin-bottom: 2px;
}
.dp-modal__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  color: var(--fg-1);
  margin: 0 0 4px;
  letter-spacing: -.01em;
}
.dp-modal__subtitle {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--fg-3);
  margin: 0;
  line-height: 1.5;
}
.dp-modal__subtitle strong { color: var(--fg-1); font-weight: 600; }

/* Acoes inline no card de pergunta (3 botoes lado a lado) */
.dp-pergunta__actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.dp-pergunta__action {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--border-default);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-3);
  cursor: pointer;
  transition: border-color var(--duration), color var(--duration), background var(--duration);
}
.dp-pergunta__action:hover { border-color: var(--primary); color: var(--primary-fg); }
.dp-pergunta__action .coach-ico { width: 14px; height: 14px; }
.dp-pergunta__delete:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }
.dp-toggle-publish[data-status="0"]:hover { border-color: var(--success); color: var(--success); background: var(--success-soft); }

/* Sub-modal Editar/Nova pergunta — fields V3 */
.dp-edit-modal,
.dp-banco-modal { padding: 4px 0 0; }
.dp-field { display: flex; flex-direction: column; gap: 6px; }
.dp-field__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-4);
}
.dp-field__label .coach-ico { width: 13px; height: 13px; }
.dp-textarea {
  width: 100%;
  min-height: 110px;
  padding: 12px 14px;
  border: 1px solid var(--border-default);
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--fg-1);
  resize: vertical;
  line-height: 1.5;
  box-shadow: none;
}
.dp-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29,78,216,.12);
}
.dp-field__hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--fg-4);
}
.dp-counter {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--fg-4);
}

/* Marco 6.213 — Counter inline no toolbar do M07 (formato "X perguntas · Y
   publicadas"). Override do .dp-counter base que era mono — aqui usa sans
   com numbers em bold/display. Match mockup diario-modal.jsx:383-389. */
.dp-toolbar .dp-counter {
  font-family: var(--font-sans);
  font-size: 12.5px;
  color: var(--fg-4);
  white-space: nowrap;
}
.dp-toolbar .dp-counter strong {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--fg-1);
  font-variant-numeric: tabular-nums;
}
.dp-toolbar .dp-counter-sub { color: var(--fg-4); margin-left: 2px; }
.dp-hint-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--fg-4);
}
.dp-hint-text .coach-ico { width: 12px; height: 12px; }

.dp-answer-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 12.5px;
  color: var(--fg-4);
}
.dp-answer-count .coach-ico { width: 13px; height: 13px; }
.dp-answer-count strong { color: var(--fg-1); font-weight: 600; }

/* Toolbar de busca do banco de perguntas (sub-modal) */
.dp-banco__toolbar {
  margin-bottom: 12px;
}
.dp-banco__search {
  position: relative;
  display: flex;
  align-items: center;
}
.dp-banco__search .coach-ico {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--fg-5);
  pointer-events: none;
}
.dp-banco__search-input {
  width: 100%;
  height: 38px;
  padding: 0 14px 0 36px;
  border: 1px solid var(--border-default);
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--fg-1);
  background: var(--bg);
}
.dp-banco__search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29,78,216,.12);
}
.dp-banco__empty-search {
  text-align: center;
  padding: 24px 16px;
  color: var(--fg-4);
  font-family: var(--font-sans);
  font-size: 13px;
}
.dp-banco__empty-search .dp-empty__icon {
  width: 44px; height: 44px;
  background: var(--surface-muted);
  color: var(--fg-5);
  margin: 0 auto 12px;
}
.dp-banco__empty-search .dp-empty__icon .coach-ico { width: 22px; height: 22px; }
.dp-banco__empty-search h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  color: var(--fg-2);
  margin: 0 0 4px;
}
.dp-banco__empty-search p { margin: 0; }

/* Variante inline do empty (usada no banco vazio) */
.dp-empty--inline {
  padding: 24px 16px;
  border: 0;
  background: transparent;
  text-align: center;
}
.dp-empty--inline h3 { font-size: 15px; margin: 0 0 4px; }
.dp-empty--inline p {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--fg-4);
  margin: 0;
}


/* ─── Marco 6.215 — Sub-modais M07 V3.5 (Nova/Editar pergunta + Banco) ──
 * Ports dos estilos do mockup diario-modal.css pras classes que a versao
 * Coachecom usa nos sub-modais (.pergunta-edit-modal, .banco-modal,
 * .cc-textarea, .cc-toggle-row, .cc-input, .banco-cats, .banco-grid,
 * .banco-card). Tokens Coachecom (--brand-primary, --fg-*, --surface-*).
 */

/* cc-field block — label + textarea + hint row (Nova/Editar) */
.cc-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cc-field__label {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 12.5px;
  color: var(--fg-2);
  letter-spacing: -.005em;
}
.cc-textarea {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--fg-1);
  background: var(--bg);
  border: 1px solid var(--border-default);
  border-radius: 10px;
  padding: 12px 14px;
  resize: vertical;
  min-height: 110px;
  transition: border-color var(--duration), box-shadow var(--duration);
}
.cc-textarea::placeholder { color: var(--fg-5); }
.cc-textarea:hover { border-color: var(--border-strong); }
.cc-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--primary) 18%, transparent);
}
.cc-field__hintrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.cc-field__hint {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--fg-4);
  flex: 1;
  min-width: 0;
}
.cc-field__counter {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: var(--fg-4);
  white-space: nowrap;
}
.cc-field__counter--warning { color: var(--warning-fg, #b45309); }
.cc-field__counter--danger  { color: var(--danger-fg, #b91c1c); }

/* Toggle row V3 (publicar / rascunho) — substitui btn-group BS3 */
.cc-toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  padding: 12px 14px;
  background: var(--surface-muted);
  border-radius: 10px;
  position: relative;
}
.cc-toggle-row--locked { cursor: default; }
.cc-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.cc-toggle-track {
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: var(--border-strong, #94a3b8);
  position: relative;
  flex: 0 0 auto;
  margin-top: 1px;
  transition: background var(--duration);
}
.cc-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff; /* knob do toggle: branco nos dois temas */
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transition: left var(--duration) var(--ease);
}
.cc-toggle:checked + .cc-toggle-track { background: var(--success-fg, #15803d); }
.cc-toggle:checked + .cc-toggle-track .cc-toggle-thumb { left: 18px; }
.cc-toggle:focus-visible + .cc-toggle-track {
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--primary) 25%, transparent);
}
.cc-toggle-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.cc-toggle-title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 13.5px;
  color: var(--fg-2);
}
.cc-toggle-help {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--fg-4);
  line-height: 1.5;
}

/* Pergunta edit modal layout */
.pergunta-edit-modal .pergunta-edit-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Banco modal — toolbar com search + categorias */
.banco-modal { padding: 0; }
.banco-toolbar {
  background: var(--bg);
  border-top: 1px solid var(--border-muted);
  border-bottom: 1px solid var(--border-muted);
  padding: 12px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 14px 0 0;
}

.cc-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.cc-input-wrap > .cc-input-icon {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--fg-5);
  pointer-events: none;
}
.cc-input {
  width: 100%;
  height: 38px;
  padding: 0 14px 0 36px;
  font-family: var(--font-sans);
  font-size: 13.5px;
  color: var(--fg-1);
  background: var(--surface-muted);
  border: 1px solid transparent;
  border-radius: 10px;
  transition: background var(--duration), border-color var(--duration), box-shadow var(--duration);
}
.cc-input::placeholder { color: var(--fg-5); }
.cc-input:hover { background: color-mix(in oklab, var(--surface-muted) 70%, var(--primary-soft)); }
.cc-input:focus {
  outline: none;
  background: var(--bg);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--primary) 18%, transparent);
}

.banco-cats {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.banco-cat-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  background: var(--surface-muted);
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 12px;
  color: var(--fg-3);
  cursor: pointer;
  transition: background var(--duration), color var(--duration), border-color var(--duration);
}
.banco-cat-btn:hover {
  background: color-mix(in oklab, var(--surface-muted) 60%, var(--primary-soft));
  color: var(--fg-1);
}
.banco-cat-btn.is-on {
  background: var(--primary-soft);
  color: var(--primary-fg);
  border-color: color-mix(in oklab, var(--primary) 30%, transparent);
}
.banco-cat-btn .coach-ico { width: 13px; height: 13px; }
.banco-cat-count {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 10px;
  color: var(--fg-4);
  font-variant-numeric: tabular-nums;
}
.banco-cat-btn.is-on .banco-cat-count { color: var(--primary-fg); }

/* Banco body com bg muted + grid 2 cols */
.banco-modal .banco-body {
  padding: 14px 0 18px;
  background: var(--surface-muted);
  margin: 0 -22px;
  padding-left: 22px;
  padding-right: 22px;
}
.banco-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Banco card — multi-select */
.banco-card {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  cursor: pointer;
  align-items: start;
  transition: border-color var(--duration), background var(--duration), box-shadow var(--duration);
  position: relative;
  margin: 0;
}
.banco-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.banco-card.is-checked {
  border-color: var(--primary);
  background: color-mix(in oklab, var(--primary-soft) 50%, var(--bg));
  box-shadow: 0 0 0 1px var(--primary);
}
.banco-card__check {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  clip: rect(0, 0, 0, 0);
}
.banco-card__visual {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid var(--border-strong);
  background: var(--bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  transition: background var(--duration), border-color var(--duration);
}
.banco-card__visual .banco-card__check-icon {
  width: 14px;
  height: 14px;
  color: #fff;
  stroke-width: 3;
  display: none;
}
.banco-card.is-checked .banco-card__visual {
  background: var(--primary);
  border-color: var(--primary);
}
.banco-card.is-checked .banco-card__visual .banco-card__check-icon { display: inline-block; }
.banco-card__check:focus-visible + .banco-card__visual {
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--primary) 25%, transparent);
}

.banco-card__main {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.banco-card__text {
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--fg-1);
  margin: 0;
}
.dp-banco-insert-single {
  align-self: flex-start;
  font-size: 11.5px;
}

/* Marco 6.216 — Tag de categoria no card. Cores diferenciadas por tema
   (gratidao = vermelho/coral, reflexao = roxo, conquistas = amarelo/ouro,
   aprendizados = verde). Match mockup diario-modal.css:744-760. */
.banco-card__cat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 9.5px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--fg-4);
  align-self: flex-start;
}
.banco-card__cat .coach-ico { width: 11px; height: 11px; }
.banco-card__cat--gratidao     { color: oklch(48% 0.18 25); }
.banco-card__cat--reflexao     { color: oklch(48% 0.16 290); }
.banco-card__cat--conquistas   { color: oklch(48% 0.16 70); }
.banco-card__cat--aprendizados { color: oklch(48% 0.14 165); }

/* Footer do banco com counter + action batch */
.banco-modal .banco-foot {
  border-top: 1px solid var(--border-muted);
  background: var(--bg);
  border-radius: 0 0 16px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  margin: 0 -22px;
}
.banco-counter {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--fg-4);
}
.banco-counter strong {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--fg-1);
  font-variant-numeric: tabular-nums;
}

/* Mobile — banco grid stack */
@media (max-width: 700px) {
  .banco-grid { grid-template-columns: 1fr; }
  .banco-toolbar { padding: 10px 16px; }
}


/* ─── Modal M08 — Sumario de carreiras (.sum-info) ────────── */
/*
 * Reusa o bloco .dp-* do M07 (mesmo design de cards/filter/edit).
 * Adiciona apenas .sum-info pra area "Informacoes" no topo.
 */
.sum-info {
  background: var(--bg);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sum-info__head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.sum-info__head .coach-ico { width: 13px; height: 13px; color: var(--primary-fg); }
.sum-info textarea {
  width: 100%;
  min-height: 80px;
  padding: 10px 14px;
  border: 1px solid var(--border-default);
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 13.5px;
  color: var(--fg-1);
  resize: vertical;
  line-height: 1.5;
  box-shadow: none;
}
.sum-info textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29,78,216,.12);
}
.sum-info__foot {
  display: flex;
  justify-content: flex-end;
}


/* ─── Indices DISC (.indices-v3) ─────────────────────────── */
/*
 * Marco 5.7-k — re-skin sobre o markup BS3 legacy de view_indices.php.
 * Adiciona hero V3 (no view) + re-estiliza os .panel.panel-default e
 * .panel-sections-body como cards V3.5. Mantem todos os indicadores
 * e atributos legados intactos.
 */
.indices-v3 .panel-sections {
  background: var(--bg);
  /* O legado (.panel-sections em coach/coaches/css/index.css) pinta o texto de
     BRANCO porque ali o card era azul. Aqui o fundo virou branco e a cor nunca
     foi reposta — os tres totais ("Total de sessoes/tarefas/objetivos
     programados") saiam BRANCO NO BRANCO, invisiveis. */
  color: var(--fg-1);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 12px;
}
.indices-v3 .panel-sections .fa { color: var(--fg-4); }
.indices-v3 .panel-sections b { font-variant-numeric: tabular-nums; }
.indices-v3 .panel-sections h4 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--fg-1);
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.indices-v3 .panel-sections h4 .fa-dashboard { color: var(--primary-fg); }

.indices-v3 .panel.panel-default {
  background: var(--bg);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  margin-bottom: 12px;
  transition: border-color var(--duration), box-shadow var(--duration);
}
.indices-v3 .panel.panel-default:hover {
  border-color: var(--border-strong);
  box-shadow: 0 6px 18px rgba(11,18,32,.08);
}
.indices-v3 .panel-sections-body .panel-body {
  padding: 18px 16px;
  text-align: center;
}
.indices-v3 .panel-sections-body .small {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--fg-4);
  margin-bottom: 8px;
}
.indices-v3 .porcen {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  color: var(--fg-1);
  line-height: 1;
  margin: 4px 0;
  font-variant-numeric: tabular-nums;
}
.indices-v3 .graph .progress {
  background: var(--surface-muted);
  border-radius: 999px;
  height: 6px;
  margin: 8px 0 0;
  box-shadow: none;
  overflow: hidden;
}
.indices-v3 .graph .progress-bar { border-radius: 999px; }


/* ─── Responsive ───────────────────────────────────────────── */

@media (max-width: 1100px) {
  .coach-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}

@media (max-width: 880px) {
  .coach-toolbar {
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
  }
  .tb-left { justify-content: space-between; width: 100%; }
  .tb-center { width: 100%; }
  .tb-right { width: 100%; justify-content: space-between; }
  .new-wrap { flex: 1; }
  .coach-new-toggle { width: 100%; }
}

@media (max-width: 768px) {
  .coach-page__inner { padding: 0; }
  .coach-hero { padding: 0; margin-bottom: 16px; }
  .coach-hero__title { font-size: 24px; line-height: 30px; }
  .coach-grid { grid-template-columns: 1fr; }
  .coach-table th:nth-child(2),
  .coach-table td:nth-child(2),
  .coach-table th:nth-child(3),
  .coach-table td:nth-child(3) { display: none; }
  .ma-drawer { width: 100%; }
  .ma-drawer-grid { grid-template-columns: 1fr; }
  #modal-new-cliente .modal-footer { flex-direction: column; align-items: stretch; }
  .invite-row__inputs { grid-template-columns: 1fr; }
}


/* ────────────────────────────────────────────────────────────────
 * Marco 5.17 — toastV3
 * ----------------------------------------------------------------
 * Toast V3.5 styled (substitui $.smallBox legacy SmartAdmin BS3).
 * Renderizado em #toast-v3-stack (fixed bottom-right), aria-live
 * "polite" no container. Toasts empilham bottom-up; cada um tem
 * close button e auto-dismiss (pausa no hover).
 *
 * Tipos: success / error / warning / info (cores semanticas).
 * Tokens: --success-fg/bg, --danger-fg/bg, --warning-fg/bg,
 *         --brand-primary/wash (info), --surface-card.
 * ──────────────────────────────────────────────────────────────── */

.toast-v3-stack {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  z-index: 10500; /* acima de BS3 modal (1050) e Swal (1060+) */
  pointer-events: none;
  max-width: calc(100vw - 40px);
}

.toast-v3 {
  pointer-events: auto;
  display: grid;
  grid-template-columns: 22px 1fr 22px;
  gap: 12px;
  align-items: flex-start;
  width: 360px;
  max-width: 100%;
  padding: 14px 14px 14px 16px;
  background: var(--surface-card, #fff);
  border: 1px solid var(--border-default, #e2e8f0);
  border-left: 4px solid var(--fg-3, #475569);
  border-radius: 10px;
  box-shadow: var(--shadow-pop, 0 4px 6px -1px rgba(11,18,32,.10), 0 2px 4px -2px rgba(11,18,32,.08));
  font-family: var(--font-sans, 'Inter', system-ui, sans-serif);
  color: var(--fg-1, #0a0a0a);
  opacity: 0;
  transform: translateX(16px);
  transition: opacity var(--duration-slow, 240ms) var(--ease, cubic-bezier(.4,0,.2,1)),
              transform var(--duration-slow, 240ms) var(--ease, cubic-bezier(.4,0,.2,1));
}
.toast-v3.is-in { opacity: 1; transform: translateX(0); }
.toast-v3.is-out { opacity: 0; transform: translateX(16px); }

.toast-v3__icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.toast-v3__body { min-width: 0; }
.toast-v3__title {
  font-weight: 600;
  font-size: 13.5px;
  line-height: 1.35;
  color: var(--fg-1, #0a0a0a);
}
.toast-v3__msg {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--fg-3, #475569);
  margin-top: 2px;
  word-wrap: break-word;
}

.toast-v3__close {
  width: 22px;
  height: 22px;
  background: transparent;
  border: 0;
  color: var(--fg-4, #64748b);
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background var(--duration, 150ms), color var(--duration, 150ms);
}
.toast-v3__close:hover {
  background: var(--surface-muted, #f1f5f9);
  color: var(--fg-1, #0a0a0a);
}
.toast-v3__close svg { width: 14px; height: 14px; }

/* Variantes por type — left border + icon color */
.toast-v3--success {
  border-left-color: var(--success-fg, #059669);
}
.toast-v3--success .toast-v3__icon { color: var(--success-fg, #059669); }

.toast-v3--error {
  border-left-color: var(--danger-fg, #dc2626);
}
.toast-v3--error .toast-v3__icon { color: var(--danger-fg, #dc2626); }

.toast-v3--warning {
  border-left-color: var(--warning-fg, #b45309);
}
.toast-v3--warning .toast-v3__icon { color: var(--warning-fg, #b45309); }

.toast-v3--info {
  border-left-color: var(--brand-primary, #1d4ed8);
}
.toast-v3--info .toast-v3__icon { color: var(--primary-fg); }

/* Mobile — full-width minus margins */
@media (max-width: 540px) {
  .toast-v3-stack {
    bottom: 12px;
    right: 12px;
    left: 12px;
    max-width: none;
  }
  .toast-v3 { width: 100%; }
}

/* Esconde o toast SmartAdmin legacy (caso o shim $.smallBox falhe e
   o renderer original ainda emita .SmallBox no DOM). Defensivo. */
.SmallBox { display: none !important; }


/* ────────────────────────────────────────────────────────────────
 * Marco 5.20 — Skeleton V3.5 (loading placeholders)
 * ----------------------------------------------------------------
 * Placeholders animados (shimmer) renderizados dentro de modais
 * durante AJAX. Substitui o feedback de loading global (.pace) por
 * feedback contextual — usuario ja ve a estrutura do conteudo que
 * vai chegar.
 *
 * Uso:
 *   1) Container recebe role/aria-busy: <div class="dp-list" aria-busy="true">
 *   2) Filhos sao .skeleton-line / .skeleton-card / .skeleton-circle
 *   3) Quando o conteudo real chega via .html(), aria-busy="false"
 *
 * Cada modal V3 ja tem helper inline pra emitir o skeleton (ver
 * coach-v3.js / js_coache.js / js_gerenciar_tarefas.js).
 * ──────────────────────────────────────────────────────────────── */

.skeleton-line,
.skeleton-card,
.skeleton-circle {
  background: linear-gradient(
    90deg,
    var(--surface-muted, #f1f5f9) 25%,
    #fafbfc 50%,
    var(--surface-muted, #f1f5f9) 75%
  );
  background-size: 200% 100%;
  animation: cc-skel-shimmer 1.4s ease-in-out infinite;
  border-radius: 6px;
}

@keyframes cc-skel-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-line {
  height: 14px;
  width: 100%;
  display: block;
}
.skeleton-line + .skeleton-line { margin-top: 8px; }
.skeleton-line--xs  { height: 10px; }
.skeleton-line--sm  { height: 12px; width: 60%; }
.skeleton-line--lg  { height: 18px; }
.skeleton-line--xl  { height: 24px; }
.skeleton-line--w-25 { width: 25%; }
.skeleton-line--w-40 { width: 40%; }
.skeleton-line--w-60 { width: 60%; }
.skeleton-line--w-75 { width: 75%; }

.skeleton-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
}
.skeleton-circle--sm { width: 24px; height: 24px; }
.skeleton-circle--lg { width: 56px; height: 56px; }

.skeleton-card {
  padding: 14px 16px;
  height: 64px;
  border-radius: 10px;
  margin-bottom: 8px;
}

/* Skeleton dedicado pro M07/M08 — card de pergunta (.dp-pergunta) */
.dp-pergunta--skeleton {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border-muted, #f1f5f9);
  border-radius: 10px;
  margin-bottom: 6px;
}
.dp-pergunta--skeleton .skeleton-line { margin: 0; }

/* Skeleton pro M03 — linha de permissao (.permission-row) */
.permission-row--skeleton {
  display: grid;
  grid-template-columns: 36px 1fr 40px;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border-muted, #f1f5f9);
  border-radius: 10px;
  margin-bottom: 6px;
}
.permission-row--skeleton .skeleton-line { margin: 0; }
.permission-row--skeleton .skeleton-circle { width: 36px; height: 36px; border-radius: 8px; }

/* Skeleton pro M06 — task card (.tarefas-body) */
.task-card--skeleton {
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border-muted, #f1f5f9);
  border-radius: 10px;
  margin-bottom: 8px;
}

/* Aria-busy hint pra screen readers — container fica anunciado */
[aria-busy="true"] .skeleton-line,
[aria-busy="true"] .skeleton-card,
[aria-busy="true"] .skeleton-circle {
  /* nenhum override visual; aria-busy ja serve pra leitores de tela */
}

/* Respeita preferencias de reduce motion — pausa o shimmer */
@media (prefers-reduced-motion: reduce) {
  .skeleton-line,
  .skeleton-card,
  .skeleton-circle { animation: none; background: var(--surface-muted, #f1f5f9); }
}


/* ===== DARK MODE — tint overrides (cauda) =====================
 * Bloco APPEND-ONLY. Nenhuma regra acima foi tocada. Aqui escurecemos
 * SOMENTE os washes CLAROS hardcoded (tints de categoria, softs
 * semânticos, gradientes claros, cinzas fora do mapa de neutros) que
 * não seguiam o tema e ficavam claros/berrantes sobre o fundo escuro.
 * A técnica: color-mix(...) na cor clara original com var(--bg) pra
 * manter a matiz e escurecer. Só vale no [data-theme="dark"]; o tema
 * light continua 100% intacto (regras originais mais especificas ou
 * de mesma especificidade que vêm ANTES perdem por ordem/specificidade
 * do atributo). ------------------------------------------------------ */

/* Category tints (status wash) — vars consumidas como background do
   .chip-count (e --status-bg). Escurecem preservando a matiz; o texto
   (--chip-fg) fica mais claro pra manter contraste sobre o tint escuro. */
[data-theme="dark"] {
  --coach-active-bg:   color-mix(in oklab, #ecfdf5 8%, var(--bg));
  --coach-awaiting-bg: color-mix(in oklab, #fffbeb 8%, var(--bg));
  --coach-finished-bg: color-mix(in oklab, #dbe3ee 8%, var(--bg));
}




/* Active filter chip (Tela 2) — border azul-claro + wash de hover claro */
[data-theme="dark"] .active-chips .ac-chip {
  border-color: color-mix(in oklab, #b9c8f0 30%, var(--bg));
}
[data-theme="dark"] .active-chips .ac-chip:hover {
  background: color-mix(in oklab, #dbeafe 8%, var(--bg));
}

/* Banner de devolutiva — border amber clara (bg já é token --warning-soft) */
[data-theme="dark"] .devolutiva-banner {
  border-color: color-mix(in oklab, #fde68a 30%, var(--bg));
}

/* Profile card "preenchido" — gradiente branco→verde claro */
[data-theme="dark"] .profile-card.is-filled {
  background: linear-gradient(180deg,
    color-mix(in oklab, #ffffff 8%, var(--bg)) 0%,
    color-mix(in oklab, #f0fdf4 8%, var(--bg)) 100%);
}

/* Task card concluída — wash verde + border verde clara */
[data-theme="dark"] .task-card.is-completed {
  background: color-mix(in oklab, #f0fdf4 8%, var(--bg));
  border-color: color-mix(in oklab, #bbf7d0 30%, var(--bg));
}

/* Checkbox de tarefa hover — wash verde claro */
[data-theme="dark"] .task-card__checkbox:hover:not(:disabled) {
  background: color-mix(in oklab, #ecfdf5 8%, var(--bg));
}

/* te-form: head de section com rgba slate claro */
[data-theme="dark"] .te-form-v3 .te-section__head {
  background: color-mix(in oklab, #dbe3ee 8%, var(--bg));
}

/* te-form: inputs de texto/textarea/data — um reset legado do style.css
   (`#modal-* input { background:#f2f2f2 }`) tem id na especificidade e vence o
   .te-input (que usa var(--bg)), deixando o campo claro sobre o modal escuro
   (com o texto var(--fg-1) claro por cima, ilegível). Força a superfície do
   tema com !important (vence o seletor de id, que não usa !important). */
[data-theme="dark"] .te-form-v3 .te-input,
[data-theme="dark"] .te-form-v3 textarea.te-input {
  background: var(--bg) !important;
  border-color: var(--border-default) !important;
}

/* Modal Nova/Editar Tarefa (#modalAlterTarefas): o header usa
   var(--surface-1, #fff) e o token --surface-1 não existe → cai no fallback
   #fff (branco) no escuro, enquanto body/sections/footer já usam tokens. Casa
   o header com o footer (var(--bg)); texto/close/borda já são tokens. */
[data-theme="dark"] #modalAlterTarefas .modal-header { background: var(--bg); }

/* te-form: linha de lembrete hover — wash azul claro */
[data-theme="dark"] .te-form-v3 .te-lembrete-row:hover {
  background: color-mix(in oklab, #f0f4ff 8%, var(--bg));
}

/* te-form: shortcut "100%" — border verde clara (bg/fg são tokens success) */
[data-theme="dark"] .te-form-v3 .te-shortcut-btn {
  border-color: color-mix(in oklab, #bbf7d0 30%, var(--bg));
}

/* Objetivos: pills de status — borders verde/amber claras */
[data-theme="dark"] .obj-status--validated,
[data-theme="dark"] .obj-status--completed {
  border-color: color-mix(in oklab, #a7f3d0 30%, var(--bg));
}
[data-theme="dark"] .obj-status--adjustments {
  border-color: color-mix(in oklab, #fde68a 30%, var(--bg));
}

/* Credits banner variante info — wash azul claro + texto azul escuro */
[data-theme="dark"] .credits-banner--info {
  background: color-mix(in oklab, #eff6ff 8%, var(--bg));
  color: color-mix(in oklab, #1e40af 50%, #eef2f7);
}
[data-theme="dark"] .credits-banner--info strong {
  color: color-mix(in oklab, #1e40af 50%, #eef2f7);
}

/* Perm section header hover — cinza claro fora do mapa de neutros */
[data-theme="dark"] .perm-section__header:hover {
  background: color-mix(in oklab, #e9eef5 8%, var(--bg));
}

/* Diário positivo: status "publicada" — border verde clara */
[data-theme="dark"] .dp-pergunta__status--on {
  border-color: color-mix(in oklab, #a7f3d0 30%, var(--bg));
}

/* Banco de perguntas: card selecionado — mix com #fff clareia a superfície */
[data-theme="dark"] .banco-card.is-checked {
  background: color-mix(in oklab, var(--primary-soft) 50%, var(--bg));
}

/* Skeleton shimmer — stop claro (#fafbfc) no meio do gradiente */
[data-theme="dark"] .skeleton-line,
[data-theme="dark"] .skeleton-card,
[data-theme="dark"] .skeleton-circle {
  background: linear-gradient(
    90deg,
    var(--surface-muted) 25%,
    color-mix(in oklab, #fafbfc 8%, var(--bg)) 50%,
    var(--surface-muted) 75%
  );
  background-size: 200% 100%;
}


/* ═══════════════════════════════════════════════════════════
   Modal "Indicadores" do cliente (#modal-show-indicators)
   ───────────────────────────────────────────────────────────
   Marco 6.227 — redesign da view coach/coaches/indicators-sessions.php
   (antes: sete <p> num .pull-left.padding-10 do layout antigo).

   O shell BS3 (header/close/content/footer) ja e' repintado por
   bootstrap-modal-v3.css — inclusive o .modal-footer:empty, que este
   modal deixa vazio de proposito (as acoes vem no corpo AJAX). Aqui
   so estilizamos o conteudo injetado.
   ═══════════════════════════════════════════════════════════ */

.ind-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-family: var(--font-sans);
  color: var(--ink);
}

.ind-sub {
  margin: -2px 0 0;
  font-size: 13px;
  color: var(--ink-2);
}

.ind-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--fg-4, #64748b);
}

/* ─── Cartao da nota media ─────────────────────────────────── */

.ind-rating {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
}
.ind-rating__text h4 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  margin: 4px 0;
  color: var(--ink);
}
.ind-rating__text p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-2);
}

.ind-dial {
  position: relative;
  flex: none;
  width: 84px;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.ind-dial svg {
  position: absolute;
  inset: 0;
  width: 84px;
  height: 84px;
  transform: rotate(-90deg);
}
.ind-dial circle {
  fill: none;
  stroke-width: 8;
}
.ind-dial__track { stroke: var(--surface-muted); }
.ind-dial__value {
  stroke: var(--coach-active-solid);
  stroke-linecap: round;
}
.ind-dial__num {
  position: relative;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.ind-dial__den {
  position: relative;
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-3);
}

/* ─── Estado sem avaliacao / sem historico ─────────────────── */

.ind-empty {
  text-align: center;
  padding: 22px 16px 20px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
}
.ind-empty__ico {
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-muted);
  color: var(--ink-3);
}
.ind-empty__ico .coach-ico { width: 22px; height: 22px; }
.ind-empty h4 {
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 600;
  margin: 0 0 5px;
  color: var(--ink);
}
.ind-empty p {
  margin: 0 auto;
  max-width: 44ch;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-2);
}

/* ─── Cartoes de proporcao ─────────────────────────────────── */

.ind-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.ind-stat {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  box-shadow: var(--shadow-card);
}
.ind-stat__head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ind-stat__ico {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
  color: var(--primary-fg);
}
.ind-stat__ico .coach-ico { width: 15px; height: 15px; }
.ind-stat__name {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--fg-4, #64748b);
}
.ind-stat__figure {
  display: flex;
  align-items: baseline;
  gap: 5px;
  flex-wrap: wrap;
}
.ind-stat__done {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.ind-stat__total {
  font-size: 13px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.ind-stat--muted .ind-stat__done { color: var(--ink-3); }
.ind-stat--muted .ind-stat__ico {
  background: var(--surface-muted);
  color: var(--ink-3);
}

.ind-bar {
  height: 5px;
  border-radius: 999px;
  background: var(--surface-muted);
  overflow: hidden;
}
.ind-bar > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--coach-active-solid);
}

.ind-legend {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ind-legend__row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-2);
}
.ind-legend__row b {
  margin-left: auto;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.ind-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  flex: none;
}
.ind-dot--done { background: var(--coach-active-solid); }
.ind-dot--open { background: var(--ink-3); }

/* ─── Acoes (o .modal-footer do shell fica vazio) ──────────── */

.ind-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.ind-actions__spacer { flex: 1; }

@media (max-width: 560px) {
  .ind-grid { grid-template-columns: 1fr; }
  .ind-rating { flex-direction: column; align-items: flex-start; gap: 12px; }
  .ind-actions__spacer { display: none; }
  .ind-actions .btn { flex: 1; justify-content: center; }
}
