/* PACS · Design system (v2.2)
   Ferramenta interna de operação: densidade confortável, hierarquia clara, poucas cores.
   A única peça "expressiva" é a mensagem de WhatsApp (balão), porque mensagens são o produto. */

:root {
  /* Cores — base */
  --c-ink: #16202e;          /* texto principal */
  --c-ink-2: #5b6576;        /* texto secundário (5,9:1 sobre branco) */
  --c-ink-3: #6b7484;        /* texto auxiliar (4,7:1) */
  --c-line: #e6e8ec;
  --c-line-2: #d5d9e0;
  --c-bg: #fbfbfc;
  --c-surface: #ffffff;
  --c-surface-2: #f6f7f9;
  --c-side: #f6f7f9;
  --c-hover: #eef0f3;
  --c-brand: #0f2340;        /* barra superior */
  /* Cores — ação */
  --c-accent: #0b6e70;       /* petróleo: ação principal (5,6:1) */
  --c-accent-hover: #085a5c;
  --c-accent-soft: #e4f2f2;
  --c-wa: #12804a;           /* WhatsApp, só em ações de envio (4,9:1) */
  --c-wa-hover: #0d6a3c;
  --c-bubble-out: #def3e6;
  --c-bubble-in: #ffffff;
  /* Cores — semânticas */
  --c-success: #17663e; --c-success-bg: #e6f4ec;
  --c-warning: #7a5000; --c-warning-bg: #fff3d6; --c-warning-line: #f0d48c;
  --c-danger: #b42318;  --c-danger-bg: #fdecea;  --c-danger-line: #f3b8b2;
  --c-info: #1d4a85;    --c-info-bg: #e8f0fb;
  /* Tipografia — escala 1,2 a partir de 15px */
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --fs-xs: 12px; --fs-sm: 13px; --fs-md: 14px; --fs-lg: 16px; --fs-xl: 20px; --fs-2xl: 24px;
  --lh: 1.5;
  /* Espaçamento — base 4 */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px;
  /* Raios e sombras: controles menores que painéis */
  --r-ctl: 6px; --r-panel: 8px; --r-pill: 999px;
  --shadow-1: none;
  --side-w: 232px;
  --shadow-2: 0 4px 16px rgba(15, 35, 64, .10);
  --focus: 0 0 0 3px rgba(11, 110, 112, .35);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--c-bg); color: var(--c-ink); font: var(--fs-md)/var(--lh) var(--font); font-variant-numeric: tabular-nums; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0; font-weight: 600; }
h1 { font-size: var(--fs-xl); letter-spacing: -.015em; }
h2 { font-size: var(--fs-lg); letter-spacing: -.01em; }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }
p { margin: 0 0 var(--s-3); }
a { color: var(--c-accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--c-accent-hover); }
small, .muted { color: var(--c-ink-2); font-size: var(--fs-sm); }
.faint { color: var(--c-ink-3); }
svg { width: 18px; height: 18px; flex: none; }
.nav svg { width: 17px; height: 17px; opacity: .85; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; margin: 0; }
:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: var(--s-4); top: -60px; background: #fff; color: var(--c-ink); padding: var(--s-2) var(--s-3); border-radius: var(--r-ctl); z-index: 20; }
.skip:focus { top: var(--s-2); }

/* ---------- Shell: barra lateral + área principal ---------- */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--c-side); border-right: 1px solid var(--c-line); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: var(--s-3); gap: var(--s-1); overflow-y: auto; }
.side-brand { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-2); color: var(--c-ink); text-decoration: none; font-weight: 700; letter-spacing: .01em; }
.mark { width: 24px; height: 24px; border-radius: 6px; background: var(--c-accent); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 800; }
.side-brand small { font-weight: 500; color: var(--c-ink-2); font-size: var(--fs-xs); }
.side-search { display: flex; align-items: center; gap: var(--s-2); width: 100%; min-height: 32px; padding: 0 var(--s-2); margin: var(--s-1) 0 var(--s-2); background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-ctl); color: var(--c-ink-2); font: 500 var(--fs-sm) var(--font); cursor: pointer; justify-content: flex-start; }
.side-search:hover { border-color: var(--c-line-2); color: var(--c-ink); background: var(--c-surface); }
.side-search svg { width: 15px; height: 15px; }
.side-search kbd { margin-left: auto; }
.side-group { font-size: var(--fs-xs); color: var(--c-ink-3); font-weight: 600; padding: var(--s-3) var(--s-2) var(--s-1); }
.side a.nav-item { display: flex; align-items: center; gap: var(--s-2); padding: 6px var(--s-2); border-radius: var(--r-ctl); color: var(--c-ink-2); text-decoration: none; font-weight: 500; font-size: var(--fs-sm); }
.side a.nav-item svg { width: 16px; height: 16px; color: var(--c-ink-3); }
.side a.nav-item:hover { background: var(--c-hover); color: var(--c-ink); }
.side a.nav-item[aria-current="page"] { background: var(--c-surface); color: var(--c-ink); box-shadow: inset 0 0 0 1px var(--c-line); }
.side a.nav-item[aria-current="page"] svg { color: var(--c-accent); }
.side .count { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--c-ink-2); background: var(--c-hover); border-radius: var(--r-pill); padding: 0 7px; line-height: 18px; }
.side .count.hot { background: var(--c-accent); color: #fff; }
.side-foot { margin-top: auto; border-top: 1px solid var(--c-line); padding-top: var(--s-3); display: flex; flex-direction: column; gap: var(--s-1); }
.side-user { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-1) var(--s-2); font-size: var(--fs-sm); }
.side-user .avatar { width: 26px; height: 26px; font-size: 11px; }
.side-user b { font-weight: 600; display: block; line-height: 1.2; }
.side-user span { color: var(--c-ink-2); font-size: var(--fs-xs); }
.status-line { display: flex; align-items: center; gap: 6px; padding: 2px var(--s-2); font-size: var(--fs-xs); color: var(--c-ink-2); }
.status-line i { width: 7px; height: 7px; border-radius: 50%; background: var(--c-ink-3); display: inline-block; }
.status-line i.on { background: var(--c-wa); }
kbd { font: 600 11px/1 var(--font); color: var(--c-ink-2); background: var(--c-surface); border: 1px solid var(--c-line-2); border-bottom-width: 2px; border-radius: 4px; padding: 2px 5px; min-width: 18px; text-align: center; display: inline-block; }
.mobile-bar { display: none; }

/* ---------- Área principal e barra de ferramentas ---------- */
.main { min-width: 0; }
.toolbar { position: sticky; top: 0; z-index: 5; background: rgba(251, 251, 252, .92); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--c-line); }
.toolbar-in { max-width: 1240px; margin: 0 auto; padding: 0 var(--s-8); min-height: 56px; display: flex; align-items: center; gap: var(--s-3); }
.toolbar .crumbs { display: flex; align-items: center; gap: var(--s-2); min-width: 0; font-size: var(--fs-sm); color: var(--c-ink-2); }
.toolbar .crumbs a { color: var(--c-ink-2); text-decoration: none; }
.toolbar .crumbs a:hover { color: var(--c-ink); }
.toolbar .crumbs .sep { color: var(--c-line-2); }
.toolbar .crumbs b { color: var(--c-ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toolbar .tools { margin-left: auto; display: flex; align-items: center; gap: var(--s-2); }
.tool-sep { width: 1px; height: 20px; background: var(--c-line); margin: 0 var(--s-1); }
.icon-btn { width: 32px; min-height: 32px; padding: 0; justify-content: center; }
.icon-btn svg { width: 16px; height: 16px; }
[data-tip] { position: relative; }
[data-tip]:hover::after, [data-tip]:focus-visible::after { content: attr(data-tip); position: absolute; top: calc(100% + 6px); right: 0; background: var(--c-ink); color: #fff; font: 500 11.5px/1.3 var(--font); padding: 5px 8px; border-radius: 5px; white-space: nowrap; z-index: 30; pointer-events: none; }
main { max-width: 1240px; margin: 0 auto; padding: var(--s-6) var(--s-8) var(--s-10); }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-5); }
.page-head p { margin: var(--s-1) 0 0; color: var(--c-ink-2); max-width: 72ch; font-size: var(--fs-sm); }
.crumb { display: none; }
.layout-2 { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s-5); align-items: start; }
.stack > * + * { margin-top: var(--s-4); }
.row { display: flex; gap: var(--s-3); flex-wrap: wrap; }
.row > .field { flex: 1 1 160px; }
.between { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); flex-wrap: wrap; }

/* ---------- Filtros e busca ---------- */
.filters { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; margin-bottom: var(--s-3); }
.seg { display: inline-flex; background: var(--c-surface-2); border: 1px solid var(--c-line); border-radius: var(--r-ctl); padding: 2px; gap: 2px; flex-wrap: wrap; }
.seg a { padding: 4px 10px; border-radius: 4px; font-size: var(--fs-sm); font-weight: 500; color: var(--c-ink-2); text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.seg a:hover { color: var(--c-ink); }
.seg a[aria-current="true"] { background: var(--c-surface); color: var(--c-ink); box-shadow: 0 0 0 1px var(--c-line); }
.seg a span { font-size: 11px; color: var(--c-ink-3); }
.search { position: relative; flex: 0 1 280px; margin-left: auto; }
.search svg { position: absolute; left: 10px; top: 50%; width: 15px; height: 15px; margin-top: -7.5px; color: var(--c-ink-3); pointer-events: none; }
.search input { padding-left: 32px; min-height: 34px; font-size: var(--fs-sm); }

/* ---------- Paleta de comandos e atalhos ---------- */
dialog.cmdk { border: 1px solid var(--c-line); border-radius: 12px; padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: 0 24px 64px rgba(16, 24, 40, .22); margin-top: 12vh; color: var(--c-ink); }
dialog.cmdk::backdrop { background: rgba(16, 24, 40, .32); }
.cmdk-in { display: flex; align-items: center; gap: var(--s-2); padding: 0 var(--s-4); border-bottom: 1px solid var(--c-line); }
.cmdk-in svg { color: var(--c-ink-3); }
.cmdk-in input { border: 0; box-shadow: none; min-height: 52px; font-size: var(--fs-lg); padding: 0; }
.cmdk-in input:focus { box-shadow: none; }
.cmdk ul { list-style: none; margin: 0; padding: var(--s-2); max-height: 52vh; overflow-y: auto; }
.cmdk li.grp { font-size: var(--fs-xs); color: var(--c-ink-3); font-weight: 600; padding: var(--s-2) var(--s-2) var(--s-1); }
.cmdk li a { display: flex; align-items: center; gap: var(--s-3); padding: 8px var(--s-2); border-radius: var(--r-ctl); color: var(--c-ink); text-decoration: none; font-size: var(--fs-md); }
.cmdk li a svg { width: 16px; height: 16px; color: var(--c-ink-3); }
.cmdk li a .avatar { width: 22px; height: 22px; font-size: 10px; }
.cmdk li a kbd { margin-left: auto; }
.cmdk li a small { margin-left: auto; color: var(--c-ink-3); }
.cmdk li a[aria-selected="true"], .cmdk li a:hover { background: var(--c-hover); }
.cmdk li[hidden] { display: none; }
.cmdk-foot { display: flex; gap: var(--s-4); padding: var(--s-2) var(--s-4); border-top: 1px solid var(--c-line); font-size: var(--fs-xs); color: var(--c-ink-2); background: var(--c-surface-2); border-radius: 0 0 12px 12px; }
.keys { display: grid; grid-template-columns: 1fr auto; gap: var(--s-2) var(--s-6); padding: var(--s-5); font-size: var(--fs-sm); margin: 0; }
.keys dt { color: var(--c-ink); }
.keys dd { margin: 0; text-align: right; }

/* ---------- Painel (card) ---------- */
.panel { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-panel); box-shadow: var(--shadow-1); }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--c-line); flex-wrap: wrap; min-height: 52px; }
.panel-h h2, .panel-h h3 { font-size: var(--fs-md); font-weight: 600; }
.panel-h p { margin: 2px 0 0; font-size: var(--fs-sm); color: var(--c-ink-2); }
.panel-b { padding: var(--s-4); }
.panel-b + .panel-b { border-top: 1px solid var(--c-line); }
.panel.tone-warn { border-color: var(--c-warning-line); }
.panel.tone-warn .panel-h { background: var(--c-warning-bg); border-radius: var(--r-panel) var(--r-panel) 0 0; }

/* ---------- Botões ---------- */
.btn, button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 0 var(--s-3); border-radius: var(--r-ctl); border: 1px solid transparent; font: 600 var(--fs-sm)/1 var(--font); cursor: pointer; text-decoration: none; white-space: nowrap; transition: background-color .12s, border-color .12s, color .12s; }
.btn-primary, button.btn-primary { background: var(--c-accent); color: #fff; }
.btn-primary:hover { background: var(--c-accent-hover); color: #fff; }
.btn-secondary, button.btn-secondary { background: var(--c-surface); color: var(--c-ink); border-color: var(--c-line-2); }
.btn-secondary:hover { background: var(--c-surface-2); border-color: var(--c-ink-3); color: var(--c-ink); }
.btn-ghost, button.btn-ghost { background: transparent; color: var(--c-ink-2); }
.btn-ghost:hover { background: #e9edf2; color: var(--c-ink); }
.btn-danger, button.btn-danger { background: var(--c-surface); color: var(--c-danger); border-color: var(--c-danger-line); }
.btn-danger:hover { background: var(--c-danger-bg); }
.btn-wa, button.btn-wa { background: var(--c-wa); color: #fff; }
.btn-wa:hover { background: var(--c-wa-hover); color: #fff; }
.btn-sm, button.btn-sm { min-height: 28px; padding: 0 10px; font-size: var(--fs-xs); }
.btn kbd { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.35); color: inherit; padding: 1px 4px; }
.btn-secondary kbd, .btn-ghost kbd { background: var(--c-surface-2); border-color: var(--c-line-2); }
.btn[disabled], button[disabled], button[aria-busy="true"] { opacity: .6; cursor: progress; }
.btn:focus-visible, button:focus-visible { outline: none; box-shadow: var(--focus); }
.btn svg, button svg { width: 16px; height: 16px; flex: none; }
.actions { display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center; }
form.inline { display: inline-flex; margin: 0; }

/* ---------- Formulários ---------- */
.field { display: block; margin-bottom: var(--s-3); }
.field > span { display: block; font-size: var(--fs-sm); font-weight: 600; margin-bottom: var(--s-1); color: var(--c-ink); }
.field > em { display: block; font-style: normal; font-size: var(--fs-xs); color: var(--c-ink-2); margin-top: var(--s-1); }
input[type=text], input[type=email], input[type=url], input[type=number], input[type=date], input[type=datetime-local], input[type=password], input:not([type]), select, textarea {
  width: 100%; min-height: 36px; padding: 7px 10px; border: 1px solid var(--c-line-2); border-radius: var(--r-ctl); background: #fff; color: var(--c-ink); font: var(--fs-md)/1.4 var(--font);
}
textarea { min-height: 96px; resize: vertical; line-height: var(--lh); }
input:hover, select:hover, textarea:hover { border-color: var(--c-ink-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--c-accent); box-shadow: var(--focus); }
input[type=file] { font: var(--fs-sm) var(--font); max-width: 100%; }
.check { display: flex; gap: var(--s-2); align-items: flex-start; font-size: var(--fs-sm); margin: var(--s-2) 0 var(--s-3); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--c-accent); flex: none; }
.form-foot { display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; margin-top: var(--s-2); }
.req { color: var(--c-danger); }
details.more > summary { cursor: pointer; color: var(--c-accent); font-weight: 600; font-size: var(--fs-sm); list-style: none; padding: var(--s-1) 0; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "+ "; }
details.more[open] > summary::before { content: "− "; }
details.more[open] > summary { margin-bottom: var(--s-3); }

/* ---------- Avisos ---------- */
.alert { display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-3) var(--s-4); border-radius: var(--r-ctl); border: 1px solid; font-size: var(--fs-sm); margin-bottom: var(--s-4); }
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.alert p { margin: 0; }
.alert .close { margin-left: auto; background: none; border: 0; min-height: auto; padding: 0 var(--s-1); color: inherit; font-size: 18px; line-height: 1; }
.alert-success { background: var(--c-success-bg); border-color: #b7dcc6; color: var(--c-success); }
.alert-warning { background: var(--c-warning-bg); border-color: var(--c-warning-line); color: var(--c-warning); }
.alert-danger { background: var(--c-danger-bg); border-color: var(--c-danger-line); color: var(--c-danger); }
.alert-info { background: var(--c-info-bg); border-color: #c3d5ee; color: var(--c-info); }

/* ---------- Etiquetas ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 600; line-height: 1.5; background: #eaeef3; color: var(--c-ink-2); white-space: nowrap; }
.badge-accent { background: var(--c-accent-soft); color: var(--c-accent-hover); }
.badge-success { background: var(--c-success-bg); color: var(--c-success); }
.badge-warning { background: var(--c-warning-bg); color: var(--c-warning); }
.badge-danger { background: var(--c-danger-bg); color: var(--c-danger); }
.badge-info { background: var(--c-info-bg); color: var(--c-info); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--c-danger); }

/* ---------- Tabelas ---------- */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: var(--fs-sm); }
th { text-align: left; font-weight: 500; font-size: var(--fs-xs); color: var(--c-ink-2); padding: 8px var(--s-4); border-bottom: 1px solid var(--c-line); white-space: nowrap; background: var(--c-surface-2); }
td { padding: 10px var(--s-4); border-bottom: 1px solid var(--c-line); vertical-align: middle; }
tr.clickable { cursor: pointer; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafbfc; }
td.num, th.num { text-align: right; }
.cell-title { font-weight: 600; color: var(--c-ink); }
.cell-sub { display: block; color: var(--c-ink-2); font-size: var(--fs-xs); margin-top: 2px; }
.person { display: flex; align-items: center; gap: var(--s-3); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: #dbe5f1; color: #23406b; display: inline-grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.avatar.lg { width: 44px; height: 44px; font-size: 16px; }

/* ---------- Abas ---------- */
.tabs { display: flex; gap: var(--s-1); border-bottom: 1px solid var(--c-line); margin: var(--s-5) 0 var(--s-5); overflow-x: auto; scrollbar-width: thin; }
.tabs a { padding: 10px var(--s-3); text-decoration: none; color: var(--c-ink-2); font-weight: 600; font-size: var(--fs-sm); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: var(--s-2); align-items: center; }
.tabs a:hover { color: var(--c-ink); }
.tabs a[aria-current="page"] { color: var(--c-accent-hover); border-bottom-color: var(--c-accent); }
.tabs .badge { font-size: 11px; padding: 0 6px; }

/* ---------- Resumo (contadores) ---------- */
.summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: var(--s-5); background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-panel); overflow: hidden; }
.summary a { display: flex; flex-direction: column; gap: 2px; padding: var(--s-3) var(--s-4); text-decoration: none; color: var(--c-ink); border-left: 1px solid var(--c-line); }
.summary a:first-child { border-left: 0; }
.summary a:hover { background: var(--c-surface-2); }
.summary b { font-size: var(--fs-xl); font-weight: 600; }
.summary span { font-size: var(--fs-sm); color: var(--c-ink-2); line-height: 1.3; }
.summary a.alarm b { color: var(--c-danger); }

/* ---------- Jornada (etapas em sequência) ---------- */
.journey { display: flex; list-style: none; margin: var(--s-4) 0 0; padding: 0; gap: 0; counter-reset: step; }
.journey li { flex: 1; position: relative; padding-top: 22px; font-size: var(--fs-xs); color: var(--c-ink-3); text-align: center; }
.journey li::before { content: ""; position: absolute; top: 6px; left: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: #fff; border: 2px solid var(--c-line-2); z-index: 1; }
.journey li::after { content: ""; position: absolute; top: 11px; left: -50%; width: 100%; height: 2px; background: var(--c-line-2); }
.journey li:first-child::after { display: none; }
.journey li.done { color: var(--c-ink-2); }
.journey li.done::before { background: var(--c-accent); border-color: var(--c-accent); }
.journey li.done::after, .journey li.current::after { background: var(--c-accent); }
.journey li.current { color: var(--c-ink); font-weight: 700; }
.journey li.current::before { border-color: var(--c-accent); box-shadow: 0 0 0 4px var(--c-accent-soft); }

/* ---------- Cabeçalho do mentorado ---------- */
.profile { display: flex; gap: var(--s-4); align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.profile-id { display: flex; gap: var(--s-4); align-items: flex-start; min-width: 0; }
.profile-id h1 { font-size: var(--fs-2xl); }
.profile-id p { margin: var(--s-1) 0 var(--s-2); color: var(--c-ink-2); }
.meta { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); font-size: var(--fs-sm); color: var(--c-ink-2); }
.meta > span { display: inline-flex; gap: 6px; align-items: center; }
.meta svg { width: 15px; height: 15px; }

/* ---------- Fila: itens e balões de mensagem ---------- */
.queue-item { padding: var(--s-4); border-top: 1px solid var(--c-line); }
.queue-item:first-child { border-top: 0; }
.queue-head { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; margin-bottom: var(--s-3); }
.queue-head .who { font-weight: 600; }
.queue-head .when { margin-left: auto; font-size: var(--fs-xs); color: var(--c-ink-2); }
.bubble { position: relative; max-width: 640px; background: var(--c-bubble-out); border-radius: 12px 12px 4px 12px; padding: var(--s-3) var(--s-4); font-size: var(--fs-md); line-height: 1.55; border: 1px solid #c8e8d3; }
.bubble.in { background: var(--c-bubble-in); border-color: var(--c-line); border-radius: 12px 12px 12px 4px; }
.bubble textarea { background: transparent; border: 0; padding: 0; min-height: 120px; box-shadow: none; font-size: var(--fs-md); }
.bubble textarea:focus { box-shadow: none; }
.bubble:focus-within { box-shadow: var(--focus); }
.bubble-meta { font-size: var(--fs-xs); color: var(--c-ink-2); margin-top: var(--s-1); display: flex; gap: var(--s-3); }
.thread { display: flex; flex-direction: column; gap: var(--s-3); }
.thread .msg { display: flex; flex-direction: column; }
.thread .msg.out { align-items: flex-end; }
.thread .msg.out .bubble-meta { justify-content: flex-end; }
.counter { font-size: var(--fs-xs); color: var(--c-ink-3); }

/* ---------- Listas, vazios, linha do tempo ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: var(--s-3) 0; border-top: 1px solid var(--c-line); display: flex; gap: var(--s-3); align-items: flex-start; }
.list > li:first-child { border-top: 0; padding-top: 0; }
.list .grow { flex: 1; min-width: 0; }
.empty { text-align: center; padding: var(--s-8) var(--s-4); color: var(--c-ink-2); }
.empty svg { width: 28px; height: 28px; color: var(--c-ink-3); margin-bottom: var(--s-2); }
.empty strong { display: block; color: var(--c-ink); margin-bottom: var(--s-1); }
.empty p { margin: 0 auto; max-width: 46ch; font-size: var(--fs-sm); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: var(--s-2) var(--s-4); font-size: var(--fs-sm); margin: 0; }
.kv dt { color: var(--c-ink-2); }
.kv dd { margin: 0; font-weight: 500; }
.log { font-size: var(--fs-xs); color: var(--c-ink-2); }
.log li { padding: 6px 0; border-top: 1px solid var(--c-line); }
.code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; background: var(--c-surface-2); border: 1px solid var(--c-line); border-radius: var(--r-ctl); padding: var(--s-3); max-height: 260px; overflow: auto; }

/* ---------- Telas de acesso ---------- */
.auth { max-width: 440px; margin: 6vh auto 0; }
.auth .panel-b { padding: var(--s-6); }
.auth h1 { font-size: var(--fs-xl); margin-bottom: var(--s-2); }

/* ---------- Responsividade ---------- */
@media (max-width: 1080px) {
  .layout-2 { grid-template-columns: 1fr; }
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  main { padding: var(--s-4) var(--s-4) var(--s-8); }
  .toolbar-in { padding: 0 var(--s-4); }
  .toolbar .tools .hide-sm { display: none; }
  .summary a { border-left: 0; border-top: 1px solid var(--c-line); }
  .summary a:nth-child(-n+2) { border-top: 0; }
  .summary a:nth-child(2n) { border-left: 1px solid var(--c-line); }
  .search { flex-basis: 100%; margin-left: 0; }
  h1, .profile-id h1 { font-size: var(--fs-xl); }
  .panel-h, .panel-b, .queue-item { padding-left: var(--s-4); padding-right: var(--s-4); }
  .summary b { font-size: var(--fs-lg); }
  .journey li span { display: none; }
  .journey li.current span { display: block; position: absolute; left: 50%; transform: translateX(-50%); white-space: nowrap; }
  /* Tabelas de dados viram blocos empilhados no celular */
  table.stack-mobile thead { display: none; }
  table.stack-mobile, table.stack-mobile tbody, table.stack-mobile tr, table.stack-mobile td { display: block; width: 100%; }
  table.stack-mobile tr { border-bottom: 1px solid var(--c-line); padding: var(--s-2) 0; }
  table.stack-mobile td { border: 0; padding: var(--s-1) 0; }
  table.stack-mobile td[data-label]::before { content: attr(data-label) ": "; color: var(--c-ink-2); font-size: var(--fs-xs); }
  .btn, button { min-height: 44px; }
  .btn-sm, button.btn-sm { min-height: 38px; }
  .queue-head .when { margin-left: 0; width: 100%; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 272px; z-index: 40; transform: translateX(-100%); transition: transform .18s ease; box-shadow: none; }
  .app.menu-open .side { transform: none; box-shadow: 0 0 0 100vmax rgba(16, 24, 40, .32); }
  .mobile-bar { display: flex; align-items: center; gap: var(--s-2); padding: 0 var(--s-3); min-height: 52px; background: var(--c-surface); border-bottom: 1px solid var(--c-line); position: sticky; top: 0; z-index: 6; }
  .mobile-bar .side-brand { padding: 0; }
  .mobile-bar .right { margin-left: auto; display: flex; gap: var(--s-1); }
  .toolbar { top: 52px; }
  .no-js .side { position: static; transform: none; width: auto; height: auto; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print { .side, .toolbar, .mobile-bar, .tabs, form, .actions { display: none !important; } .app { display: block; } body { background: #fff; } .panel { box-shadow: none; } }

/* ---------- Ajustes de componentes ---------- */
.nowrap { white-space: nowrap; }
.status-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.status-form input { grid-column: 1 / -1; min-height: 36px; font-size: var(--fs-sm); }
.status-form select { min-height: 36px; font-size: var(--fs-sm); }
.journey-cap { display: none; }
.list > li { flex-wrap: wrap; }
.list > li .grow { flex: 1 1 220px; }
@media (max-width: 760px) {
  .journey li span, .journey li.current span { display: none; }
  .journey-cap { display: block; margin: var(--s-2) 0 0; font-size: var(--fs-sm); color: var(--c-ink-2); text-align: center; }
  .list > li > .btn { margin-left: auto; }
}

/* ---------- Utilitários (no lugar de estilos inline, por causa do CSP) ---------- */
.mt-1 { margin-top: var(--s-1); } .mt-2 { margin-top: var(--s-2); } .mt-3 { margin-top: var(--s-3); }
.narrow { max-width: 760px; }
.w-status { width: 280px; }
textarea.h-xs { min-height: 64px; } textarea.h-sm { min-height: 90px; } textarea.h-md { min-height: 120px; }
textarea.h-lg { min-height: 200px; } textarea.h-xl { min-height: 220px; }
.bubble textarea.h-xl { min-height: 220px; }
.cmdk-in input:focus-visible { outline: none; }

/* ---------- Refinamentos de alinhamento e leitura ---------- */
a.cell-title, .toolbar .crumbs a, .queue-head .who a, .list a:not(.btn) { text-decoration: none; }
a.cell-title:hover, .queue-head .who a:hover, .list a:not(.btn):hover { text-decoration: underline; }
td.nowrap, td[data-label="Plano"], td[data-label="Ações"], td[data-label="Última resposta"], td[data-label="Próximo follow-up"] { white-space: nowrap; }
.side .side-keys { justify-content: flex-start; padding: 6px var(--s-2); color: var(--c-ink-2); font-weight: 500; font-size: var(--fs-sm); min-height: 0; }
.side .side-keys svg { width: 16px; height: 16px; color: var(--c-ink-3); }
.side .side-keys kbd { margin-left: auto; }
@media (hover: none) {
  .side-search kbd, .side .side-keys, .toolbar kbd, .btn kbd { display: none; }
}

/* Fundo contínuo da barra lateral em páginas longas */
@media (min-width: 901px) {
  .app { background: linear-gradient(to right, var(--c-side) calc(var(--side-w) - 1px), var(--c-line) calc(var(--side-w) - 1px) var(--side-w), var(--c-bg) var(--side-w)); }
}
/* Tabelas empilhadas no celular mantêm o recuo do painel */
@media (max-width: 760px) {
  .panel table.stack-mobile tr { padding: var(--s-2) var(--s-4); }
}
/* Mensagem editada e não salva: destaca "Salvar" e bloqueia o envio do texto antigo */
.queue-item .save-row { display: none; }
.queue-item.dirty .save-row { display: flex; align-items: center; gap: var(--s-3); }
.queue-item.dirty .save-row button { background: var(--c-accent); color: #fff; border-color: transparent; }
.queue-item.dirty .send-row { opacity: .45; pointer-events: none; }
.queue-item .save-hint { font-size: var(--fs-xs); color: var(--c-warning); }

/* ---------- Senha e login ---------- */
.pw { position: relative; display: block; }
.pw input { padding-right: 84px; }
.pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); min-height: 28px; padding: 0 10px; background: transparent; border: 0; color: var(--c-accent); font: 600 var(--fs-xs) var(--font); border-radius: 4px; }
.pw-toggle:hover { background: var(--c-accent-soft); }
.pw-toggle[aria-pressed="true"] { color: var(--c-ink-2); }
.pw-count, .login-preview { display: block; font-size: var(--fs-xs); color: var(--c-ink-2); margin-top: var(--s-1); }
.pw-count.ok { color: var(--c-success); }
.login-preview { color: var(--c-accent-hover); font-weight: 600; }
.login-preview.bad { color: var(--c-danger); }
.auth-switch { margin: var(--s-4) 0 0; padding-top: var(--s-4); border-top: 1px solid var(--c-line); font-size: var(--fs-sm); color: var(--c-ink-2); text-align: center; }
.form-foot .btn-primary { min-width: 140px; }
.auth .form-foot .btn { width: 100%; }
.auth-switch p { margin: 0 0 var(--s-2); }
.auth-switch .btn { width: 100%; }

/* Editar/excluir ação do plano */
details.row-edit { margin-top: var(--s-2); }
details.row-edit > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 600; color: var(--c-ink-2); padding: 2px 0; }
details.row-edit > summary::-webkit-details-marker { display: none; }
details.row-edit > summary svg { width: 14px; height: 14px; }
details.row-edit > summary:hover { color: var(--c-accent); }
details.row-edit[open] { background: var(--c-surface-2); border: 1px solid var(--c-line); border-radius: var(--r-ctl); padding: var(--s-3); }
details.row-edit[open] > summary { margin-bottom: var(--s-2); color: var(--c-ink); }
details.row-edit form.inline { margin-top: var(--s-2); }
.plan-table td { vertical-align: top; }
details.row-edit[open] .row > .field { flex-basis: 120px; }

/* v2.3 · Planilha de alunos */
.steps { margin: 0 0 var(--s-4); padding-left: 1.25em; font-size: var(--fs-sm); color: var(--c-ink-2); }
.steps li { margin: var(--s-1) 0; }
.steps b { color: var(--c-ink); font-weight: 600; }
.bullets { margin: var(--s-1) 0 0; padding-left: 1.1em; font-size: var(--fs-sm); }
.bullets li { margin: var(--s-1) 0; }
.changes { list-style: none; margin: var(--s-1) 0 0; padding: 0; font-size: var(--fs-xs); color: var(--c-ink-2); }
.changes li { margin: 2px 0; overflow-wrap: anywhere; }
.changes b { color: var(--c-ink); font-weight: 600; }
.changes s { color: var(--c-ink-3); }
.kpis { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-bottom: var(--s-4); }
.kpi { flex: 1 1 120px; border: 1px solid var(--c-line); border-radius: var(--r-ctl); padding: var(--s-3) var(--s-4); background: var(--c-surface-2); }
.kpi b { display: block; font-size: var(--fs-xl); line-height: 1.1; color: var(--c-ink); }
.kpi span { font-size: var(--fs-sm); color: var(--c-ink-2); }
th.w-check { width: 84px; }
.kv dd.pre { white-space: pre-line; overflow-wrap: anywhere; }

/* v2.4 · Configurações, modelos em grupos (drill-down), marcos da jornada */
.tabs a svg { width: 15px; height: 15px; margin-right: 6px; vertical-align: -2px; }
.acc-group { display: flex; flex-direction: column; gap: var(--s-3); }
.acc { border: 1px solid var(--c-line); border-radius: var(--r-panel); background: var(--c-surface); }
.acc > summary { list-style: none; cursor: pointer; padding: var(--s-3) var(--s-4); font-weight: 600; display: flex; align-items: center; gap: var(--s-2); }
.acc > summary::-webkit-details-marker, .acc-item > summary::-webkit-details-marker { display: none; }
.acc > summary::before, .acc-item > summary::before { content: ''; width: 7px; height: 7px; border-right: 2px solid var(--c-ink-3); border-bottom: 2px solid var(--c-ink-3); transform: rotate(-45deg); transition: transform .15s; flex: none; margin-right: 4px; }
.acc[open] > summary::before, .acc-item[open] > summary::before { transform: rotate(45deg); }
.acc > summary .count, .acc-item .count { margin-left: auto; font-size: var(--fs-xs); color: var(--c-ink-2); background: var(--c-surface-2); border: 1px solid var(--c-line); border-radius: var(--r-pill); padding: 0 8px; font-weight: 500; }
.acc[open] > summary { border-bottom: 1px solid var(--c-line); }
.acc-list { padding: var(--s-2) var(--s-3) var(--s-3); }
.acc-list.flat { padding: 0; }
.acc-item { border-bottom: 1px solid var(--c-line); }
.acc-item:last-child { border-bottom: 0; }
.acc-item > summary { list-style: none; cursor: pointer; padding: var(--s-3) var(--s-2); display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; font-size: var(--fs-sm); font-weight: 500; }
.acc-item > summary:hover, .acc > summary:hover { color: var(--c-accent); }
.acc-item > summary svg { width: 15px; height: 15px; }
.acc-new > summary { color: var(--c-accent); }
.acc-body { padding: 0 var(--s-2) var(--s-4) calc(var(--s-2) + 15px); }
.acc-body .pre, p.pre { white-space: pre-line; }
.ml-auto { margin-left: auto; }
.mb-3 { margin-bottom: var(--s-3); }
.ms-row { display: flex; gap: var(--s-3); align-items: center; padding: var(--s-2) 0; border-top: 1px solid var(--c-line); flex-wrap: wrap; }
.ms-row:first-of-type { border-top: 0; }
.ms-row .ms-label { flex: 0 0 170px; font-weight: 500; font-size: var(--fs-sm); }
.ms-row .field { margin: 0; }
.ms-row .field select { min-width: 130px; }
.ms-row .field.grow { flex: 1 1 200px; }
.ms-list > li { align-items: center; }
.ms-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--c-line-2); flex: none; }
.ms-feito { background: var(--c-success); border-color: var(--c-success); }
.ms-agendado { border-color: var(--c-accent); }
.ms-pendente { border-color: var(--c-warning); }
@media (max-width: 760px) { .ms-row .ms-label { flex-basis: 100%; } }
.acc-item > summary { display: block; position: relative; padding-left: 26px; line-height: 1.6; }
.acc-item > summary::before { position: absolute; left: 8px; top: calc(var(--s-3) + .55em); }
.acc-item > summary svg { vertical-align: -3px; margin-right: 4px; }
.acc-item .ml-auto { float: right; }
.ms-list > li { flex-wrap: nowrap; }
.ms-list > li .grow { flex: 1 1 auto; min-width: 0; }

/* ==================================================================== Plataforma · CRM (v0.1)
   Acréscimos ao design system do PACS. Mesmos tokens; nada acima foi alterado. */
main.wide { max-width: none; padding-left: var(--s-6); padding-right: var(--s-6); }
main.solo { max-width: 1240px; }
.linklike { width: 100%; background: none; border: 0; justify-content: flex-start; color: var(--c-ink-2); font-weight: 500; padding: 6px var(--s-2); min-height: auto; }
.linklike:hover { background: var(--c-hover); color: var(--c-ink); }
.side form { margin: 0; }
.btn-lg { min-height: 44px; font-size: var(--fs-md); width: 100%; }
.auth-card { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-panel); padding: var(--s-6); }
.auth-card .side-brand { padding: 0 0 var(--s-4); }
.auth-card p.muted { margin-bottom: var(--s-4); }
details.reserva { margin-top: var(--s-5); padding-top: var(--s-4); border-top: 1px solid var(--c-line); }
details.reserva > summary { cursor: pointer; font-size: var(--fs-sm); color: var(--c-ink-2); margin-bottom: var(--s-3); }
.form-sec { font-size: var(--fs-sm); color: var(--c-ink-2); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin: var(--s-2) 0 var(--s-3); }
fieldset { border: 1px solid var(--c-line); border-radius: var(--r-ctl); padding: var(--s-3) var(--s-4) 0; margin: 0 0 var(--s-3); }
legend { font-size: var(--fs-sm); font-weight: 600; padding: 0 var(--s-1); }
fieldset.prox { background: var(--c-surface-2); }
.row.acc { align-items: center; }
.row.acc .check { flex: 1; margin: var(--s-1) 0; }
.row.acc select { width: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th { text-align: left; font-weight: 600; color: var(--c-ink-2); padding: var(--s-2); border-bottom: 1px solid var(--c-line); }
.table td { padding: var(--s-2); border-bottom: 1px solid var(--c-line); vertical-align: top; }
.who { display: flex; align-items: center; gap: var(--s-2); margin-bottom: var(--s-3); }
.list .meta { gap: var(--s-2); align-items: center; margin-bottom: var(--s-1); }
.list p.resumo { font-weight: 600; margin: var(--s-1) 0; }
.list pre { color: var(--c-ink); font-size: var(--fs-sm); }
.list details summary { cursor: pointer; font-size: var(--fs-sm); color: var(--c-ink); }
.caminho { margin: 0; padding-left: var(--s-5); font-size: var(--fs-sm); }
.caminho li { margin-bottom: var(--s-2); }
.caminho small { display: block; color: var(--c-ink-2); }

/* Quadro (kanban) */
.board { display: flex; gap: var(--s-3); overflow-x: auto; padding-bottom: var(--s-4); align-items: flex-start; min-height: 60vh; }
.col { flex: 0 0 272px; background: var(--c-surface-2); border: 1px solid var(--c-line); border-radius: var(--r-panel); display: flex; flex-direction: column; max-height: calc(100vh - 190px); }
.col > header { padding: var(--s-3); border-bottom: 1px solid var(--c-line); position: sticky; top: 0; }
.col > header h2 { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; color: var(--c-ink); }
.col > header span { font-size: var(--fs-xs); color: var(--c-ink-2); }
.col-ganho > header { box-shadow: inset 0 3px 0 var(--c-success); }
.col-perdido > header { box-shadow: inset 0 3px 0 var(--c-danger); }
.col-adiado > header { box-shadow: inset 0 3px 0 #c98a00; }
.col ul { list-style: none; margin: 0; padding: var(--s-2); display: flex; flex-direction: column; gap: var(--s-2); overflow-y: auto; min-height: 60px; }
.col.over { outline: 2px dashed var(--c-accent); outline-offset: -2px; }
.col-vazia { font-size: var(--fs-xs); color: var(--c-ink-3); text-align: center; padding: var(--s-4) 0; }
.card { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-ctl); }
.card[draggable=true] { cursor: grab; }
.card.dragging { opacity: .5; }
.card a { display: flex; flex-direction: column; gap: 4px; padding: var(--s-2) var(--s-3); color: var(--c-ink); text-decoration: none; }
.card a:hover { background: var(--c-hover); }
.card-top { display: flex; gap: var(--s-2); align-items: flex-start; justify-content: space-between; }
.card-top b { font-size: var(--fs-sm); font-weight: 600; line-height: 1.35; }
.card-sub { font-size: var(--fs-xs); color: var(--c-ink-2); }
.card-foot { display: flex; justify-content: space-between; align-items: center; font-size: var(--fs-xs); color: var(--c-ink-2); }
.card-valor { font-weight: 600; color: var(--c-ink); }
.card-dias { display: inline-flex; gap: 3px; align-items: center; margin-left: auto; }
.card-dias svg { width: 12px; height: 12px; }
.card-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.card-tags .badge { font-size: 11px; padding: 0 6px; }
.sinal { width: 10px; height: 10px; border-radius: 50%; flex: none; margin-top: 4px; }
.sinal-sem { background: var(--c-danger); }
.sinal-atrasada { background: #d99a00; }
.sinal-agendada { background: var(--c-success); }

/* Barra de etapas do dossiê */
.etapas ol { list-style: none; margin: 0 0 var(--s-3); padding: 0; display: flex; overflow-x: auto; border: 1px solid var(--c-line); border-radius: var(--r-panel); background: var(--c-surface); }
.etapas li { flex: 1 1 0; min-width: 120px; border-right: 1px solid var(--c-line); }
.etapas li:last-child { border-right: 0; }
.etapas li > span, .etapas li button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 100%; min-height: 52px;
  padding: var(--s-2); background: none; border: 0; border-radius: 0; font: 500 var(--fs-xs)/1.3 var(--font); color: var(--c-ink-2); text-align: center; white-space: normal; }
.etapas li button:hover { background: var(--c-hover); color: var(--c-ink); }
.etapas li small { font-size: 11px; color: var(--c-ink-3); }
.etapas li.feita > span, .etapas li.feita button { color: var(--c-ink); background: var(--c-accent-soft); }
.etapas li.atual > span { background: var(--c-accent); color: #fff; font-weight: 700; }
.etapas li.atual small { color: rgba(255,255,255,.85); }
.finais { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; margin-bottom: var(--s-5); font-size: var(--fs-sm); color: var(--c-ink-2); }
.fim-success { color: var(--c-success); } .fim-danger { color: var(--c-danger); } .fim-warning { color: var(--c-warning); }
@media (max-width: 760px) {
  main.wide { padding-left: var(--s-4); padding-right: var(--s-4); }
  .col { flex-basis: 84vw; }
}
input[type=time], input[type=tel] { width: 100%; min-height: 36px; padding: 7px 10px; border: 1px solid var(--c-line-2); border-radius: var(--r-ctl); background: #fff; color: var(--c-ink); font: var(--fs-md)/1.4 var(--font); }
input[type=time]:focus, input[type=tel]:focus { outline: none; border-color: var(--c-accent); box-shadow: var(--focus); }
#encerrar { margin-bottom: var(--s-5); }

/* v0.2 · lista, busca, empresas e pessoas */
.busca-topo input { width: 260px; min-height: 32px; padding: 5px 10px; border: 1px solid var(--c-line-2); border-radius: var(--r-ctl); background: #fff; font: var(--fs-sm)/1.4 var(--font); }
.busca-topo input:focus { outline: none; border-color: var(--c-accent); box-shadow: var(--focus); }
.busca-grande { display: flex; gap: var(--s-2); margin-bottom: var(--s-4); }
.busca-grande input { flex: 1; min-height: 40px; padding: 8px 12px; border: 1px solid var(--c-line-2); border-radius: var(--r-ctl); background: #fff; font: var(--fs-md)/1.4 var(--font); }
.busca-grande input:focus { outline: none; border-color: var(--c-accent); box-shadow: var(--focus); }
input[type=search] { -webkit-appearance: none; appearance: none; }
.filtros .row { align-items: flex-end; }
.filtros .form-foot { display: flex; gap: var(--s-2); }
.table-wrap { overflow-x: auto; }
.table td.num, .table th.num { text-align: right; white-space: nowrap; }
.table td .badge { margin: 2px 2px 0 0; }
.page-head .who h1 { margin: 0; }
ul.dup { margin: var(--s-2) 0; padding-left: var(--s-5); }
ul.dup ul { padding-left: var(--s-4); margin: var(--s-1) 0; }
@media (max-width: 760px) { .busca-topo { display: none; } }
.field input[type=search] { width: 100%; min-height: 36px; padding: 7px 10px; border: 1px solid var(--c-line-2); border-radius: var(--r-ctl); background: #fff; color: var(--c-ink); font: var(--fs-md)/1.4 var(--font); }
.field input[type=search]:focus { outline: none; border-color: var(--c-accent); box-shadow: var(--focus); }

/* v0.3 · copiloto */
.panel.tone-info { border-color: var(--c-accent); box-shadow: inset 3px 0 0 var(--c-accent); }
.acoes-sug { display: flex; gap: var(--s-2); align-items: flex-start; }
.kv-call { grid-template-columns: 170px 1fr; margin-top: var(--s-2); }
.kv-call pre { margin: 0; white-space: pre-wrap; font-size: var(--fs-sm); }
details.transcricao { margin-top: var(--s-2); }
details.transcricao > summary { cursor: pointer; font-size: var(--fs-sm); color: var(--c-accent); font-weight: 600; }
details.transcricao pre { max-height: 420px; overflow: auto; background: var(--c-surface-2); border: 1px solid var(--c-line); border-radius: var(--r-ctl); padding: var(--s-3); white-space: pre-wrap; }

/* v0.5 · entrar e criar conta */
.ou { display: flex; align-items: center; gap: var(--s-3); margin: var(--s-4) 0; color: var(--c-ink-3); font-size: var(--fs-sm); }
.ou::before, .ou::after { content: ''; flex: 1; border-top: 1px solid var(--c-line); }
.auth-alt { margin-top: var(--s-4); text-align: center; font-size: var(--fs-sm); color: var(--c-ink-2); }
.auth-card .hint { display: block; margin-top: 4px; font-size: var(--fs-xs); color: var(--c-ink-2); }
.auth-card .alert { margin-bottom: var(--s-4); }
.auth-card .hint.centro { text-align: center; margin-top: var(--s-2); }

/* v0.5 · telas de entrar e de cadastro do administrador */
.auth-card h1 { font-size: var(--fs-xl); margin: 0 0 var(--s-1); }
.auth-card > p.muted { margin: 0 0 var(--s-5); }
.auth-card .btn-lg { display: flex; align-items: center; justify-content: center; gap: var(--s-2); }
.auth-card .btn-lg .icon { width: 18px; height: 18px; }
.btn-google .g-logo { flex: none; }
.auth-switch .btn-ghost { display: inline-flex; align-items: center; gap: var(--s-2); width: auto; color: var(--c-ink-2); }
.auth-switch .btn-ghost .icon { width: 16px; height: 16px; }
.auth-rodape { margin: var(--s-3) 0 0; font-size: var(--fs-xs); color: var(--c-ink-3); }
.senha-box { position: relative; display: block; }
.senha-box input { width: 100%; padding-right: 78px; }
.senha-box .mostrar { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; padding: 4px 8px;
  color: var(--c-accent); font: 600 var(--fs-sm)/1 var(--font); cursor: pointer; border-radius: var(--r-ctl); }
.senha-box .mostrar:hover { background: var(--c-surface-2); }
.senha-box .mostrar:focus-visible { outline: none; box-shadow: var(--focus); }
.contador { display: block; margin-top: var(--s-1); font-size: var(--fs-sm); color: var(--c-ink); }
.contador.ok { color: var(--c-success, #1a7f4b); }
.no-js .js-only { display: none; }

/* ---------- segundo fator ---------- */
.passos-2fa { margin: 0 0 12px 18px; padding: 0; line-height: 1.6; }
.qr-2fa { display: flex; justify-content: center; margin: 8px 0 12px; }
.qr-2fa svg { width: 220px; height: 220px; border: 1px solid var(--border, #d0d5dd); border-radius: 8px; background: #fff; }
.chave-2fa { margin-bottom: 12px; }
.chave-2fa .chave { word-break: break-all; font-size: 15px; letter-spacing: .5px; }
.codigos-2fa { columns: 2; column-gap: 24px; margin: 12px 0 12px 18px; padding: 0; font-size: 16px; line-height: 1.9; }
.codigos-2fa code { letter-spacing: 1px; }

/* v0.10 · portal único: seletor CRM ⇄ PACS no menu, logo abaixo da marca (igual ao PACS) */
.troca { display: flex; border: 1px solid var(--c-line); border-radius: var(--r-ctl); overflow: hidden; margin: 4px 0 8px; background: #fff; }
.troca-item { flex: 1; text-align: center; padding: 5px 10px; font: 600 var(--fs-sm)/1.4 var(--font); color: inherit; text-decoration: none; }
.troca-item + .troca-item { border-left: 1px solid var(--c-line); }
.troca-item[aria-current="page"] { background: var(--c-accent); color: #fff; }
.troca-item[href]:hover { background: var(--c-accent-soft); }
.troca-item:focus-visible { outline: none; box-shadow: var(--focus); }
.troca-item.sem-acesso { opacity: .55; }
.troca-sub { margin-top: 0; }
.troca-sub .troca-item { font-weight: 500; }

/* 0.12: registrar e agendar na empresa e na pessoa */
fieldset.abas-tipo { border: 0; padding: 0; margin: 0 0 var(--s-3); display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--c-line); }
fieldset.abas-tipo legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.abas-tipo label { cursor: pointer; }
.abas-tipo input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.abas-tipo span { display: inline-block; padding: 8px var(--s-3); font-size: var(--fs-sm); font-weight: 600; color: var(--c-ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.abas-tipo label:hover span { color: var(--c-ink); }
.abas-tipo input:checked + span { color: var(--c-accent-hover); border-bottom-color: var(--c-accent); }
.abas-tipo input:focus-visible + span { box-shadow: var(--focus); border-radius: var(--r-ctl); }
.filtros-atividade { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; justify-content: space-between; margin: 0 0 var(--s-3); }
.filtro-resp { display: flex; gap: var(--s-2); align-items: center; }
.filtro-resp select { min-width: 0; max-width: 220px; }
.timeline li.pendente { background: var(--c-warning-bg); border-radius: var(--r-ctl); padding-left: var(--s-2); padding-right: var(--s-2); }
.timeline li form.inline input[name="resumo"] { width: 170px; max-width: 100%; }
@media (max-width: 640px) { .timeline li { flex-wrap: wrap; } .timeline li form.inline { width: 100%; } .timeline li form.inline input[name="resumo"] { flex: 1; } }
/* 0.13: mover o card no quadro sem abrir o negócio */
.card.movendo { opacity: .6; }
.card:target { outline: 2px solid var(--c-accent); outline-offset: 1px; }
.quadro-aviso { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(12px); background: var(--c-ink); color: #fff; padding: 10px 16px; border-radius: var(--r-ctl); font-size: var(--fs-sm); box-shadow: 0 8px 24px rgba(16, 24, 40, .22); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; max-width: calc(100vw - 32px); }
.quadro-aviso.visivel { opacity: 1; transform: translateX(-50%); }
.quadro-aviso.erro { background: var(--c-danger); }
dialog.modal-mover { border: 0; padding: 0; background: transparent; width: min(560px, calc(100vw - 32px)); color: var(--c-ink); }
dialog.modal-mover::backdrop { background: rgba(16, 24, 40, .32); }
dialog.modal-mover .panel { margin: 0; box-shadow: 0 24px 64px rgba(16, 24, 40, .22); }
dialog.modal-mover .form-foot { display: flex; gap: var(--s-2); }
@media (prefers-reduced-motion: reduce) { .quadro-aviso { transition: none; } }dialog.modal-mover { overflow: visible; }
dialog.modal-mover [hidden] { display: none !important; }
/* 0.14: pasta do Drive e transcrição de reunião */
.icone-drive { display: inline-flex; vertical-align: -2px; margin-left: 6px; color: var(--c-ink-3); }
.icone-drive svg { width: 14px; height: 14px; }
.icone-drive:hover { color: var(--c-accent); }
.situacao-resumo { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; margin: var(--s-2) 0; }
.situacao-resumo form.inline { margin: 0; }
.passos-resumo { margin: var(--s-2) 0; font-size: var(--fs-sm); }
.passos-resumo ul { list-style: none; margin: var(--s-1) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-1); }
.passos-resumo li { display: flex; gap: var(--s-2); align-items: center; justify-content: space-between; }/* 0.16: confirmar a mudança de etapa e desfazer no quadro */
.quadro-aviso.visivel { pointer-events: auto; }
.quadro-aviso .desfazer { background: none; border: 0; padding: 0; color: inherit; font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
.quadro-aviso .desfazer:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
dialog.modal-confirmar { width: min(440px, calc(100vw - 32px)); }
dialog.modal-confirmar .confirmar-texto { margin: 0 0 var(--s-3); font-size: var(--fs-md, 1rem); }
/* 0.17: salvando, atividades (editar e "Como foi?"), Copiloto e último contato */
.girando { display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: girar .7s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }
.btn.salvando { cursor: progress; }
.salvando-topo { position: fixed; top: 12px; left: 50%; transform: translateX(-50%) translateY(-8px); background: var(--c-ink); color: #fff; padding: 6px 14px; border-radius: var(--r-ctl); font-size: var(--fs-sm); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60; }
.salvando-topo.visivel { opacity: 1; transform: translateX(-50%); }
.card.movendo { position: relative; cursor: progress; }
.card.movendo::after { content: ""; position: absolute; top: 8px; right: 8px; width: 12px; height: 12px; border: 2px solid var(--c-accent); border-right-color: transparent; border-radius: 50%; animation: girar .7s linear infinite; }
@media (prefers-reduced-motion: reduce) { .girando, .card.movendo::after { animation-duration: 2s; } .salvando-topo { transition: none; } }
.acoes-atividade { display: flex; gap: var(--s-1, 4px); align-items: flex-start; flex-wrap: wrap; }
.conclusao { margin: 6px 0 0; font-size: var(--fs-sm); padding: 6px 10px; border-left: 3px solid var(--c-accent); background: rgba(11, 110, 112, .06); border-radius: 0 6px 6px 0; }
.editada { margin: 2px 0 0; color: var(--c-ink-3); }
#como-foi textarea { font-size: 1rem; border-width: 2px; border-color: var(--c-accent); }
dialog.modal-atividade .form-foot .btn-ghost, #como-foi a[data-fechar], #editar-atividade a[data-fechar] { margin-top: var(--s-2, 8px); }
.badge-copiloto { background: #ede7fb; color: #4b2a9a; border: 1px solid #d3c5f3; }
.call-copiloto { margin: 4px 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
details.ver-call > summary { cursor: pointer; color: var(--c-accent); font-size: var(--fs-sm); }
.contato, .card-contato { font-size: var(--fs-xs); color: var(--c-ink-3); }
.contato { align-self: center; padding: 2px 8px; border-radius: 999px; border: 1px solid transparent; }
.card-contato { display: block; margin-top: 2px; }
.contato-warning, .card-contato-warning { color: var(--c-warning); background: var(--c-warning-bg); border-color: var(--c-warning-line); }
.contato-danger, .card-contato-danger { color: var(--c-danger); background: var(--c-danger-bg); border-color: var(--c-danger-line); }
.card-contato-warning, .card-contato-danger { padding: 1px 6px; border-radius: 4px; display: inline-block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge-copiloto { background: #2d2350; color: #d9ccff; border-color: #4b3a86; } }
/* 0.18: sugestão de follow-up */
.btn-followup[disabled] { opacity: .55; cursor: not-allowed; }
.finais small.faint { align-self: center; }
.situacao-lead { font-size: 1rem; margin: 0; }
.opcao-proximo { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--c-line); cursor: pointer; }
.opcao-proximo:last-child { border-bottom: 0; }
.opcao-proximo input { margin-top: 4px; }
.plano-followup .toque { display: flex; gap: 12px; align-items: flex-start; }
.plano-followup .toque .check { white-space: nowrap; min-width: 84px; }
.plano-followup textarea { width: 100%; min-height: 90px; }
.acoes-followup { display: flex; gap: var(--s-2, 8px); margin-top: var(--s-3, 12px); flex-wrap: wrap; }
.msg-followup { margin-top: 6px; border: 1px dashed var(--c-line); border-radius: 6px; padding: 8px 10px; }
.msg-followup pre { margin: 0 0 6px; white-space: pre-wrap; }
.acoes-msg { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 640px) { .plano-followup .toque { flex-direction: column; } }
/* 0.19: PACS com a pessoa em destaque */
.page-head h1 .h1-link { color: inherit; text-decoration: none; }
.page-head h1 .h1-link:hover { text-decoration: underline; }
/* 0.20: negociação, pagamentos e documentos */
.negociacao { margin: var(--s-3, 12px) 0; }
details.negociacao.vazia, section.negociacao.vazia { border: 1px dashed var(--c-line); border-radius: var(--r-panel, 10px); padding: 10px 14px; background: var(--c-surface, #fff); }
details.negociacao.vazia > summary { cursor: pointer; }
details.negociacao.vazia[open] > summary { margin-bottom: 10px; }
.negociacao-dados { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px 16px; margin: 0 0 8px; }
.negociacao-dados dt { font-size: var(--fs-xs); color: var(--c-ink-3); }
.negociacao-dados dd { margin: 0; }
.condicao { margin: 4px 0 10px; }
.totais-pag { display: flex; flex-wrap: wrap; gap: 16px; margin: 8px 0; font-size: var(--fs-sm); }
.totais-pag .atrasado b { color: var(--c-danger); }
tr.pag-atrasado td { background: var(--c-danger-bg); }
tr.pag-cancelado td { color: var(--c-ink-3); text-decoration: line-through; }
.acoes-pag { white-space: nowrap; }
details.acao-pag { display: inline-block; vertical-align: top; }
details.acao-pag > summary { list-style: none; }
details.acao-pag > summary::-webkit-details-marker { display: none; }
details.acao-pag[open] { display: block; margin-top: 6px; padding: 10px; border: 1px solid var(--c-line); border-radius: 8px; white-space: normal; }
.acoes-negociacao { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; margin-top: 10px; }
.hist-pag { margin-top: 10px; font-size: var(--fs-sm); }
.hist-pag ul { margin: 6px 0 0; padding-left: 18px; }
.doc-link { display: inline-flex; gap: 4px; align-items: center; }
.doc-link svg { width: 14px; height: 14px; }
.card-pag { display: block; margin-top: 2px; }
.selo-pagamento { white-space: nowrap; }
@media (max-width: 640px) { .acoes-pag { white-space: normal; } }
/* 0.22: no PACS, o nome completo da pessoa nas listas; o título só quando é realmente diferente */
.negocio-titulo { display: block; font-size: var(--fs-xs); color: var(--c-ink-3); font-weight: normal; }
