/* =====================================================================
   OLÉ TEC · Design System
   Plataforma Digital Olé — folha de estilo única
   ===================================================================== */

:root {
  /* --- Ação (azul) — primária da marca, enriquecida --- */
  --azul: #3B6DF2;                 /* NÃO alterar: verificado no teste (botão) */
  --azul-hover: #2F5CD8;
  --azul-viv: #5B8BFF;             /* topo de gradiente / brilho */
  --azul-suave: #E7EDFE;
  --azul-profundo: #23408A;
  --grad-azul: linear-gradient(135deg, #5B8BFF 0%, #3B6DF2 52%, #2F5CD8 100%);
  --grad-azul-hover: linear-gradient(135deg, #3B6DF2 0%, #2F5CD8 60%, #274FBD 100%);

  /* --- Noite (escuros / sidebar) --- */
  --noite: #10182E;                /* NÃO alterar: verificado no teste (sidebar) */
  --noite-2: #1B2650;              /* superfícies elevadas na sidebar */
  --grad-noite: linear-gradient(202deg, #1A2647 0%, #10182E 58%, #0C1226 100%);

  /* --- Lima (acento da marca) --- */
  --lima: #CDDB00;
  --lima-suave: #F1F5CE;

  /* --- Acento secundário (frescor de dado) --- */
  --ciano: #12A9C4;
  --ciano-suave: #D9F0F5;

  /* --- Status / semânticas (mais vivas) --- */
  --verde: #15A24A;
  --verde-suave: #DCF3E5;
  --ambar: #C07C12;
  --ambar-suave: #F7ECD6;
  --vermelho: #E24B43;
  --vermelho-suave: #FCE6E4;

  /* --- Neutros FRIOS (corporativo — substitui o antigo bege) --- */
  --superficie: #F4F7FC;           /* base do fundo da aplicação */
  --superficie-2: #E8EFF8;         /* fim do gradiente do fundo */
  --nevoa: #EFF3FA;                /* superfícies / linhas muito claras */
  --cinza: #E2E8F2;                /* bordas */
  --cinza-forte: #C6CFDE;
  --branco: #FFFFFF;

  /* --- Texto (navy frio) --- */
  --tx-forte: #0F1A33;
  --tx: #384157;
  --tx-suave: #697A93;
  --tx-inverso: #EEF1FA;

  /* --- Raios --- */
  --r-card: 16px;
  --r-input: 14px;
  --r-tile: 12px;
  --r-pill: 999px;

  /* --- Sombras (frias, em camadas) --- */
  --sh-card: 0 1px 2px rgba(15,26,51,.05), 0 6px 18px rgba(31,48,94,.07);
  --sh-card-h: 0 16px 38px rgba(31,48,94,.14);
  --sh-azul: 0 10px 24px rgba(59,109,242,.32);
  --sh-lima: 0 10px 22px rgba(163,177,0,.30);
  --sh-pop: 0 26px 64px rgba(15,26,51,.26);
  --ring-azul: 0 0 0 4px rgba(59,109,242,.15);

  /* --- Layout --- */
  --sidebar-w: 264px;

  /* --- Tipografia --- */
  --font: "Comfortaa", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* =====================================================================
   Reset leve
   ===================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-weight: 400;
  color: var(--tx);
  background-color: var(--superficie);
  background-image:
    radial-gradient(1100px 520px at 100% -8%, rgba(59,109,242,.08), transparent 60%),
    radial-gradient(900px 480px at -6% 6%, rgba(18,169,196,.06), transparent 55%),
    linear-gradient(180deg, var(--superficie) 0%, var(--superficie-2) 100%);
  background-attachment: fixed;
  min-height: 100vh; min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
}
h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--tx-forte);
  margin: 0;
  line-height: 1.2;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
a { color: var(--azul); text-decoration: none; }
img { max-width: 100%; }

/* =====================================================================
   Eyebrow (rótulo pequeno em caixa alta)
   ===================================================================== */
.eyebrow {
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--azul);
}
.eyebrow--lima { color: #5c6200; }
.eyebrow--muted { color: var(--tx-suave); }

/* =====================================================================
   Botões
   ===================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: var(--r-input);
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(0) scale(.99); }

.btn--primary {
  background-color: var(--azul);
  background-image: var(--grad-azul);
  color: #fff;
  box-shadow: var(--sh-azul);
}

.btn--lima {
  background: var(--lima);
  color: var(--noite);
  box-shadow: var(--sh-lima);
}

.btn--ghost {
  background: transparent;
  color: var(--tx);
  border: 1.5px solid var(--cinza);
}

.btn--danger {
  background: transparent;
  color: var(--vermelho);
  border: 1.5px solid rgba(214,82,74,.35);
}

.btn--sm { padding: 8px 14px; font-size: 13px; }
.btn--block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

/* =====================================================================
   Campos de formulário
   ===================================================================== */
.field { display: flex; flex-direction: column; gap: 7px; }
.field label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--tx-forte);
  letter-spacing: .01em;
}
.input, .select, textarea.input {
  width: 100%;
  border: 1.5px solid var(--cinza);
  background: #fff;
  border-radius: var(--r-input);
  padding: 12px 14px;
  font-size: 14px;
  color: var(--tx-forte);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input::placeholder { color: var(--cinza-forte); }
.input:focus, .select:focus, textarea.input:focus {
  outline: none;
  border-color: var(--azul);
  box-shadow: 0 0 0 4px var(--azul-suave);
}
textarea.input { resize: vertical; min-height: 84px; }

/* campo com ícone (ex.: busca, cadeado) */
.input-icon { position: relative; }
.input-icon .ico {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--tx-suave); pointer-events: none; display: flex;
}
.input-icon .input { padding-left: 42px; }

/* =====================================================================
   Layout base (sidebar + conteúdo)
   ===================================================================== */
.shell { display: flex; min-height: 100vh; min-height: 100dvh; }

/* --- Sidebar Noite --- */
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  /* background-color sólido (verificado no teste) + gradiente/brilho por cima */
  background-color: var(--noite);
  background-image:
    radial-gradient(420px 300px at 20% 0%, rgba(59,109,242,.20), transparent 60%),
    radial-gradient(360px 320px at 90% 100%, rgba(205,219,0,.08), transparent 62%),
    var(--grad-noite);
  color: var(--tx-inverso);
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  z-index: 20;
  border-right: 1px solid rgba(255,255,255,.06);
}
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 6px 8px 22px; }
/* A marca é um link (volta para o site): sem sublinhado, cor herdada e
   com foco visível para quem navega por teclado. */
.brand, .brand:hover { text-decoration: none; color: inherit; cursor: pointer; }
.brand:focus-visible { outline: 2px solid var(--marca, #7aa2ff); outline-offset: 3px; border-radius: 10px; }
.brand__logo { height: 30px; width: auto; display: block; }
.brand__sub { font-size: 11px; color: #8892ac; letter-spacing: .06em; text-transform: uppercase; }

.nav { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; overflow-y: auto; }
.nav__group-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .18em;
  color: #59627e; padding: 16px 12px 6px;
}
.nav__item {
  display: flex; align-items: center; gap: 12px;
  /* Alvo de toque: a auditoria de 10/09 mediu 39px nos 13 itens (a regra é 44).
     min-height garante o mínimo sem depender do padding, que a media query
     mobile reduzia para caber mais item na gaveta. */
  min-height: 44px;
  padding: 11px 12px;
  border-radius: 12px;
  color: #b7bfd4;
  font-size: 14px; font-weight: 500;
  transition: background .15s ease, color .15s ease;
}
.nav__item .ico { display: flex; opacity: .85; }
.nav__item.is-active {
  background-color: var(--azul);
  background-image: var(--grad-azul);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 10px 22px -6px rgba(59,109,242,.6);
}
.nav__item.is-active .ico { opacity: 1; }

.sidebar__foot { margin-top: auto; padding-top: 16px; }
.userchip {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 14px; background: var(--noite-2);
}
.userchip__av {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--lima); color: var(--noite);
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
}
.userchip__meta { line-height: 1.25; min-width: 0; }
.userchip__meta b { display: block; color: #fff; font-size: 12.5px; font-weight: 600; line-height: 1.2; }
.userchip__meta span { font-size: 11px; color: #8892ac; }
.userchip__out {
  margin-left: auto; background: transparent; border: 0; color: #8892ac;
  display: flex; padding: 6px; border-radius: 8px;
}

/* --- Área principal --- */
.main {
  margin-left: var(--sidebar-w);
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: linear-gradient(180deg, rgba(255,255,255,.92) 0%, rgba(244,247,252,.80) 100%);
  -webkit-backdrop-filter: saturate(1.5) blur(10px);
  backdrop-filter: saturate(1.5) blur(10px);
  border-bottom: 1px solid var(--cinza);
  padding: 18px 34px;
  display: flex; align-items: center; gap: 16px;
}
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, var(--azul) 0%, var(--ciano) 38%, rgba(18,169,196,0) 78%);
  opacity: .6;
}
.topbar__hi { line-height: 1.15; }
.topbar__hi .eyebrow { display: block; margin-bottom: 3px; }
.topbar__hi h1 { font-size: 21px; }
.topbar__spacer { flex: 1; }

/* Botão hamburguer (só no mobile). Declarado AQUI, antes das media queries:
   quando vivia no fim do arquivo vencia por ordem de fonte e matava o 44px. */
.topbar__menu {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--cinza);
  background: #fff; color: var(--tx-forte); place-items: center; display: none;
}
.topbar__date {
  font-size: 12.5px; color: var(--tx-suave);
  background: #fff; border: 1px solid var(--cinza);
  padding: 8px 14px; border-radius: var(--r-pill);
  white-space: nowrap;
}
.topbar__date--short { display: none; }   /* mostrada só no mobile (data curta) */

.page { padding: 30px 34px 56px; max-width: 1240px; }
.page__head { margin-bottom: 22px; }
.page__head .eyebrow { display: block; margin-bottom: 6px; }
.page__head h2 { font-size: 25px; }
.page__head p { color: var(--tx-suave); margin: 6px 0 0; font-size: 14px; max-width: 60ch; }
.page__head-row { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page__head-row .grow { flex: 1; }

/* =====================================================================
   Cartões
   ===================================================================== */
.card {
  background: #fff;
  border: 1px solid var(--cinza);
  border-radius: var(--r-card);
  box-shadow: var(--sh-card);
}
.card__head {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 22px; border-bottom: 1px solid var(--nevoa);
}
.card__head h3 { font-size: 16px; }
.card__head .sub { font-size: 12.5px; color: var(--tx-suave); }
.card__body { padding: 22px; }

/* =====================================================================
   Métricas (Painel)
   ===================================================================== */
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 22px;
}
.metric {
  --accent: var(--azul);
  --accent-2: var(--azul-viv);
  --accent-soft: var(--azul-suave);
  background: #fff; border: 1px solid var(--cinza);
  border-radius: var(--r-card); padding: 22px 20px 20px;
  box-shadow: var(--sh-card);
  display: flex; flex-direction: column; gap: 8px;
  position: relative; overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}
/* Número AO LADO do ícone (mesma linha, centralizado) — alinhamento trivial e
   consistente entre todos os cards (feedback Michel). */
.metric__top { display: flex; align-items: center; gap: 14px; }
/* faixa de acento no topo + brilho de cor no canto */
.metric::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.metric::after {
  content: ""; position: absolute; top: -46px; right: -46px; width: 138px; height: 138px;
  background: radial-gradient(circle at center, var(--accent-soft), transparent 70%);
  opacity: .8; pointer-events: none;
}
.metric > * { position: relative; z-index: 1; }
/* acento por categoria — o tile carrega a variante */
.metric:has(.metric__tile--verde) { --accent: var(--verde); --accent-2: #3EC079; --accent-soft: var(--verde-suave); }
.metric:has(.metric__tile--lima)  { --accent: #A9B400; --accent-2: var(--lima); --accent-soft: var(--lima-suave); }
.metric:has(.metric__tile--noite) { --accent: #2B3A66; --accent-2: #46578C; --accent-soft: #E4E8F2; }
.metric__tile {
  width: 44px; height: 44px; border-radius: var(--r-tile);
  flex: 0 0 auto;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--accent-2), var(--accent));
  color: #fff;
  box-shadow: 0 10px 20px -8px var(--accent);
}
.metric__tile--verde, .metric__tile--noite { color: #fff; }
.metric__tile--lima { color: var(--noite); }
.metric__val { font-size: 32px; font-weight: 700; letter-spacing: -.02em; color: var(--tx-forte); line-height: 1; }
.metric__label { font-size: 13px; color: var(--tx-suave); font-weight: 500; }
.metric__delta {
  font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: var(--r-pill); align-self: flex-start;
}
.metric__delta--up { background: #dcefe3; color: var(--verde); }
.metric__delta--down { background: #fbe5e3; color: var(--vermelho); }
.metric__delta--flat { background: var(--nevoa); color: var(--tx-suave); }

/* =====================================================================
   Grade do painel
   ===================================================================== */
.panel-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 18px;
  align-items: start;
}

/* --- Gráfico de barras (CSS) — número de casas visível em CADA barra
   (feedback cliente 28/08: "tinha que aparecer o número de casas em cada barra
   ou clicando tb"). Antes o valor só surgia no :hover — invisível no toque. --- */
.barchart { display: flex; align-items: flex-end; gap: 10px; height: 220px; padding-top: 26px; }
.barchart__col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.barchart__bar {
  width: 100%; max-width: 34px;
  background: linear-gradient(180deg, var(--azul-viv) 0%, var(--azul) 55%, var(--azul-profundo) 100%);
  border-radius: 8px 8px 4px 4px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 6px 14px -6px rgba(59,109,242,.5);
  transition: height .5s cubic-bezier(.2,.7,.2,1), filter .15s ease;
  position: relative;
  min-height: 4px;
}
.barchart__bar:focus-visible { outline: none; box-shadow: var(--ring-azul), inset 0 1px 0 rgba(255,255,255,.28); filter: brightness(1.08); }
/* número de casas SEMPRE visível acima da barra (desktop e mobile) */
.barchart__val {
  position: absolute; top: -19px; left: 50%; transform: translateX(-50%);
  font-size: 10.5px; font-weight: 700; color: var(--tx-forte);
  font-variant-numeric: tabular-nums; white-space: nowrap; pointer-events: none;
}
.barchart__lbl { font-size: 10.5px; color: var(--tx-suave); font-weight: 600; }

/* --- ESG --- */
.esg__score {
  display: flex; align-items: baseline; gap: 10px; margin-bottom: 20px;
}
.esg__score b { font-size: 40px; font-weight: 700; color: var(--tx-forte); letter-spacing: -.02em; }
.esg__score span { font-size: 13px; color: var(--tx-suave); }
.esg__score .chip {
  margin-left: auto; align-self: center;
  background: var(--lima-suave); color: #4e5400; font-weight: 700; font-size: 12px;
  padding: 5px 12px; border-radius: var(--r-pill);
}
.esg-row { margin-bottom: 16px; }
.esg-row:last-child { margin-bottom: 0; }
.esg-row__top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 7px; }
.esg-row__top b { color: var(--tx-forte); font-weight: 600; }
.esg-row__top span { color: var(--tx-suave); font-weight: 700; }
.esg-track { height: 10px; background: var(--nevoa); border-radius: var(--r-pill); overflow: hidden; }
.esg-fill { height: 100%; border-radius: var(--r-pill); transition: width .6s cubic-bezier(.2,.7,.2,1); }
.esg-fill--amb { background: linear-gradient(90deg, var(--verde), #3EC079); }
.esg-fill--soc { background: linear-gradient(90deg, var(--azul), var(--azul-viv)); }
.esg-fill--gov { background: linear-gradient(90deg, #A9B400, var(--lima)); }

/* --- Feed de atividade --- */
.feed { display: flex; flex-direction: column; gap: 2px; }
.feed__item { display: flex; gap: 13px; padding: 12px 0; border-bottom: 1px solid var(--nevoa); }
.feed__item:last-child { border-bottom: 0; }
.feed__dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--azul);
  margin-top: 6px; flex: 0 0 auto; box-shadow: 0 0 0 4px var(--azul-suave);
}
.feed__txt { font-size: 13.5px; color: var(--tx-forte); }
.feed__meta { font-size: 11.5px; color: var(--tx-suave); margin-top: 2px; }

/* =====================================================================
   Tabelas
   ===================================================================== */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl thead th {
  text-align: left; padding: 13px 16px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--tx-suave); border-bottom: 1.5px solid var(--cinza); white-space: nowrap;
}
.tbl tbody td { padding: 14px 16px; border-bottom: 1px solid var(--nevoa); color: var(--tx); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .strong { color: var(--tx-forte); font-weight: 600; }
.tbl .muted { color: var(--tx-suave); font-size: 12.5px; }
.tbl .num { font-variant-numeric: tabular-nums; }

/* --- Badges de status --- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 700; letter-spacing: .01em; white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--azul { background: var(--azul-suave); color: var(--azul-profundo); }
.badge--lima { background: var(--lima-suave); color: #6f7800; }
.badge--verde { background: #dcefe3; color: var(--verde); }
.badge--ambar { background: #f7ecd6; color: var(--ambar); }
.badge--vermelho { background: #fbe5e3; color: var(--vermelho); }
.badge--cinza { background: var(--cinza); color: var(--tx-suave); }
.badge--slate { background: #e7eaf1; color: #47506a; }

/* Input de arquivo com identidade da marca (botão pílula azul) — evita o widget
   cru do navegador em Evolução/Arquivos. */
input[type="file"].input { padding: 9px 12px; cursor: pointer; color: var(--tx-suave); font-size: 13px; }
input[type="file"].input::file-selector-button {
  font-family: var(--font); font-weight: 700; font-size: 12.5px; color: #fff;
  background: var(--azul); border: none; border-radius: var(--r-pill);
  padding: 8px 16px; margin-right: 12px; cursor: pointer; transition: background .15s ease;
}

/* selo homologado */
.selo {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--lima-suave); color: #6f7800;
  font-size: 11.5px; font-weight: 700;
  padding: 4px 10px; border-radius: var(--r-pill);
}

/* --- Toolbar de tabela (busca) --- */
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar .grow { flex: 1; min-width: 200px; }
.filterpills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill {
  border: 1.5px solid var(--cinza); background: #fff; color: var(--tx);
  padding: 8px 14px; border-radius: var(--r-pill); font-size: 12.5px; font-weight: 600;
  transition: all .15s ease;
}
.pill.is-active { background: var(--noite); color: #fff; border-color: var(--noite); }

/* --- Paginação --- */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; border-top: 1px solid var(--nevoa); flex-wrap: wrap; }
.pager__info { font-size: 12.5px; color: var(--tx-suave); }
.pager__btns { display: flex; gap: 8px; }

/* =====================================================================
   Ícones de linha de ação em tabela
   ===================================================================== */
.icon-btn {
  width: 34px; height: 34px; border-radius: 10px;
  border: 1.5px solid var(--cinza); background: #fff; color: var(--tx-suave);
  display: inline-grid; place-items: center; transition: all .15s ease;
}
.row-actions { display: flex; gap: 8px; }

/* =====================================================================
   Responsáveis (lista de cartões)
   ===================================================================== */
.resp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 16px; }
.resp-card {
  background: #fff; border: 1px solid var(--cinza); border-radius: var(--r-card);
  padding: 20px; box-shadow: var(--sh-card);
  display: flex; align-items: center; gap: 15px;
}
.resp-card__av {
  width: 48px; height: 48px; border-radius: 14px; flex: 0 0 auto;
  background: var(--azul-suave); color: var(--azul-profundo);
  display: grid; place-items: center; font-weight: 700; font-size: 17px;
}
.resp-card__meta { min-width: 0; flex: 1; }
.resp-card__meta b { display: block; font-size: 15px; color: var(--tx-forte); }
.resp-card__meta span { font-size: 12.5px; color: var(--tx-suave); }
.resp-card__meta .selo { margin-top: 8px; }

/* =====================================================================
   Login
   ===================================================================== */
/* Layout aprovado (Rock Design), escopado em .login-split para não colidir
   com .card/.btn/.field/.eyebrow usados no restante do app. */
.login-split {
  display: grid; grid-template-columns: 1.05fr .95fr; min-height: 100vh; min-height: 100dvh;
  background:
    radial-gradient(900px 620px at 118% -12%, rgba(59,109,242,.16), transparent 58%),
    radial-gradient(720px 540px at -12% 118%, rgba(18,169,196,.12), transparent 60%),
    linear-gradient(158deg, #EEF3FB 0%, #E4EBF6 52%, #DBE5F3 100%);
}
.login-split .visual { position: sticky; top: 0; height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 44px 56px clamp(56px,10vh,120px); color: #fff; }
.login-split .visual .bg { position: absolute; inset: 0; background: url("assets/painel-icado.jpg") center/cover no-repeat; }
/* Scrim vertical forte de baixo p/ cima: garante o texto branco legível sobre a
   foto clara do canteiro (todo o texto vive no terço inferior). */
.login-split .visual .veu { position: absolute; inset: 0; background: linear-gradient(to top, rgba(16,24,46,.92) 0%, rgba(16,24,46,.80) 45%, rgba(16,24,46,.48) 74%, rgba(16,24,46,.32) 100%); }
.login-split .visual .forma { position: absolute; pointer-events: none; -webkit-user-select: none; user-select: none; }
.login-split .visual > * { position: relative; z-index: 2; }
.login-split .visual .logo { height: 30px; width: auto; max-width: 150px; object-fit: contain; }
.login-split .visual h2 { color: #fff; font-weight: 700; font-size: clamp(26px,2.6vw,38px); line-height: 1.25; letter-spacing: -.01em; max-width: 17ch; text-shadow: 0 2px 20px rgba(16,24,46,.6); }
.login-split .visual h2 .hl { color: var(--lima); }
.login-split .visual p { margin-top: 16px; font-size: 15px; color: rgba(255,255,255,.88); max-width: 44ch; text-shadow: 0 1px 14px rgba(16,24,46,.55); }
.login-split .visual .selo { display: inline-flex; align-items: center; gap: 10px; margin-top: 26px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.22); border-radius: 100px; padding: 10px 20px; font-size: 12.5px; font-weight: 600; color: #fff; }
.login-split .visual .selo .dot { width: 20px; height: 20px; border-radius: 7px; background: var(--lima); color: var(--azul-profundo); display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.login-split .painel { display: flex; align-items: center; justify-content: center; padding: 48px 32px; }
.login-split .painel > div { width: min(400px, 100%); }
.login-split .card { width: 100%; background: #fff; border-radius: 26px; padding: 44px 40px; box-shadow: 0 30px 70px rgba(16,24,46,.14), 0 2px 6px rgba(16,24,46,.05); border: 1px solid rgba(255,255,255,.7); animation: login-entra .6s ease both; }
@keyframes login-entra { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.login-split .card .logo { height: 30px; width: auto; margin-bottom: 30px; }
.login-split .eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: rgba(16,24,46,.66); }
.login-split .eyebrow::before { content: ""; width: 22px; height: 7px; background: var(--lima); border-radius: 20px; flex: none; }
.login-split .card h1 { font-weight: 700; font-size: 26px; letter-spacing: -.01em; margin: 14px 0 6px; }
.login-split .card .sub { font-size: 13.5px; color: rgba(16,24,46,.66); margin-bottom: 28px; }
.login-split .field { margin-bottom: 16px; }
.login-split .field label { display: block; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: rgba(16,24,46,.66); margin-bottom: 7px; }
.login-split .field .ctrl { position: relative; }
.login-split .field input { width: 100%; padding: 14px 16px; border: 2px solid var(--cinza); border-radius: 14px; font-family: var(--font); font-size: 14.5px; background: #fff; color: var(--noite); transition: border-color .15s ease; }
.login-split .field input:focus { outline: none; border-color: var(--azul); }
.login-split .field .olho { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; color: rgba(16,24,46,.66); border: none; background: none; cursor: pointer; }
.login-split .linha { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 22px; font-size: 12.5px; }
.login-split .lembrar { display: flex; align-items: center; gap: 8px; color: rgba(16,24,46,.66); cursor: pointer; font-weight: 500; }
.login-split .lembrar input { accent-color: var(--azul); width: 15px; height: 15px; }
.login-split .esqueci { font-weight: 700; color: var(--azul); }
.login-split .btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; font-weight: 700; font-size: 15px; padding: 16px 30px; border-radius: 100px; background-color: var(--azul); background-image: var(--grad-azul); color: #fff; border: none; cursor: pointer; box-shadow: 0 12px 28px -6px rgba(59,109,242,.5); transition: transform .15s ease, filter .2s ease, box-shadow .2s ease; }
.login-split .btn:active { transform: none; }
.login-split .btn[disabled] { opacity: .7; cursor: progress; transform: none; }
.login-split .divisor { height: 1px; background: var(--cinza); margin: 22px 0 18px; }
.login-split .apoio { font-size: 12.5px; color: rgba(16,24,46,.66); line-height: 1.7; }
.login-split .apoio a { color: var(--azul); font-weight: 700; }
.login-split .legal { margin-top: 14px; font-size: 11px; color: rgba(16,24,46,.66); line-height: 1.7; }
.login-split .rodape { margin-top: 22px; text-align: center; font-size: 11.5px; color: rgba(16,24,46,.66); }
.login__err {
  background: #fbe5e3; color: var(--vermelho); border: 1px solid rgba(214,82,74,.3);
  padding: 11px 14px; border-radius: var(--r-input); font-size: 13px; font-weight: 500;
  display: none;
}
.login__err.show { display: block; }
.login__hint {
  margin-top: 22px; padding: 12px 14px; background: var(--lima-suave);
  border-radius: var(--r-input); font-size: 12px; color: #6f7800; text-align: center;
}
.login__hint code { background: rgba(0,0,0,.06); padding: 1px 6px; border-radius: 5px; font-weight: 700; }

/* =====================================================================
   Estados (vazio / carregando / placeholder "em breve")
   ===================================================================== */
.empty, .soon-page {
  text-align: center; padding: 64px 24px; color: var(--tx-suave);
}
.empty__ico, .soon-page__ico {
  width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 18px;
  background: var(--azul-suave); color: var(--azul); display: grid; place-items: center;
}
.soon-page__ico { background: var(--lima-suave); color: #8a9400; }
.empty h3, .soon-page h3 { font-size: 19px; margin-bottom: 8px; }
.empty p, .soon-page p { font-size: 14px; max-width: 44ch; margin: 0 auto; }
.soon-page .badge { margin-top: 16px; }

.skeleton {
  background: linear-gradient(90deg, var(--nevoa) 25%, #ececec 50%, var(--nevoa) 75%);
  background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px;
}
@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--cinza); border-top-color: var(--azul);
  animation: spin .8s linear infinite; margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =====================================================================
   Modal
   ===================================================================== */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(16,24,46,.5);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); z-index: 100;
  display: grid; place-items: center; padding: 24px;
  animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff; border-radius: 20px; box-shadow: var(--sh-pop);
  width: 100%; max-width: 640px; max-height: 90vh; overflow: hidden;
  display: flex; flex-direction: column;
  animation: pop .2s cubic-bezier(.2,.9,.3,1.2);
}
.modal--sm { max-width: 440px; }
@keyframes pop { from { transform: translateY(14px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal__head { padding: 22px 26px 16px; display: flex; align-items: flex-start; gap: 14px; border-bottom: 1px solid var(--nevoa); }
.modal__head .eyebrow { display: block; margin-bottom: 4px; }
.modal__head h3 { font-size: 19px; }
.modal__head p { font-size: 13px; color: var(--tx-suave); margin: 4px 0 0; }
.modal__x { margin-left: auto; background: transparent; border: 0; color: var(--tx-suave); padding: 6px; border-radius: 8px; display: flex; }
.modal__body { padding: 22px 26px; overflow-y: auto; }
.modal__foot { padding: 16px 26px; border-top: 1px solid var(--nevoa); display: flex; justify-content: flex-end; gap: 10px; background: #fff; }

/* blocos do formulário de obra */
.formblock { margin-bottom: 26px; }
.formblock:last-child { margin-bottom: 0; }
.formblock__title { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.formblock__title .n {
  width: 24px; height: 24px; border-radius: 8px; background: var(--noite); color: #fff;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: 0 0 auto;
}
.formblock__title h4 { font-size: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .col-2 { grid-column: 1 / -1; }

/* =====================================================================
   Toasts
   ===================================================================== */
.toast-layer {
  position: fixed; top: 20px; right: 20px; z-index: 200;
  display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.toast {
  background: var(--noite); color: #fff; padding: 13px 18px; border-radius: 14px;
  box-shadow: var(--sh-pop); font-size: 13.5px; font-weight: 500;
  display: flex; align-items: center; gap: 11px; max-width: 360px;
  animation: slidein .25s cubic-bezier(.2,.9,.3,1.2); pointer-events: auto;
}
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast--ok { border-left: 4px solid var(--lima); }
.toast--err { border-left: 4px solid var(--vermelho); }
.toast .ico { display: flex; flex: 0 0 auto; }
.toast--ok .ico { color: var(--lima); }
.toast--err .ico { color: var(--vermelho); }

/* =====================================================================
   Responsivo
   ===================================================================== */
@media (max-width: 1080px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .panel-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  /* A sidebar vira GAVETA (drawer) sobreposta. NÃO zeramos --sidebar-w: fazer isso
     encolhia a PRÓPRIA sidebar a 0px, então translateX(-100%) = -0px e ela nunca
     escondia — seu texto vazava sobre o conteúdo e "aberta" mostrava uma gaveta de
     0px (= "o menu não funciona"). Bug do Safari/iOS reportado 28/08. Correção:
     largura fixa + deslocamento de 100% da própria largura. */
  .sidebar {
    width: min(286px, 84vw);
    flex-basis: min(286px, 84vw);
    transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.2,.7,.2,1);
    box-shadow: none;
  }
  .sidebar.open { transform: none; box-shadow: 30px 0 70px -24px rgba(8,12,26,.6); }
  .main { margin-left: 0; }
  .topbar__menu { display: inline-grid !important; }
  .login-split { grid-template-columns: 1fr; }
  .login-split .visual { display: none; }
  .login-split .painel { min-height: 100vh; min-height: 100dvh; position: relative; background: url("assets/painel-icado.jpg") center/cover no-repeat; }
  .login-split .painel::before { content: ""; position: absolute; inset: 0; background: linear-gradient(210deg, rgba(16,24,46,.35) 0%, rgba(16,24,46,.72) 100%); }
  .login-split .painel > div { position: relative; z-index: 2; }
  .login-split .card { background: rgba(255,255,255,.88); -webkit-backdrop-filter: blur(14px) saturate(1.1); backdrop-filter: blur(14px) saturate(1.1); border: 1px solid rgba(255,255,255,.55); }
}
@media (min-width: 901px) { .topbar__menu { display: none; } .scrim { display: none; } }
@media (max-width: 640px) {
  /* ===== Revisão de design mobile (feedback 31/08) ===== */

  /* Topbar: nunca quebra; data curta numa pílula que continua pílula; saudação
     com reticências; eyebrow escondida (já aparece no cabeçalho da página). */
  .topbar { gap: 10px; padding: 12px 16px; flex-wrap: nowrap; }
  .topbar__hi { flex: 1 1 auto; min-width: 0; }
  .topbar__hi .eyebrow { display: none; }
  .topbar__hi h1 { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar__spacer { display: none; }
  .topbar__date { flex: 0 0 auto; font-size: 11px; padding: 6px 10px; }
  .topbar__date--full { display: none; }
  .topbar__date--short { display: inline; }
  .topbar__menu { width: 44px; height: 44px; border: 1.5px solid var(--cinza-forte); }

  /* Cabeçalho de página mais enxuto + hierarquia (h2 domina o h1 da topbar) */
  .page { padding: 20px 16px 44px; }
  .page__head { margin-bottom: 16px; }
  .page__head h2 { font-size: 20px; }
  .page__head p { font-size: 13px; }
  /* Cabeçalho empilha e o botão de ação vira full-width abaixo da descrição —
     consistente entre todas as telas (antes o botão "flutuava" à direita em Obras). */
  .page__head-row { flex-direction: column; align-items: stretch; gap: 12px; }
  .page__head-row .btn { width: 100%; }

  /* Métricas: 2 colunas compactas — elimina o espaço em branco e a rolagem longa.
     align-items:start: cada card tem a altura do seu conteúdo (sem esticar o card
     curto e deixar texto "flutuando" num vão vazio); tile/número/rótulo alinhados
     no topo em toda a linha. */
  /* Número ao lado do ícone (mesma linha) => ícones e números alinhados entre todos
     os cards. align-items:start deixa cada card com a altura do seu conteúdo (sem vão). */
  .metrics { grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; align-items: start; }
  .metric { padding: 14px; gap: 6px; }
  .metric__top { gap: 10px; }
  .metric__tile { width: 40px; height: 40px; }
  .metric__val { font-size: 24px; }
  .metric__label { font-size: 12px; }
  .metric__delta { font-size: 11px; padding: 2px 8px; }
  .metric::after { opacity: .45; }

  /* Cartões um pouco mais justos no celular (densidade) */
  .card__head { padding: 16px 16px 12px; }
  .card__body { padding: 16px; }

  .form-grid { grid-template-columns: 1fr; }

  /* Gráfico: 12 barras num cartão estreito */
  .barchart { gap: 5px; }
  .barchart__val { font-size: 9px; top: -16px; }
  .barchart__lbl { font-size: 9px; }

  /* Tabelas viram CARTÕES empilhados (rótulo em cima, valor embaixo) — some o
     corte de badge na borda; robusto para células ricas (barra/ações). */
  .table-wrap { overflow-x: visible; }
  table.tbl { min-width: 0; }
  .tbl thead { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr { border: 1px solid var(--cinza); border-radius: var(--r-tile); margin-bottom: 10px; padding: 4px 14px; background: #fff; }
  .tbl tbody tr:hover { background: #fff; }
  .tbl td { padding: 8px 0; border-bottom: 1px solid var(--nevoa); text-align: left; }
  .tbl tbody tr td:last-child { border-bottom: 0; }
  .tbl td[data-label]::before { content: attr(data-label); display: block; font-weight: 700; color: var(--tx-suave); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 3px; }
  .row-actions { justify-content: flex-start; }
  /* Tabelas de VALOR CURTO (ex.: Produtividade por obra): rótulo à esquerda, valor
     à direita na MESMA linha — bem mais denso que rótulo-em-cima-do-valor. */
  .tbl--compact td { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
  .tbl--compact td[data-label]::before { margin-bottom: 0; flex: 0 0 auto; }
  .tbl--compact td.num { font-variant-numeric: tabular-nums; }

  /* Alvos de toque >= 44px */
  .pill { padding: 11px 16px; }
  .icon-btn { width: 44px; height: 44px; }

  /* Barra de filtros: tudo empilhado full-width (busca + selects), bordas alinhadas.
     column evita a matemática de wrap e o overflow do <select> nativo do WebKit;
     !important porque alguns selects têm width/flex inline no markup. */
  .toolbar { flex-direction: column; align-items: stretch; gap: 8px; }
  .toolbar .grow { min-width: 0; }
  .toolbar .select { flex: 0 0 auto !important; min-width: 0 !important; width: 100% !important; }

  /* Empty-state mais baixo (Evolução/telas vazias não parecerem inacabadas) */
  .empty, .soon-page { padding: 24px 16px; }
  .empty__ico, .soon-page__ico { width: 48px; height: 48px; margin-bottom: 12px; }
}


/* Backdrop (scrim) da gaveta mobile — escurece o conteúdo e fecha ao tocar fora.
   z-index: conteúdo(auto) < topbar(10) < scrim(15) < sidebar(20). */
.scrim {
  position: fixed; inset: 0; z-index: 15;
  background: rgba(8,12,26,.46);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  opacity: 0; visibility: hidden;
  transition: opacity .28s ease, visibility .28s ease;
}
.scrim.show { opacity: 1; visibility: visible; }
/* trava o scroll do corpo enquanto a gaveta está aberta (evita rolagem por trás) */
body.no-scroll { overflow: hidden; }

/* =====================================================================
   Nome com avatar em célula de tabela (responsáveis / arquivos)
   ===================================================================== */
.ct-name { display: flex; align-items: center; gap: 11px; }
.ct-av {
  width: 34px; height: 34px; border-radius: 10px; flex: 0 0 auto;
  background: var(--azul-suave); color: var(--azul-profundo);
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.ct-av--file { background: var(--lima-suave); color: #8a9400; }

/* =====================================================================
   Toggle (interruptor)
   ===================================================================== */
.toggle { display: inline-flex; align-items: center; gap: 11px; cursor: pointer; -webkit-user-select: none; user-select: none; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle__track {
  width: 44px; height: 26px; border-radius: var(--r-pill); background: var(--cinza);
  position: relative; flex: 0 0 auto; transition: background .18s ease;
}
.toggle__dot {
  position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(16,24,46,.3); transition: transform .18s ease;
}
.toggle input:checked + .toggle__track { background: var(--azul); }
.toggle input:checked + .toggle__track .toggle__dot { transform: translateX(18px); }
.toggle input:focus-visible + .toggle__track { box-shadow: 0 0 0 4px var(--azul-suave); }
.toggle__lbl { font-size: 13.5px; color: var(--tx-forte); font-weight: 500; }

/* =====================================================================
   Tag (chip pequeno de tipo/arquivo)
   ===================================================================== */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--nevoa); border: 1px solid var(--cinza); color: var(--tx);
  font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: var(--r-pill);
}
.tag svg { width: 13px; height: 13px; }

/* =====================================================================
   Alerta (âmbar / retrocesso)
   ===================================================================== */
.alert {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 13px 16px; border-radius: var(--r-input); margin-bottom: 16px;
  font-size: 13px;
}
.alert .ico { flex: 0 0 auto; display: flex; margin-top: 1px; }
.alert b { display: block; font-size: 13.5px; margin-bottom: 2px; }
.alert--warn { background: #f7ecd6; color: var(--ambar); border: 1px solid rgba(185,126,23,.28); }
.alert--warn b { color: #8a5e11; }

/* =====================================================================
   Evolução semanal
   ===================================================================== */
.evo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.filemeta { display: flex; align-items: center; gap: 10px; }

.evo-timeline { display: flex; flex-direction: column; gap: 12px; }
.evo-item {
  display: flex; gap: 14px; padding: 14px; border: 1px solid var(--cinza);
  border-radius: var(--r-tile); background: #fff;
}
.evo-item--warn { border-color: rgba(185,126,23,.4); background: #fdf8ef; }
.evo-item__perc {
  flex: 0 0 auto; width: 54px; height: 54px; border-radius: 14px;
  background: var(--azul-suave); color: var(--azul-profundo);
  display: grid; place-items: center; font-weight: 700; font-size: 15px;
}
.evo-item--warn .evo-item__perc { background: #f7ecd6; color: var(--ambar); }
.evo-item__main { min-width: 0; flex: 1; }
.evo-item__top { display: flex; align-items: center; gap: 10px; }
.evo-item__top b { color: var(--tx-forte); font-size: 14px; }
.evo-item__nota { margin: 6px 0 0; font-size: 13px; color: var(--tx); }
.evo-item__evid { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* =====================================================================
   ESG por projeto
   ===================================================================== */
.esgproj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.esgproj { border: 1px solid var(--cinza); border-radius: var(--r-tile); padding: 16px; }
.esgproj__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.esgproj__head b { font-size: 14px; color: var(--tx-forte); }
.scorepill {
  flex: 0 0 auto; min-width: 38px; height: 38px; border-radius: 12px; padding: 0 8px;
  display: grid; place-items: center; font-weight: 700; font-size: 15px;
}
.scorepill--verde { background: #dcefe3; color: var(--verde); }
.scorepill--lima { background: var(--lima-suave); color: #4e5400; }
.scorepill--ambar { background: #f7ecd6; color: var(--ambar); }
.esgproj__bars { display: flex; flex-direction: column; gap: 9px; }
.minibar { display: flex; align-items: center; gap: 9px; }
.minibar__k {
  flex: 0 0 auto; width: 20px; height: 20px; border-radius: 6px; background: var(--nevoa);
  display: grid; place-items: center; font-size: 10.5px; font-weight: 700; color: var(--tx-suave);
}
.minibar__track { flex: 1; height: 8px; background: var(--nevoa); border-radius: var(--r-pill); overflow: hidden; }
.minibar__v { flex: 0 0 auto; width: 34px; text-align: right; font-size: 12px; font-weight: 700; color: var(--tx-suave); font-variant-numeric: tabular-nums; }

/* =====================================================================
   Central de ajuda
   ===================================================================== */
.help-grid { display: grid; grid-template-columns: 320px 1fr; gap: 18px; align-items: start; }
#ajuda-list { display: flex; flex-direction: column; padding: 8px; }
.help-item {
  display: flex; flex-direction: column; gap: 3px; text-align: left;
  padding: 12px 14px; border: 0; background: transparent; border-radius: var(--r-tile);
  transition: background .15s ease;
}
.help-item.is-active { background: var(--azul-suave); }
.help-item__mod { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--azul); }
.help-item__ttl { font-size: 13.5px; font-weight: 600; color: var(--tx-forte); }
.help-read__ttl { font-size: 20px; margin: 8px 0 14px; }
.help-read__body p { font-size: 14px; color: var(--tx); margin: 0 0 12px; line-height: 1.65; }
.help-read__body p:last-child { margin-bottom: 0; }

@media (max-width: 1080px) {
  .evo-grid { grid-template-columns: 1fr; }
  .help-grid { grid-template-columns: 1fr; }
}

/* =====================================================================
   Capacitação & Conhecimento
   ===================================================================== */
/* wrapper vertical das três seções */
.cap-stack { display: flex; flex-direction: column; gap: 18px; }
/* permite que o texto do cabeçalho do card ocupe o espaço e a busca fique à direita */
.card__head .grow { flex: 1; min-width: 200px; }
/* a jornada de qualificação reutiliza .evo-timeline / .evo-item (círculo + título + subtítulo) */

/* --- Vídeos de treinamento --- */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 16px; }
.video-card {
  border: 1px solid var(--cinza); border-radius: var(--r-tile); overflow: hidden;
  background: #fff; box-shadow: var(--sh-card); cursor: pointer;
  display: flex; flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease;
}
.video-card:focus-visible { outline: none; box-shadow: var(--ring-azul); }
.video-card__poster { position: relative; aspect-ratio: 16 / 9; background: var(--nevoa); overflow: hidden; }
.video-card__poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-card__play {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: linear-gradient(180deg, rgba(16,24,46,.04) 0%, rgba(16,24,46,.38) 100%);
}
.video-card__play span {
  width: 54px; height: 54px; border-radius: 50%;
  background: rgba(255,255,255,.94); color: var(--azul);
  display: grid; place-items: center; box-shadow: var(--sh-azul);
  transition: transform .15s ease, background .15s ease;
}
.video-card:focus-visible .video-card__play span { transform: scale(1.08); background: #fff; }
.video-card__body { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.video-card__ttl { font-size: 14px; font-weight: 600; color: var(--tx-forte); line-height: 1.35; }
/* modal de vídeo: player em fundo escuro */
.video-modal-body { padding: 0; background: #000; }
.video-modal-body video { display: block; width: 100%; max-height: 70vh; background: #000; }
.video-modal-body .empty { background: #fff; }

/* --- Repositório de documentação (agrupado por obra) --- */
.doc-group { margin-bottom: 18px; }
.doc-group:last-child { margin-bottom: 0; }
.doc-group__head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--tx-suave);
}
.doc-group__head svg { width: 15px; height: 15px; flex: 0 0 auto; }
.doc-group__head .n { font-weight: 600; letter-spacing: 0; text-transform: none; }
.doc-list { display: flex; flex-direction: column; gap: 8px; }
.doc-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border: 1px solid var(--cinza); border-radius: var(--r-tile); background: #fff;
}
.doc-item .ct-av { width: 32px; height: 32px; }
.doc-item .strong { flex: 1; min-width: 0; color: var(--tx-forte); font-weight: 600; font-size: 13.5px; }

/* =====================================================================
   Rede de profissionais
   ===================================================================== */
.prof-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 16px; }
.prof-card {
  background: #fff; border: 1px solid var(--cinza); border-radius: var(--r-card);
  padding: 20px; box-shadow: var(--sh-card);
  display: flex; flex-direction: column; gap: 14px;
  transition: transform .18s ease, box-shadow .18s ease;
}
.prof-card__top { display: flex; align-items: center; gap: 14px; }
.prof-card__av {
  width: 52px; height: 52px; border-radius: 15px; flex: 0 0 auto;
  background: var(--azul-suave); color: var(--azul-profundo);
  display: grid; place-items: center; font-weight: 700; font-size: 18px;
}
.prof-card__id { min-width: 0; flex: 1; }
.prof-card__id b { display: block; font-size: 15px; color: var(--tx-forte); line-height: 1.3; }
.prof-card__id span { display: block; font-size: 12.5px; color: var(--tx-suave); }
.prof-card__loc { margin-top: 2px; }
.prof-rating { display: flex; align-items: center; gap: 8px; }
.prof-rating__stars { letter-spacing: 2px; font-size: 14px; line-height: 1; }
.prof-rating__stars .on { color: var(--lima); }
.prof-rating__stars .off { color: var(--cinza-forte); }
.prof-rating__num { font-size: 13px; font-weight: 700; color: var(--tx-forte); font-variant-numeric: tabular-nums; }
.prof-card__tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
/* chip de disponibilidade (distinto dos badges de status) */
.chip-disp {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 700; padding: 4px 11px; border-radius: var(--r-pill);
  border: 1px solid var(--cinza); background: var(--nevoa); color: var(--tx);
}
.chip-disp::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--cinza-forte); }
.chip-disp--on { background: var(--verde-suave); border-color: transparent; color: var(--verde); }
.chip-disp--on::before { background: var(--verde); }
.chip-disp--mid { background: var(--ambar-suave); border-color: transparent; color: var(--ambar); }
.chip-disp--mid::before { background: var(--ambar); }
.chip-disp--off { background: var(--cinza); border-color: transparent; color: var(--tx-suave); }
.chip-disp--off::before { background: var(--tx-suave); }
/* empurra o botão "Conectar" para a base do cartão (alturas iguais) */
.prof-card .btn { margin-top: auto; }

/* =====================================================================
   Arquivos: 2 pastas por obra (biblioteca padrão + específicos por obra)
   ===================================================================== */
.muted { color: var(--tx-suave); font-size: 12.5px; }
.arq-sec + .arq-sec { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--cinza); }
.arq-sec__head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 2px 0 12px; }
.arq-sec__head h3 { font-size: 15px; }
.arq-sec__head::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--azul); align-self: center; }
.arq-obra { font-size: 13px; font-weight: 600; color: var(--tx); margin: 18px 0 8px; }
.arq-obra:first-of-type { margin-top: 4px; }
.arq-obra-head { margin: 2px 0 16px; padding-bottom: 12px; border-bottom: 1px solid var(--cinza); }
.arq-obra-head h2 { font-size: 20px; margin-top: 2px; }

/* Ranking de produtividade (painel): número da posição */
.rank { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--azul-suave); color: var(--azul-profundo); font-size: 12px; font-weight: 700; margin-right: 9px; }

/* Evolução: unidade "casas" abaixo do número no selo do histórico */
.evo-item__unit { display: block; font-size: 10px; font-weight: 600; color: var(--tx-suave); text-transform: uppercase; letter-spacing: .04em; line-height: 1; margin-top: 2px; }

/* ESG por projeto: indicadores previsto → realizado */
.esg-ind-list { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--cinza); display: grid; gap: 5px; min-width: 0; }
.esg-ind__grp { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--tx-suave); margin-top: 4px; }
/* flex-wrap + min-width:0: em telas estreitas (iPhone) o valor cai para a linha de
   baixo em vez de empurrar a linha além do cartão (causava overflow horizontal no
   #/esg — feedback Safari 28/08). O valor mantém nowrap (não quebra o número). */
.esg-ind { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; flex-wrap: wrap; }
.esg-ind__k { color: var(--tx-suave); min-width: 0; }
.esg-ind__v { color: var(--tx-forte); font-weight: 600; white-space: nowrap; }
.esg-ind__arrow { color: var(--azul); font-weight: 700; }

/* Permissões por tipo de usuário (editor no cadastro) */
.perm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin-top: 4px; }
.perm-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.perm-row__k { font-size: 12.5px; color: var(--tx); }
.perm-row .select { max-width: 130px; padding: 6px 10px; font-size: 12.5px; }
@media (max-width: 560px) { .perm-grid { grid-template-columns: 1fr; } }
.arq-sec + .arq-sec .arq-sec__head::before { background: var(--lima); }

/* --- Campo DERIVADO (calculado pelo sistema, não digitado) — R-10 -----------
   Usado no form de obra: o progresso vem de realizado ÷ previsto em casas. */
.derived {
  border: 1px dashed var(--cinza-forte);
  border-radius: 12px;
  background: var(--nevoa);
  padding: 12px 14px;
  display: grid;
  gap: 8px;
}
.derived__row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.derived__val { font-size: 24px; font-weight: 700; color: var(--tx-forte); line-height: 1; }
.derived__tag {
  font-size: 11px; font-weight: 600; letter-spacing: .02em;
  text-transform: uppercase; color: var(--azul);
  background: var(--azul-suave); border-radius: 999px; padding: 4px 9px;
}
.derived__hint { margin: 0; font-size: 12.5px; color: var(--tx-suave); }
.derived__hint--err { color: var(--vermelho); font-weight: 600; }

/* Alerta de PRAZO (R-10): o prazo não define o progresso, só chama atenção. */
.prazo-alerta {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; border-radius: 999px; padding: 3px 9px;
}
.prazo-alerta--estourado { color: var(--vermelho); background: var(--vermelho-suave); }
.prazo-alerta--atencao { color: var(--ambar); background: var(--ambar-suave); }

/* --- Perfil do profissional (mini currículo — R-21) ------------------------
   Modal de leitura: cabeçalho com avatar, blocos de informação e a explicação
   de COMO se homologa (R-22, pergunta direta da cliente). */
.prof-card__acoes { display: flex; gap: 8px; flex-wrap: wrap; }
.prof-card__acoes .btn { flex: 1 1 auto; min-height: 44px; }

.perfil__head { display: flex; align-items: center; gap: 14px; }
.perfil__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.perfil__sec { margin-bottom: 18px; }
.perfil__sec h4 {
  margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--tx-suave);
}
.perfil__sec p { margin: 0; color: var(--tx); line-height: 1.55; }
.perfil__linha { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--nevoa); }
.perfil__linha:last-child { border-bottom: 0; }
.perfil__rot { flex: 0 0 92px; color: var(--tx-suave); font-size: 13px; }
.perfil__val { color: var(--tx-forte); font-size: 13.5px; word-break: break-word; }
.perfil__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.perfil__obras { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.perfil__obras li { color: var(--tx); }
.perfil__sec--nota {
  background: var(--azul-suave); border-radius: 12px; padding: 14px 16px; margin-bottom: 0;
}
.perfil__sec--nota h4 { color: var(--azul-profundo); }

@media (max-width: 640px) {
  .perfil__linha { flex-direction: column; gap: 2px; }
  .perfil__rot { flex: none; }
  .prof-card__acoes { flex-direction: column; }
}

/* --- Card de métrica CLICÁVEL (drill-down — R-09) --------------------------
   O card virou <button>: reseta a aparência de botão, mantém o alinhamento à
   esquerda e ganha affordance (seta + hover/focus). O alvo de toque é o card
   inteiro, bem acima dos 44px. */
.metric--go {
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.metric--go:focus-visible { outline: 3px solid var(--azul); outline-offset: 2px; }
.metric__go {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 2px; font-size: 12px; font-weight: 600; color: var(--azul);
}
.metric__go svg { transition: transform .18s ease; }

/* Número/rótulo clicável dentro de tabela (ex.: obras da construtora — R-11) */
.linkish {
  background: none; border: 0; padding: 0; font: inherit; cursor: pointer;
  color: var(--azul); font-weight: 700; text-decoration: underline;
  text-underline-offset: 3px; min-height: 44px;
}
.linkish:focus-visible { outline: 3px solid var(--azul); outline-offset: 2px; border-radius: 6px; }

/* --- Edição dos indicadores ESG (R-12) ------------------------------------ */
.esgproj__editar { width: 100%; margin-top: 12px; min-height: 44px; }
.field__hint { display: block; margin-top: 5px; font-size: 12px; color: var(--tx-suave); line-height: 1.4; }

/* --- Capacitação: conteúdo do módulo e progresso (R-17/18) ---------------- */
.jornada-resumo {
  background: var(--nevoa); border-radius: 12px; padding: 14px 16px; margin-bottom: 18px;
}
.jornada-acoes { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.jornada-acoes .btn { min-height: 44px; }
.evo-item--ok .evo-item__perc { background: var(--lima-suave); color: var(--verde); }

.modulo__obj {
  background: var(--azul-suave); border-radius: 12px; padding: 14px 16px; margin-bottom: 20px;
}
.modulo__obj h4 {
  margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--azul-profundo);
}
.modulo__lista { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: var(--tx); }
.modulo__topico { margin-bottom: 18px; }
.modulo__topico h4 {
  display: flex; align-items: center; gap: 9px;
  margin: 0 0 6px; font-size: 15px; color: var(--tx-forte);
}
.modulo__n {
  display: inline-grid; place-items: center; width: 24px; height: 24px; flex: 0 0 24px;
  border-radius: 50%; background: var(--azul); color: #fff; font-size: 12px; font-weight: 700;
}
.modulo__topico p { margin: 0; color: var(--tx); line-height: 1.6; }

@media (max-width: 640px) {
  .jornada-acoes { flex-direction: column; }
  .jornada-acoes .btn { width: 100%; }
}

/* --- Evolução semanal: duas colunas que EMPACOTAM (R-13) ------------------
   Antes eram duas grades de 2 colunas: como o formulário é bem mais baixo que
   o histórico, sobrava um rasgo de espaço em branco e a fileira de baixo só
   começava depois do card mais alto. Cada coluna agora empilha os seus. */
.evo-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 18px;
  align-items: start;
}
.evo-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

/* O cabeçalho do card não pode ser espremido pelo botão: o texto tem prioridade
   e o botão desce quando não couber (era o caso do card "Treinamentos"). */
.card__head { flex-wrap: wrap; }
.card__head > div:first-child { flex: 1 1 220px; min-width: 0; }
.card__head .btn { flex: 0 0 auto; min-height: 40px; }

/* Item do histórico agora é clicável (R-14): vira botão de largura total. */
.evo-item--click {
  width: 100%; text-align: left; font: inherit; color: inherit;
  cursor: pointer; -webkit-appearance: none; appearance: none;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.evo-item--click:focus-visible { outline: 3px solid var(--azul); outline-offset: 2px; }

@media (max-width: 900px) {
  .evo-layout { grid-template-columns: minmax(0, 1fr); }
}

/* --- Central de ajuda: manutenção do conteúdo pelo admin (R-15) ----------- */
.help-read__acoes {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--nevoa);
}
.help-read__acoes .btn { min-height: 44px; }
@media (max-width: 640px) {
  .help-read__acoes { flex-direction: column; }
  .help-read__acoes .btn { width: 100%; }
}

/* --- Conteúdo do site: o "back" do site institucional (R-01) -------------- */
.site-campo label { display: flex; align-items: center; gap: 8px; }
.site-campo__tag {
  font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--azul); background: var(--azul-suave); border-radius: 999px; padding: 3px 8px;
}
.site-img { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.site-img img {
  width: 190px; height: 120px; object-fit: cover;
  border-radius: 12px; border: 1px solid var(--cinza); background: var(--nevoa);
}
.site-img__acoes { flex: 1 1 220px; min-width: 0; }
.site-acoes {
  display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap;
  margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--nevoa);
}
.site-acoes .btn { min-height: 44px; }
@media (max-width: 640px) {
  .site-img img { width: 100%; height: 160px; }
  .site-acoes { flex-direction: column-reverse; }
  .site-acoes .btn { width: 100%; }
}


/* ===========================================================================
   REVISÃO ADVERSARIAL DE DESIGN MOBILE — correções medidas em iPhone 13 (390px)
   Um bloco só, no fim do arquivo, para não ser derrotado por ordem de fonte.
   =========================================================================== */

/* --- Navegação: a gaveta cortava os últimos itens do menu em silêncio -------
   .nav é overflow-y:auto dentro de uma sidebar flex-column; sem poder encolher
   (min-height:0) ela estourava e os últimos destinos ficavam inalcançáveis. */
.sidebar { display: flex; flex-direction: column; }
.nav { flex: 1 1 auto; min-height: 0; overscroll-behavior: contain; }
.sidebar__foot { flex: 0 0 auto; }

/* --- Campo de arquivo em português -----------------------------------------
   O controle nativo mostra "Choose File / No file chosen" conforme o locale do
   APARELHO — texto que não controlamos. O input real fica acessível porém fora
   de vista, e o label vira o botão. */
.filepick { display: grid; gap: 8px; justify-items: start; }
.filepick__input {
  position: absolute; width: 1px; height: 1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.filepick__btn { margin: 0; min-height: 44px; cursor: pointer; }
.filepick__input:focus-visible + .filepick__btn { outline: 3px solid var(--azul); outline-offset: 2px; }
.filepick__nome { font-size: 12.5px; color: var(--tx-suave); word-break: break-word; }
.filepick__nome--ok { color: var(--tx-forte); font-weight: 600; }

/* --- Estrelas com fração real ----------------------------------------------
   Antes o widget arredondava (4,6 e 5,0 saíam iguais). A barra de preenchimento
   precisa ser inline-block para respeitar width; em âmbar, porque lima sobre
   branco tem contraste ruim. */
.stars {
  position: relative; display: inline-block; letter-spacing: 2px;
  font-size: 14px; line-height: 1; white-space: nowrap;
}
.stars__base { color: var(--cinza-forte); }
.stars__fill {
  position: absolute; top: 0; left: 0; height: 100%;
  display: inline-block; overflow: hidden; white-space: nowrap;
  color: var(--ambar); pointer-events: none;
}

/* --- Status pendente com o mesmo tratamento de chip dos demais --------------- */
.badge--pend { background: var(--ambar-suave); color: var(--ambar); }

/* --- Busca dentro de cartão: 260px só faz sentido no desktop ---------------- */
.input-icon--busca { flex: 1 1 240px; min-width: 0; max-width: 260px; }

/* --- Altura do textarea em múltiplo de linha -------------------------------
   Sem line-height a última linha era cortada ao meio e o glifo atravessava a
   borda do campo — num CMS isso lê como defeito de renderização. */
textarea.input { line-height: 1.5; }

@media (max-width: 640px) {
  /* Alvo de toque na RAIZ, não repetido componente a componente. */
  .btn { min-height: 44px; }
  .pill { min-height: 44px; padding: 0 16px; display: inline-flex; align-items: center; }
  .icon-btn { min-width: 44px; min-height: 44px; }
  .select { min-height: 44px; }
  .userchip__out {
    min-width: 44px; min-height: 44px; padding: 0;
    display: inline-grid; place-items: center;
  }

  /* O botão do cabeçalho do card caía numa linha só para ele, encostado à
     direita e com 40px — contrariando a própria regra dos 44px. */
  .card__head .btn { flex: 1 1 100%; width: 100%; min-height: 44px; }

  /* Submit de formulário ocupa a largura toda (o "Enviar evolução" ficava com
     183px encostado à direita e 174px de branco à esquerda). */
  .card__body form .btn--primary { width: 100%; }

  /* Campos longos: linhas inteiras, sem alça de resize sobre o canto. */
  textarea.input { min-height: calc(1.5em * 5 + 24px); resize: none; }
  .site-campo textarea.input { min-height: calc(1.5em * 7 + 24px); }

  /* Buscas e selects não podem ficar presos por largura de desktop. */
  .input-icon--busca { flex: 1 1 100%; max-width: none; }
  .card__body .input-icon { max-width: none !important; width: 100%; }
  .toolbar .select, .card__head .select { max-width: none !important; }

  /* Capacitação: a linha do topo quebrava "· 20 min" em duas, e os botões
     ficavam recuados atrás do tile, com uma faixa branca vertical à esquerda. */
  .evo-item__top { flex-wrap: wrap; row-gap: 4px; }
  .evo-item__top .muted { white-space: nowrap; }
  .evo-item__perc { width: 44px; height: 44px; font-size: 13px; }
  .jornada-acoes { margin-left: -58px; }

  /* A barra de progresso da jornada era névoa sobre névoa: contraste zero. */
  .jornada-resumo .esg-track { background: #fff; box-shadow: inset 0 0 0 1px var(--cinza); }

  /* ESG: "97% do previsto · dentro do orçamento" não cabia e caía alinhado à
     esquerda, quebrando o ritmo rótulo/valor das outras linhas. */
  .esg-ind { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; font-size: 13px; }
  .esg-ind__v { white-space: normal; text-align: right; }
  .esg-ind__grp { font-size: 11px; }

  /* Cartão dentro de cartão comia ~24% da largura útil. */
  .card__body { padding: 14px; }

  /* .linkish inflava a altura da linha; a área de toque vem do padding. */
  .linkish { min-height: 0; padding: 12px 0; }

  /* Os cards de métrica alinham o CTA no rodapé, sem vão no meio. */
  .metric__go { margin-top: auto; }

  /* Barra de salvar sempre à mão numa página longa como o CMS. */
  .site-acoes {
    position: sticky; bottom: 0; z-index: 5; background: #fff;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    box-shadow: 0 -8px 24px rgba(16, 24, 46, .08);
  }
}

/* Pista de que a navegação rola: sem isto o menu simplesmente "acabava" numa
   faixa vazia e os últimos destinos pareciam não existir no celular. */
.nav { -webkit-mask-image: linear-gradient(#000 calc(100% - 24px), transparent); mask-image: linear-gradient(#000 calc(100% - 24px), transparent); }
.nav::-webkit-scrollbar { width: 4px; }
.nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.22); border-radius: 4px; }
@media (min-width: 901px) { .nav { -webkit-mask-image: none; mask-image: none; } }


/* --- Densidade e hierarquia (2ª rodada de revisão de design) --------------- */

/* Filtros colapsáveis: no desktop o <details> é transparente (tudo em linha);
   no celular vira um botão "Filtros" e devolve a primeira tela ao conteúdo. */
.filtros-mob > summary { display: none; }
.filtros-mob__campos { display: contents; }
.toolbar--rede .select { width: auto; min-width: 150px; flex: 0 0 auto; }

/* Campo curto que virou textarea no CMS: não deve parecer um campo de parágrafo. */
.input--curto { min-height: 0 !important; resize: none; }

@media (max-width: 640px) {
  .filtros-mob > summary {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; min-height: 44px; list-style: none; cursor: pointer;
  }
  .filtros-mob > summary::-webkit-details-marker { display: none; }
  .filtros-mob__campos { display: grid; gap: 8px; margin-top: 8px; }
  .toolbar--rede .select { width: 100%; min-width: 0; flex: 1 1 auto; }
  .input--curto { min-height: calc(1.5em * 2 + 24px) !important; }
}

@media (max-width: 640px) {
  /* Na tabela compacta o valor fica à direita na mesma linha: sem permitir
     quebra, um e-mail longo empurrava a página inteira (overflow horizontal). */
  .tbl--compact td { min-width: 0; gap: 10px; }
  .tbl--compact td > * { min-width: 0; overflow-wrap: anywhere; }
  .tbl--compact td[data-label]::before { white-space: nowrap; }
  .tbl--compact td a { overflow-wrap: anywhere; }
}


/* --- Hover só onde existe ponteiro de verdade ------------------------------
   No Safari do iPhone o :hover fica GRUDADO depois do toque (o card continua
   levantado, o item da lista continua cinza brigando com o estado ativo).
   Gated por (hover: hover): no desktop nada muda; no celular some. */
@media (hover: hover) and (pointer: fine) {
  .video-card:hover .video-card__play span { transform: scale(1.08); background: #fff; }
  a:hover { text-decoration: underline; }
  .btn--primary:hover { background-image: var(--grad-azul-hover); transform: translateY(-2px); }
  .btn--lima:hover { background: #c0cd00; transform: translateY(-2px); }
  .btn--ghost:hover { border-color: var(--azul); color: var(--azul); background: #fff; }
  .btn--danger:hover { background: var(--vermelho); color: #fff; border-color: var(--vermelho); }
  .nav__item:hover { background: var(--noite-2); color: #fff; text-decoration: none; }
  .userchip__out:hover { color: #fff; background: rgba(255,255,255,.08); }
  .metric:hover { transform: translateY(-3px); box-shadow: var(--sh-card-h); }
  .barchart__bar:hover { filter: brightness(1.08) saturate(1.1); }
  .tbl tbody tr:hover { background: #fafbff; }
  input[type="file"].input::file-selector-button:hover { background: var(--azul-hover); }
  .pill:hover { border-color: var(--azul); color: var(--azul); }
  .icon-btn:hover { color: var(--azul); border-color: var(--azul); }
  .icon-btn--danger:hover { color: var(--vermelho); border-color: var(--vermelho); background: #fff; }
  .login-split .field .olho:hover { background: var(--cinza); }
  .login-split .esqueci:hover { text-decoration: underline; }
  .login-split .btn:hover { filter: brightness(1.05); transform: translateY(-2px); box-shadow: 0 16px 34px -8px rgba(59,109,242,.6); }
  .login-split .apoio a:hover { text-decoration: underline; }
  .modal__x:hover { background: var(--nevoa); color: var(--tx-forte); }
  .help-item:hover { background: var(--nevoa); }
  .video-card:hover { transform: translateY(-3px); box-shadow: var(--sh-card-h); }
  .prof-card:hover { transform: translateY(-3px); box-shadow: var(--sh-card-h); }
  .metric--go:hover { transform: translateY(-2px); box-shadow: var(--sh-card-hover, 0 10px 24px rgba(16,24,46,.10)); }
  .metric--go:hover .metric__go { gap: 7px; }
  .linkish:hover { color: var(--azul-hover); }
  .evo-item--click:hover { border-color: var(--azul); box-shadow: 0 6px 16px rgba(59,109,242,.12); transform: translateY(-1px); }
}


/* --- Rodada 3 da revisão adversarial de design ----------------------------- */

/* A-6: .metrics tinha align-items:start, o que anulava o stretch do grid e
   deixava o margin-top:auto do CTA como código morto — os rodapés dos cards
   ficavam desalinhados em 29px na mesma fileira. */
.metrics { align-items: stretch; }

@media (max-width: 900px) {
  /* A-1: a gaveta mostrava 9 dos 13 destinos e TERMINAVA num vão vazio — lia
     como "a lista acabou". Quatro telas ficavam invisíveis para quem não
     adivinhasse que rolava. Agora o 10º item ESPIA (pista universal de
     rolagem) e o rodapé ganha sombra separando a lista do chip do usuário. */
  .nav__item { padding-top: 9px; padding-bottom: 9px; min-height: 44px; }
  .nav {
    -webkit-mask-image: linear-gradient(#000 calc(100% - 40px), rgba(0, 0, 0, .18));
            mask-image: linear-gradient(#000 calc(100% - 40px), rgba(0, 0, 0, .18));
  }
  .sidebar__foot { box-shadow: 0 -14px 18px -8px rgba(4, 10, 26, .75); }
}

@media (max-width: 640px) {
  /* A-2: a barra sticky do CMS empilhava os dois botões em largura total
     (129px = 19% da tela) e cortava o texto no meio do glifo, sem borda nem
     fundo que separasse. Volta a uma linha, com separação visível. */
  .site-acoes {
    flex-direction: row; gap: 8px; padding-top: 10px;
    border-top: 1px solid var(--nevoa);
    background: rgba(255, 255, 255, .94);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  }
  .site-acoes { flex-wrap: nowrap; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .site-acoes .btn {
    width: auto; flex: 1 1 0; min-width: 0; padding-left: 10px; padding-right: 10px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .site-campo:last-of-type { margin-bottom: 8px; }

  /* A-3: o overflow-wrap:anywhere matou o overflow mas despedaçou os valores —
     e-mail partido no meio do domínio e telefone em três linhas. Rótulo numa
     coluna, valor na outra, alinhado à direita; telefone nunca quebra. */
  .tbl--compact td[data-label] {
    display: grid; grid-template-columns: minmax(72px, max-content) minmax(0, 1fr);
    column-gap: 10px; row-gap: 2px; align-items: start;
  }
  .tbl--compact td[data-label]::before { grid-column: 1; grid-row: 1; }
  .tbl--compact td[data-label] > * { grid-column: 2; justify-self: end; text-align: right; }
  .tbl--compact td a { overflow-wrap: break-word; word-break: normal; }
  .tbl--compact td .muted { white-space: nowrap; }

  /* A-8: num cartão empilhado o nome do item é TÍTULO, não uma linha rotulada
     disputando espaço com o subtítulo. */
  .tbl--compact tbody td:first-child { display: block; text-align: left; }
  .tbl--compact tbody td:first-child::before { display: none; }
  .tbl--compact tbody td:first-child .strong { font-size: 15.5px; font-weight: 700; }

  /* A-9: na linha de arquivo o ícone caía ENTRE o rótulo e o nome. */
  .tbl--compact td .ct-name { align-items: center; }

  /* A-7: o <details> perdeu o marcador nativo e nada o substituiu — não se via
     que abria. Chevron próprio + fundo branco para destacar do fundo da página. */
  .filtros-mob > summary { background: #fff; }
  .filtros-mob > summary::after {
    content: ""; margin-left: auto; width: 8px; height: 8px;
    border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translate(-2px, -2px); transition: transform .15s ease;
  }
  .filtros-mob[open] > summary::after { transform: rotate(-135deg) translate(-2px, -2px); }

  /* A-10: 7 linhas mínimas em TODA textarea deixavam 59% de vazio e faziam a
     página do CMS ter 7,3 telas. */
  .site-campo textarea.input { min-height: calc(1.5em * 3 + 24px); }

  /* A-13: o botão de trocar imagem era o único controle do CMS que não ocupava
     a largura toda. */
  .filepick { justify-items: stretch; }
  .filepick__btn { width: 100%; }

  /* A-11: "Ver conteúdo" e "Realizar treinamento" tinham o mesmo peso; o
     secundário vira link e sobra hierarquia. */
  .jornada-acoes .btn--ghost {
    border: 0; background: none; color: var(--azul);
    text-decoration: underline; text-underline-offset: 3px; padding: 0 8px;
  }
}


/* Indicador de "há mais destinos" na gaveta. A classe é posta pelo JS só quando
   a navegação REALMENTE rola — não depende de o número de itens calhar de
   cortar no lugar certo. Sem isto o vão no fim da lista lia como "acabou" e
   quatro telas ficavam invisíveis no celular. */
.nav-mais {
  display: none; align-items: center; justify-content: center; gap: 6px;
  padding: 6px 12px 2px; font-size: 11.5px; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase; color: rgba(255, 255, 255, .55);
}
.sidebar.tem-mais .nav-mais { display: flex; }
.nav-mais::after {
  content: ""; width: 7px; height: 7px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
  animation: navMais 1.6s ease-in-out infinite;
}
@keyframes navMais {
  0%, 100% { transform: rotate(45deg) translate(-1px, -1px); }
  50% { transform: rotate(45deg) translate(1px, 1px); }
}
@media (prefers-reduced-motion: reduce) { .nav-mais::after { animation: none; } }
@media (min-width: 901px) { .nav-mais { display: none !important; } }

@media (max-width: 640px) {
  /* As ações ocupavam uma faixa rotulada inteira ("AÇÕES" + dois ícones) no fim
     de cada cartão — ~64px por registro. Vão para o canto superior direito, que
     é onde se espera encontrá-las num cartão. */
  .tbl--compact tbody tr { position: relative; }
  .tbl--compact tbody td:first-child { padding-right: 100px; }
  .tbl--compact td[data-label="Ações"] {
    position: absolute; top: 10px; right: 12px;
    padding: 0; border-bottom: 0; display: block; width: auto;
  }
  .tbl--compact td[data-label="Ações"]::before { display: none; }
  .tbl--compact td[data-label="Ações"] > * { justify-self: end; }
  .tbl--compact td[data-label="Ações"] .row-actions { justify-content: flex-end; gap: 4px; }
}
