/* =============================================================================
   LabCertificar Gestão Comercial — layout v2 (aprovado em 20/10/2026)
   Carregado DEPOIS de gestao_comercial.css: redefine os tokens (todas as telas
   herdam) e desenha a estrutura nova: barra superior, menu lateral estreito,
   abas de páginas e barra inferior no celular.
   Regras: verde só para marca e ação principal; cor de status tem significado
   fixo (vermelho = atrasado/perdido, âmbar = hoje/atenção, verde = ganho/ok).
   ============================================================================= */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/inter-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/static/fonts/inter-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/inter-latin-600-normal.woff2") format("woff2");
}

:root {
  /* Marca Certificar */
  --brand-green:       #2f8754;
  --brand-green-dark:  #1f513c;
  --brand-green-light: #ebf5ee;
  --brand-lime:        #8dc63f;

  /* Neutros: texto escuro e legível, fundo quase branco */
  --brand-ink:   #1b2420;
  --brand-gray:  #5b6660;
  --text-muted:  #87918c;
  --page:   #f6f8f7;
  --panel:  #ffffff;
  --panel2: #f9fbfa;
  --line:   #e3e8e5;
  --line-strong: #cfd7d2;

  /* Status com significado fixo */
  --ok-bg:    #e7f5ec;  --ok-text:    #1d6b40;
  --warn-bg:  #fdf3dc;  --warn-text:  #7a5410;
  --error-bg: #fcebea;  --error-text: #9b2a25;
  --info-bg:  #eef2f6;  --info-text:  #384a5c;
  --dot-late:  #d9483f;
  --dot-today: #e39b24;
  --dot-ok:    #3c9a5f;

  /* Tipografia maior e mais confortável para uso o dia todo */
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --fs-xs:   0.78rem;   /* 12.5px */
  --fs-sm:   0.875rem;  /* 14px   */
  --fs-base: 0.96875rem;/* 15.5px */
  --fs-md:   1.0625rem; /* 17px   */
  --fs-lg:   1.25rem;
  --fs-xl:   1.5rem;
  --fs-2xl:  1.75rem;

  --shadow-sm: none;
  --shadow:    0 1px 2px rgba(20, 36, 28, .04);
  --radius:    12px;

  --topbar-h:  60px;
  --sidenav-w: 88px;
  --bottomnav-h: 64px;
}

/* ── Base ─────────────────────────────────────────────────────────────────── */
html { -webkit-text-size-adjust: 100%; }
body.app-body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.55;
  color: var(--brand-ink);
  background: var(--page);
  background-image: none;
}
.app-body h1, .app-body h2, .app-body h3, .app-body h4 {
  color: var(--brand-ink);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.app-body h1 { font-size: var(--fs-2xl); margin: 0; }
.app-body h2 { font-size: var(--fs-lg); margin: 0 0 .5rem; }
.app-body h3 { font-size: var(--fs-md); }
.app-body p, .app-body .section-helper { color: var(--brand-gray); }
.app-body .section-helper { font-size: var(--fs-sm); }
.app-body a { color: var(--brand-green-dark); }

/* ── Barra superior ───────────────────────────────────────────────────────── */
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--brand-ink);
  font-weight: 600;
  flex-shrink: 0;
}
.app-brand img { height: 30px; width: auto; display: block; }
.app-brand span { font-size: var(--fs-sm); color: var(--brand-gray); border-left: 1px solid var(--line); padding-left: 10px; }
.app-search {
  flex: 1;
  min-width: 0;
  max-width: 520px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel2);
  color: var(--text-muted);
}
.app-search:focus-within { border-color: var(--brand-green); background: var(--panel); }
.app-body .app-search input[type="search"] {
  flex: 1;
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  box-shadow: none;
  padding: 0;
  height: 100%;
  background: transparent;
  font: inherit;
  color: var(--brand-ink);
  min-width: 0;
}
.app-topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.app-topbar .alert-bell-btn { width: 40px; height: 40px; border-radius: 10px; }

/* Menu do usuário */
.app-user { position: relative; }
.app-user summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 4px;
  border-radius: 999px;
  cursor: pointer;
}
.app-user summary::-webkit-details-marker { display: none; }
.app-user summary:hover { background: var(--panel2); }
.app-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-green-light);
  color: var(--brand-green-dark);
  font-weight: 600;
  font-size: var(--fs-sm);
}
.app-user__name { font-weight: 500; font-size: var(--fs-sm); }
.app-user__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 220px;
  padding: 6px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(20, 36, 28, .10);
  display: flex;
  flex-direction: column;
}
.app-user__who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: flex; flex-direction: column; }
.app-user__who span { font-size: var(--fs-xs); color: var(--text-muted); text-transform: capitalize; }
.app-user__menu a, .app-user__menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--brand-ink);
  font: inherit;
  font-size: var(--fs-sm);
  text-decoration: none;
  cursor: pointer;
}
.app-user__menu a:hover, .app-user__menu button:hover { background: var(--panel2); }
.app-user__menu form { margin: 0; }

/* ── Estrutura: menu lateral estreito + conteúdo ─────────────────────────── */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidenav-w) minmax(0, 1fr);
  min-height: calc(100vh - var(--topbar-h));
}
.app-sidenav {
  position: sticky;
  top: var(--topbar-h);
  align-self: start;
  height: calc(100vh - var(--topbar-h));
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 0;
  background: var(--panel);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}
.app-sidenav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  color: var(--brand-gray);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 500;
  text-align: center;
  line-height: 1.2;
  background: transparent;
}
.app-sidenav__item:hover { background: var(--panel2); color: var(--brand-ink); }
.app-sidenav__item.active {
  background: var(--brand-green-light);
  color: var(--brand-green-dark);
}
.app-sidenav__item .nav-icon { flex-shrink: 0; }
.app-sidenav__item[data-parent-key="conta"] { margin-top: auto; }

.app-main {
  min-width: 0;
  padding: 24px 32px 48px;
  max-width: 1280px;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
}
.app-main .page-header {
  display: flex;
  flex-direction: row;
  text-align: left;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  background: none;
}

/* Abas de páginas do menu ativo */
.app-subtabs {
  display: flex;
  gap: 4px;
  margin: 0 0 20px;
  padding: 0;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
  background: none;
  box-shadow: none;
  border-radius: 0;
  flex-wrap: nowrap;
}
.app-subtabs::-webkit-scrollbar { display: none; }
.app-subtabs a {
  flex-shrink: 0;
  padding: 10px 12px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  color: var(--brand-gray);
  text-decoration: none;
  font-weight: 500;
  font-size: var(--fs-sm);
  border-radius: 0;
  background: none;
  white-space: nowrap;
}
.app-subtabs a:hover { color: var(--brand-ink); background: none; }
.app-subtabs a.active {
  color: var(--brand-green-dark);
  border-bottom-color: var(--brand-green);
  background: none;
}

/* ── Componentes (valem para todas as telas) ─────────────────────────────── */
.app-body .card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: none;
  padding: 20px 22px;
  margin-bottom: 16px;
}
.app-body .primary-button {
  background: var(--brand-green);
  border: 1px solid var(--brand-green);
  color: #fff;
  border-radius: 10px;
  min-height: 40px;
  padding: 0 16px;
  font: inherit;
  font-weight: 600;
  font-size: var(--fs-sm);
  box-shadow: none;
}
.app-body .primary-button:hover { background: var(--brand-green-dark); border-color: var(--brand-green-dark); }
.app-body .secondary-button,
.app-body .secondary-link {
  background: var(--panel);
  border: 1px solid var(--line-strong);
  color: var(--brand-ink);
  border-radius: 10px;
  min-height: 38px;
  padding: 0 14px;
  font: inherit;
  font-weight: 500;
  font-size: var(--fs-sm);
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.app-body .secondary-button:hover,
.app-body .secondary-link:hover { background: var(--panel2); border-color: var(--brand-gray); }
.app-body input[type="text"], .app-body input[type="search"], .app-body input[type="email"],
.app-body input[type="password"], .app-body input[type="number"], .app-body input[type="date"],
.app-body input[type="time"], .app-body select, .app-body textarea {
  font: inherit;
  font-size: var(--fs-sm);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--panel);
  color: var(--brand-ink);
}
.app-body input:focus, .app-body select:focus, .app-body textarea:focus {
  outline: none;
  border-color: var(--brand-green);
  box-shadow: 0 0 0 3px rgba(47, 135, 84, .15);
}
.app-body .notice { border-radius: 10px; font-size: var(--fs-sm); }
.app-body table { font-size: var(--fs-sm); }
.app-body th {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--brand-gray);
  background: var(--panel2);
}
.app-body td, .app-body th { border-color: var(--line); }

/* Números de destaque (cartões de indicador) */
.app-body .metric-card strong,
.app-body .stat-card strong { font-size: var(--fs-2xl); font-weight: 600; color: var(--brand-ink); }
.app-body .metric-card span:first-child,
.app-body .stat-card span:first-child { font-size: var(--fs-xs); color: var(--brand-gray); letter-spacing: .02em; }

/* Status com cor fixa */
.status-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.status-dot.is-late  { background: var(--dot-late); }
.status-dot.is-today { background: var(--dot-today); }
.status-dot.is-ok    { background: var(--dot-ok); }

/* ── Tela Hoje (Minha fila) ───────────────────────────────────────────────── */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.today-hero { margin: 0 0 16px; }
.today-hero__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.app-body .today-hero__greeting { margin: 0; font-size: var(--fs-xl); font-weight: 600; color: var(--brand-ink); letter-spacing: -0.01em; }
.app-body .today-hero__date { margin: 0; font-size: var(--fs-sm); color: var(--brand-gray); }
.today-hero__filter select { min-height: 40px; padding: 0 10px; }
.today-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.today-kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.today-kpi span { display: block; font-size: var(--fs-xs); color: var(--brand-gray); font-weight: 500; }
.today-kpi strong { display: block; font-size: var(--fs-2xl); font-weight: 600; line-height: 1.2; margin-top: 2px; }
.today-kpi strong.is-empty { color: var(--text-muted); }
.today-kpi.is-late strong { color: var(--error-text); }
.today-kpi__bar { height: 6px; border-radius: 3px; background: var(--brand-green-light); margin-top: 8px; overflow: hidden; }
.today-kpi__bar div { height: 100%; background: var(--brand-green); border-radius: 3px; }

.empty-card { text-align: left; }
.empty-card h2 { margin-bottom: 4px; }
.empty-card p { margin: 0 0 14px; max-width: 60ch; }

.app-body .queue-card { padding: 18px 0 4px; }
.queue-card > h2 { padding: 0 22px; margin-bottom: 6px; }
.queue-list { list-style: none; margin: 0; padding: 0; }
.queue-row { padding: 14px 22px; border-top: 1px solid var(--line); }
.queue-row:first-child { border-top: 0; }
.queue-row__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.app-body .queue-row__company { font-weight: 600; color: var(--brand-ink); text-decoration: none; font-size: var(--fs-md); }
.app-body .queue-row__company:hover { text-decoration: underline; }
.queue-row__origin { font-size: var(--fs-xs); color: var(--text-muted); }
.queue-row__head .status-pill { margin-left: auto; }
.app-body .queue-row__detail { margin: 4px 0 10px 19px; font-size: var(--fs-sm); color: var(--brand-gray); }
.app-body .queue-row__detail strong { color: var(--brand-ink); font-weight: 500; }
.queue-row__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-left: 19px; }
.queue-row__actions .contact-bar, .queue-row__actions .one-click-results { margin-top: 0; }
.queue-row .routine-quick-actions { margin: 8px 0 0 19px; }
.queue-row .routine-quick-actions summary { font-size: var(--fs-xs); min-height: 0; border: 0; padding: 0; color: var(--brand-gray); background: none; }

.status-pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 500; white-space: nowrap; }
.status-pill.is-late  { background: var(--error-bg); color: var(--error-text); }
.status-pill.is-today { background: var(--warn-bg);  color: var(--warn-text); }
.status-pill.is-ok    { background: var(--ok-bg);    color: var(--ok-text); }
.status-pill.is-info  { background: var(--info-bg);  color: var(--info-text); }

@media (max-width: 760px) {
  .today-kpis { gap: 8px; }
  .today-kpi { padding: 10px 12px; }
  .today-kpi strong { font-size: var(--fs-xl); }
  .queue-row { padding: 14px 16px; }
  .queue-card > h2 { padding: 0 16px; }
  .queue-row__head .status-pill { margin-left: 0; }
  .app-body .queue-row__detail, .queue-row__actions, .queue-row .routine-quick-actions { margin-left: 0; }
  .contact-bar, .one-click-results { width: 100%; }
  .contact-bar a { flex: 1; justify-content: center; white-space: nowrap; padding-left: 8px; padding-right: 8px; }
  .one-click-results { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .one-click-results .section-helper { grid-column: 1 / -1; }
  .one-click-results .inline-form, .one-click-results button { width: 100%; }
  .one-click-results button { flex-direction: column; justify-content: center; gap: 0; padding: 6px 8px; line-height: 1.2; white-space: nowrap; }
  .one-click-results button small { display: block; font-size: 0.6875rem; }
  /* valor da proposta (G30-02): o botão vira 1 célula e o formulário aberto ocupa a linha toda */
  .one-click-results .value-popover > summary { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; padding: 6px 8px; line-height: 1.2; text-align: center; }
  .one-click-results .value-popover[open] { grid-column: 1 / -1; }
  .one-click-results .value-popover .quick-action-form button { white-space: normal; }
  .app-body .queue-card { padding: 14px 0 4px; }
  /* conteudo antigo nunca passa da largura da tela; tabela rola dentro da caixa */
  .app-main section, .app-main article, .app-main form, .app-main fieldset,
  .app-main .card, .app-main .sheet-form, .app-main label, .app-main details, .app-main dl, .app-main .detail-section { min-width: 0; max-width: 100%; box-sizing: border-box; }
  .app-main .toolbar, .app-main .filter-toolbar, .app-main .link-actions { flex-wrap: wrap; }
  .app-main details, .app-main .detail-section { grid-template-columns: minmax(0, 1fr); }
  .app-main select, .app-main input, .app-main textarea { max-width: 100%; box-sizing: border-box; }
  .app-main .sheet-form select, .app-main .sheet-form input { width: 100%; }
  .app-main .worklist-card, .app-main .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .app-main table { display: block; max-width: 100%; overflow-x: auto; }
  .app-main pre, .app-main code { white-space: pre-wrap; word-break: break-word; }
  .app-main .card, .app-main .notice { overflow-wrap: anywhere; }
  .app-main table { overflow-wrap: normal; }
  .app-main [class*="grid"], .app-main [class*="cards-"], .app-main .workbench-layout { grid-template-columns: minmax(0, 1fr) !important; }
  .board { grid-auto-columns: 82vw; scroll-snap-type: x mandatory; }
  .board-col { scroll-snap-align: start; }
  .app-main .clients-layout .worklist-card { position: static; max-height: none; }
  .app-main .clients-layout.has-selected .worklist-card { display: none; }
  .clients-layout.has-selected .clients-back { display: inline-block; }
  .funnel-filters__form { position: static; width: auto; margin-top: 8px; }
  .app-main [class*="grid"] > *, .app-main [class*="cards-"] > * { min-width: 0; }
  .app-brand span { display: none; }
  .app-brand img { height: 24px; }
  .app-topbar { gap: 8px; }
  .app-user summary { padding: 2px; }
}

/* ── Funil: quadro com arrastar e soltar (etapa 2) ───────────────────────── */
.funnel-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.funnel-kpis { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: var(--fs-sm); color: var(--brand-gray); }
.funnel-kpis strong { color: var(--brand-ink); font-weight: 600; }
.funnel-kpis .is-late strong { color: var(--error-text); }
.funnel-kpis .is-today strong { color: var(--warn-text); }
.funnel-filters { position: relative; }
.funnel-filters summary { list-style: none; cursor: pointer; }
.funnel-filters summary::-webkit-details-marker { display: none; }
.funnel-filters__form {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 320px;
  display: grid; gap: 10px; padding: 16px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(20,36,28,.10);
}
.board {
  display: grid;
  /* uma coluna ao lado da outra, quantas houver (vendas 8, licitações 7) */
  grid-auto-flow: column;
  grid-auto-columns: minmax(220px, 1fr);
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  align-items: start;
}
.board-col {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  min-height: 160px;
  transition: background var(--transition), border-color var(--transition);
}
.board-col.is-over { background: var(--brand-green-light); border-color: var(--brand-green); }
.board-col__head { display: flex; align-items: baseline; gap: 8px; padding: 4px 4px 10px; }
.app-body .board-col__head h2 { font-size: var(--fs-sm); margin: 0; }
.board-col__count { font-size: var(--fs-xs); color: var(--brand-gray); background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; }
.board-col__value { margin-left: auto; font-size: var(--fs-xs); color: var(--brand-gray); }
.board-col__cards { display: flex; flex-direction: column; gap: 8px; max-height: 70vh; overflow-y: auto; }
.board-col__empty { font-size: var(--fs-xs); color: var(--text-muted); text-align: center; padding: 16px 0; margin: 0; }
.board-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: var(--fs-sm);
}
.board-card[draggable="true"] { cursor: grab; }
.board-card.is-dragging { opacity: .5; }
.board-card.is-overdue { border-left: 3px solid var(--dot-late); border-radius: 0 10px 10px 0; }
.board-card__top { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 4px; }
.board-card__source { font-size: 0.6875rem; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .03em; }
.board-card .status-pill { font-size: 0.6875rem; padding: 1px 8px; }
.app-body .board-card__company { display: block; font-weight: 600; color: var(--brand-ink); text-decoration: none; line-height: 1.3; }
.app-body .board-card__company:hover { text-decoration: underline; }
.app-body .board-card__next { margin: 4px 0 0; font-size: var(--fs-xs); color: var(--brand-ink); }
.app-body .board-card__meta { margin: 4px 0 0; font-size: var(--fs-xs); color: var(--brand-gray); }
.board-card__more { margin-top: 6px; }
.board-card__more summary { font-size: var(--fs-xs); color: var(--brand-gray); cursor: pointer; list-style: none; }
.board-card__more summary::-webkit-details-marker { display: none; }
.board-card__move { display: grid; gap: 6px; margin-top: 6px; }
.board-card__move select, .board-card__move input { min-height: 34px; font-size: var(--fs-xs); }
.board-card__move button { min-height: 34px; }

.close-dialog { border: 1px solid var(--line); border-radius: 14px; padding: 22px; width: min(420px, calc(100vw - 32px)); box-shadow: 0 16px 48px rgba(20,36,28,.18); }
.close-dialog::backdrop { background: rgba(20, 36, 28, .35); }
.close-dialog form { display: grid; gap: 12px; }
.close-dialog__options { display: flex; gap: 8px; flex-wrap: wrap; }
.close-dialog__options label { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px; border: 1px solid var(--line-strong); border-radius: 10px; cursor: pointer; font-weight: 500; }
.close-dialog__options label:has(input:checked) { border-color: var(--brand-green); background: var(--brand-green-light); }
.close-dialog__error { color: var(--error-text); font-size: var(--fs-sm); margin: 0; }

/* ── Clientes: lista + ficha lateral (etapa 2) ───────────────────────────── */
.app-main .clients-layout { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 16px; align-items: start; }
.app-main .clients-layout .worklist-card { padding: 16px 0 0; position: sticky; top: calc(var(--topbar-h) + 16px); max-height: calc(100vh - var(--topbar-h) - 32px); display: flex; flex-direction: column; overflow: hidden; }
.app-main .clients-layout .worklist-card > h2 { padding: 0 16px; display: flex; align-items: center; gap: 8px; }
.clients-search { display: flex; gap: 6px; padding: 4px 16px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.app-body .clients-search input[type="search"] { flex: 1 1 160px; min-height: 38px; padding: 0 10px; }
.app-body .clients-search select { flex: 0 1 140px; min-height: 38px; }
.client-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; }
.client-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; padding: 11px 16px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--brand-ink); }
.client-row:hover { background: var(--panel2); }
.client-row.is-active { background: var(--brand-green-light); box-shadow: inset 3px 0 0 var(--brand-green); }
.client-row__name { font-weight: 600; font-size: var(--fs-sm); line-height: 1.3; }
.client-row .status-pill { align-self: start; font-size: 0.6875rem; padding: 1px 8px; }
.client-row__meta { grid-column: 1 / -1; font-size: var(--fs-xs); color: var(--brand-gray); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-main .clients-layout .detail-card { min-width: 0; }
.client-contact { margin: 0 0 14px; }
.clients-back { display: none; font-size: var(--fs-sm); text-decoration: none; margin-bottom: 8px; }

/* ── Tablet ───────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .app-main { padding: 20px 20px 40px; }
  .app-brand span { display: none; }
}

/* ── Celular: menu vira barra inferior; conteúdo ocupa a tela toda ───────── */
@media (max-width: 760px) {
  :root { --topbar-h: 56px; }
  .app-topbar { padding: 0 12px; gap: 10px; }
  .app-brand img { height: 26px; }
  .app-user__name { display: none; }
  .app-search { height: 38px; }
  .app-shell { display: block; min-height: 0; }
  .app-sidenav {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 45;
    height: var(--bottomnav-h);
    flex-direction: row;
    gap: 0;
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
    border-right: 0;
    border-top: 1px solid var(--line);
    overflow-x: auto;
    overflow-y: hidden;
  }
  .app-sidenav__item { flex: 1 0 64px; padding: 6px 2px; font-size: 0.6875rem; border-radius: 10px; }
  .app-sidenav__item[data-parent-key="conta"] { margin-top: 0; }
  .app-main { padding: 16px 14px calc(var(--bottomnav-h) + 24px); }
  .app-body h1 { font-size: var(--fs-xl); }
  .app-body .card { padding: 16px; border-radius: 12px; }
  .app-body .primary-button, .app-body .secondary-button { min-height: 44px; }
}

/* ── Resultados do mes (etapa 3) ─────────────────────────────────────────── */
.month-nav { display: flex; align-items: center; gap: 8px; }
.month-nav .secondary-button { min-width: 38px; justify-content: center; padding: 0 10px; }
.month-nav__label { font-weight: 600; min-width: 140px; text-align: center; }
.results-filter { margin: 0 0 14px; }
.results-filter select { min-height: 40px; padding: 0 10px; min-width: 220px; }
.results-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.results-kpi small { display: block; margin-top: 6px; font-size: var(--fs-xs); color: var(--brand-gray); }
.results-kpi small.is-muted { color: var(--text-muted); }
.results-kpi.is-win strong { color: var(--ok-text); }
.results-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.hbar-list { list-style: none; margin: 8px 0 10px; padding: 0; display: grid; gap: 10px; }
.hbar-list li { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr) 2.5rem; gap: 10px; align-items: center; font-size: var(--fs-sm); }
.hbar-list__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-list__bar { height: 10px; border-radius: 5px; background: var(--panel2); border: 1px solid var(--line); overflow: hidden; }
.hbar-list__bar span { display: block; height: 100%; background: var(--dot-late); opacity: .75; }
.hbar-list.is-win .hbar-list__bar span { background: var(--brand-green); opacity: 1; }
.hbar-list__value { text-align: right; font-weight: 600; }
.results-table td, .results-table th { text-align: center; }
.results-table td:first-child, .results-table th:first-child { text-align: left; }
@media (max-width: 1024px) {
  .results-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .results-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .results-grid { grid-template-columns: minmax(0, 1fr); }
  .hbar-list li { grid-template-columns: minmax(0, 7rem) minmax(0, 1fr) 2rem; }
  .month-nav__label { min-width: 0; }
  .results-filter select { min-width: 0; width: 100%; }
}

/* ── Equipe: decisoes do gestor no topo (etapa 3) ────────────────────────── */
.team-decisions .section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.decision-list { list-style: none; margin: 8px 0 0; padding: 0; }
.decision-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.decision-row:first-child { border-top: 0; }
.decision-row__text { display: flex; flex-direction: column; gap: 2px; }
.decision-row__text span { font-size: var(--fs-sm); color: var(--brand-gray); }
.app-body details.team-filters { padding: 14px 22px; }
.team-filters summary { cursor: pointer; list-style: none; display: flex; gap: 10px; align-items: baseline; }
.team-filters summary::-webkit-details-marker { display: none; }
.team-filters[open] summary { margin-bottom: 10px; }
@media (max-width: 760px) {
  .decision-row { grid-template-columns: auto minmax(0, 1fr); }
  .decision-row > a { grid-column: 2; justify-self: start; }
}

/* ── Proteção dos dados (29/10/2026): marca d'água e aviso de cópia ───────── */
.marca-dagua {
  position: fixed;
  inset: -20vh -20vw;
  z-index: 9999;
  pointer-events: none;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 90px 140px;
  padding: 40px;
  transform: rotate(-24deg);
  opacity: 0.07;
  font-size: 15px;
  font-weight: 600;
  color: #1f2933;
  white-space: nowrap;
  user-select: none;
}
.marca-dagua-impressao { display: none; }
.aviso-copia {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  background: #1f2933;
  color: #fff;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 14px;
  max-width: 90vw;
}
@media print {
  .dados-protegidos .marca-dagua { opacity: 0.12; position: fixed; }
  .dados-protegidos .marca-dagua-impressao {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 11px;
    color: #52606d;
  }
}

/* ── Quadros do funil: Vendas | Licitações (30/10/2026) ───────────────────── */
.board-tabs { display: flex; gap: 6px; margin: 0 0 12px; border-bottom: 1px solid var(--border, #e4e7eb); }
.board-tabs__tab {
  padding: 8px 14px;
  border-radius: 8px 8px 0 0;
  color: var(--text-muted, #52606d);
  text-decoration: none;
  font-weight: 600;
  font-size: var(--fs-sm, 0.875rem);
}
.board-tabs__tab.is-active { color: var(--brand, #0b5d4b); border-bottom: 3px solid currentColor; }
.board-col__more {
  display: block;
  margin: 8px 4px 0;
  font-size: var(--fs-xs, 0.75rem);
  color: var(--text-muted, #52606d);
}

/* Rodapé discreto: titular e versão no ar (conformidade, 30/10/2026) */
.app-footer {
  margin-top: 32px; padding: 12px 0 4px; border-top: 1px solid var(--line);
  font-size: 11px; line-height: 1.5; color: var(--brand-gray); text-align: center;
}
@media print { .app-footer { display: block !important; } }
.login-shell { grid-template-rows: 1fr auto; }
.login-shell .app-footer { border-top: 0; margin-top: 0; }

/* Minha fila enxuta (31/10/2026) */
.today-kpi.is-done strong { color: var(--brand-green); }
.app-body .queue-row__object { margin: 2px 0 0 19px; font-size: var(--fs-xs); color: var(--brand-gray); }
.text-error { color: var(--error-text); }
@media (max-width: 760px) { .app-body .queue-row__object { margin-left: 0; } }

/* Tarefas enxuta (31/10/2026) */
.tasks-filter { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.tasks-filter__form { display: flex; flex-wrap: wrap; gap: 12px; }
.tasks-filter__form .sheet-form { min-width: 180px; }
.tasks-filter__summary { margin: 0; color: var(--brand-gray); font-size: var(--fs-sm); }
.tasks-reassign { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; margin-bottom: 12px; }
.tasks-reassign .sheet-form { min-width: 220px; }
.text-muted { color: var(--brand-gray); }

/* Roteiro enxuto (31/10/2026) */
.roteiro-pauta { padding-left: 1.25rem; line-height: 1.8; }
.roteiro-meta { margin: 10px 0 14px; }
.roteiro-mes__duo { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 8px; }
.roteiro-mes__duo p { margin: 4px 0; }


/* Painéis de gestão por perfil (02/11/2026) */
.painel-saude { margin: 0 0 14px; padding: 10px 14px; border-radius: var(--radius); background: var(--ok-bg); color: var(--ok-text); font-size: var(--fs-sm); }
.painel-saude.is-atencao { background: var(--warn-bg); color: var(--warn-text); }
.painel-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.painel-kpi { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--line-strong); border-radius: var(--radius); }
.painel-kpi.is-ok { border-top-color: var(--dot-ok); }
.painel-kpi.is-alerta { border-top-color: var(--dot-today); }
.painel-kpi.is-erro { border-top-color: var(--dot-late); }
.painel-kpi__rotulo { font-size: var(--fs-xs); font-weight: 500; color: var(--brand-gray); }
.painel-kpi__valor { font-size: var(--fs-xl); font-weight: 600; color: var(--brand-ink); line-height: 1.25; font-variant-numeric: tabular-nums; }
.painel-kpi__detalhe { font-size: var(--fs-xs); color: var(--brand-gray); }
.painel-kpi__link { margin-top: 6px; font-size: var(--fs-xs); }
.painel-decisoes { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.painel-decisoes li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.painel-decisoes li:first-child { border-top: 0; }
.painel-graficos { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin-bottom: 14px; }
.painel-graficos .card { margin: 0; }
.painel-barras { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 10px; }
.painel-barras li { display: grid; grid-template-columns: minmax(0, 10rem) minmax(0, 1fr) 2.5rem; gap: 10px; align-items: center; font-size: var(--fs-sm); }
.painel-barras__rotulo { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.painel-barras__trilho { height: 12px; background: var(--page); border-radius: 4px; overflow: hidden; }
.painel-barras__trilho span { display: block; height: 100%; min-width: 0; border-radius: 0 4px 4px 0; background: var(--brand-green); }
.painel-barras.is-critico .painel-barras__trilho span { background: var(--dot-late); }
.painel-barras__valor { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.painel-metas { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.painel-metas h3 { margin: 8px 0 10px; font-size: var(--fs-sm); }
.painel-meta { margin-bottom: 12px; }
.painel-meta__texto { display: flex; justify-content: space-between; gap: 8px; font-size: var(--fs-sm); margin-bottom: 4px; }
.painel-meta__trilho { position: relative; height: 12px; background: var(--page); border-radius: 4px; overflow: hidden; }
.painel-meta__real { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--brand-green); }
.painel-meta__ritmo { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--brand-ink); }
@media (max-width: 760px) { .painel-barras li { grid-template-columns: minmax(0, 7rem) minmax(0, 1fr) 2.25rem; } .painel-decisoes li { flex-direction: column; align-items: flex-start; } }

.worklist-table td.is-num, .worklist-table th.is-num, .desempenho-tabela td.is-num, .desempenho-tabela th.is-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.desempenho-tabela .is-abaixo { color: var(--warn-text); font-weight: 600; }
.desempenho-tabela .is-ok { color: var(--ok-text); font-weight: 600; }
.desempenho-tabela .is-vencida { color: var(--error-text); font-weight: 600; }
.desempenho-tabela small { color: var(--brand-gray); font-weight: 400; }

/* Distribuir Leads */
.distribuir-segmentos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.distribuir-segmentos a { padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); text-decoration: none; font-size: var(--fs-sm); }
.distribuir-segmentos a[aria-current] { border-color: var(--line-strong); font-weight: 600; box-shadow: inset 0 -2px 0 var(--line-strong); }
.distribuir-tabela input { width: 5rem; text-align: right; }
.distribuir-acoes { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 12px 0 6px; }
.distribuir-acoes label { display: grid; gap: 4px; font-size: var(--fs-sm); }
.distribuir-acoes input { width: 7rem; }

/* Cadastro de Metas */
.metas-mes { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.metas-mes h2 { margin: 0; }
.metas-copiar { margin-left: auto; }
.metas-tabela input { width: 6.5rem; text-align: right; }
.metas-tabela small { display: block; color: var(--brand-gray); }
.metas-tabela tfoot th, .metas-tabela tfoot td { border-top: 2px solid var(--line-strong); }
.metas-salvar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 14px; }

/* Visão do mês */
.visao-veredito { border-top: 4px solid var(--line-strong); }
.visao-veredito.is-ok { border-top-color: var(--dot-ok); }
.visao-veredito.is-erro { border-top-color: var(--dot-late); }
.visao-veredito h2 { margin: 0 0 2px; }
.visao-metas { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 14px; }
.visao-metas li { display: grid; gap: 4px; }
.visao-metas__topo { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: var(--fs-sm); }
.visao-metas .hbar-list__bar { display: block; }
.visao-metas small { font-size: var(--fs-sm); }

/* Fila e ficha das telas do Funil */
.fila-abas { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.fila-abas a { padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); text-decoration: none; font-size: var(--fs-sm); }
.fila-abas a[aria-current] { border-color: var(--line-strong); font-weight: 600; box-shadow: inset 0 -2px 0 var(--line-strong); }
.fila-pessoa { margin-bottom: 8px; }
.fila-pessoa label { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-sm); }
.ficha-card { display: grid; gap: 14px; }
.ficha-card > .nested-card { margin: 0; }
.ficha-navegar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ficha-topo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 340px); gap: 16px; align-items: start; }
.ficha-topo h2 { margin: 0; overflow-wrap: anywhere; }
.ficha-resumo { margin: 6px 0 0; font-size: var(--fs-sm); }
.ficha-passo { display: grid; gap: 2px; padding: 10px 14px; border: 1px solid var(--line); border-left: 4px solid var(--dot-today); border-radius: var(--radius); }
.ficha-passo.is-atrasado { border-left-color: var(--dot-late); }
.ficha-acoes h3 { margin-top: 0; }
.ficha-acoes .one-click-results { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.ficha-mensagem { white-space: pre-wrap; }
.ficha-mais { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; background: var(--panel); }
.ficha-mais > summary { cursor: pointer; font-weight: 600; }
.ficha-mais[open] > summary { margin-bottom: 12px; }
@media (max-width: 720px) { .ficha-topo { grid-template-columns: minmax(0, 1fr); } }
.ficha-rascunho { margin-bottom: 12px; }
.ficha-rascunho > summary { cursor: pointer; }
.fila-busca { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.fila-busca input[type=search] { min-width: 260px; }
.fila-paginas { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px; margin-top: 12px; }
.ficha-criterios { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.decisao-responsavel { max-width: 340px; margin-bottom: 10px; }

/* Usuários */
.usuarios-topo { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.usuarios-topo h2 { margin: 0; }
.saude-valor { font-size: var(--fs-md); }

/* Minha conta */
.detail-grid-3-senha { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.app-avatar { overflow: hidden; }
.app-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.foto-perfil { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.foto-perfil h2 { margin: 0 0 8px; }
.foto-perfil__imagem { width: 96px; height: 96px; font-size: 1.75rem; flex: none; }
.foto-perfil__acoes { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.foto-perfil__escolher { cursor: pointer; }
.foto-perfil__escolher input { position: absolute; width: 1px; height: 1px; opacity: 0; }

/* Ajuda */
.ajuda-intro { margin-bottom: 12px; }
.ajuda-topico { margin-bottom: 8px; }
.ajuda-lista { padding-left: 1.5rem; line-height: 1.8; }
.foto-perfil [hidden] { display: none; }
