:root {
  --ink: #10131A;
  --ink-2: #5A6072;
  --ink-3: #9AA0AE;
  --paper: #FFFFFF;
  --paper-2: #F7F8FA;
  --line: #E8EAEF;
  --blue: #1238C8;
  --blue-soft: #EEF2FE;
  --green: #0F9D58;
  --amber: #C77700;
  --red: #C0392B;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font-ui: "Schibsted Grotesk", sans-serif;
  --font-body: "Instrument Sans", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
[hidden] { display: none !important; }
svg { width: 16px; height: 16px; flex: none; }

.shell { display: flex; height: 100vh; }

/* sidebar */
.sidebar {
  width: 248px; flex: none;
  background: var(--paper-2);
  border-right: 1px solid var(--line);
  position: sticky; top: 0; align-self: flex-start;
  height: 100vh;
  display: flex; flex-direction: column;
  padding: 12px 10px;
  transition: width .26s var(--ease);
  overflow: hidden;
}
/* estados navmin (colapso + reaparecer) ficam no bloco SIDEBAR RECOLHIVEL abaixo */
.sidebar .nav-item, .sidebar .quick-actions, .sidebar .workspace { white-space: nowrap; }
.workspace {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 8px;
}
.workspace:hover { background: rgba(0,0,0,.04); }
.logomark {
  width: 26px; height: 26px; flex: none; border-radius: 8px;
  background: var(--blue); color: #fff;
  font-family: var(--font-ui); font-weight: 600; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  padding-bottom: 2px;
}
.workspace-name {
  font-family: var(--font-ui); font-weight: 600; font-size: 15px;
  color: var(--blue); letter-spacing: -.01em;
}
.chev { color: var(--ink-3); width: 14px; height: 14px; }

.quick-row { display: flex; gap: 6px; margin: 12px 0 14px; }
.quick-actions {
  flex: 1; display: flex; align-items: center; gap: 7px;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 9px;
  color: var(--ink-2); font-size: 12.5px;
}
.quick-actions svg { color: var(--ink-3); width: 14px; height: 14px; }
.quick-actions kbd {
  margin-left: auto; font-family: var(--font-mono); font-size: 10.5px;
  color: var(--ink-3); border: 1px solid var(--line); border-radius: 4px;
  padding: 1px 4px; background: var(--paper);
}
.icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px; color: var(--ink-2);
  border: 1px solid transparent;
}
.icon-btn:hover { background: rgba(0,0,0,.04); }
.quick-row .icon-btn { background: var(--paper); border-color: var(--line); }

.nav { display: flex; flex-direction: column; gap: 1px; overflow-y: auto; flex: 1; }
.nav-item {
  transition: color .2s var(--ease);
  display: flex; align-items: center; gap: 9px;
  height: 32px; padding: 0 9px; border-radius: 8px;
  color: var(--ink-2); font-size: 13px; text-align: left;
  border: 1px solid transparent;
  width: 100%;
}
.nav-item svg { color: var(--ink-3); }
.nav-item:hover { background: rgba(0,0,0,.04); }
.nav-item.active {
  background: var(--paper); border-color: var(--line);
  color: var(--ink); font-weight: 500;
}
.nav-item.active svg { color: var(--ink); }
.nav-item .chev { margin-left: auto; transition: transform .16s var(--ease); }
.nav-group.collapsed .chev { transform: rotate(-90deg); }
.nav-group.collapsed .nav-children { display: none; }
.nav-children .child { padding-left: 34px; }
.nav-badge {
  margin-left: auto; min-width: 17px; height: 17px; border-radius: 9px;
  background: var(--blue); color: #fff;
  font-family: var(--font-mono); font-size: 10px;
  display: flex; align-items: center; justify-content: center; padding: 0 5px;
}
.section-label {
  font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-3); padding: 14px 9px 5px;
}

.sidebar-foot { padding-top: 10px; border-top: 1px solid var(--line); margin-top: 10px; }
.profile-switch {
  display: flex; background: var(--paper); border: 1px solid var(--line);
  border-radius: 8px; padding: 2px; gap: 2px;
}
.profile-switch .seg {
  flex: 1; padding: 5px 0; border-radius: 6px; font-size: 12px; color: var(--ink-2);
  transition: background .16s var(--ease);
}
.profile-switch .seg.active { background: var(--blue-soft); color: var(--blue); font-weight: 500; }

/* main */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 52px; flex: none; display: flex; align-items: center;
  justify-content: space-between; padding: 0 20px;
  border-bottom: 1px solid var(--line);
}
.topbar-title { display: flex; align-items: center; gap: 8px; }
.topbar h1 { font-family: var(--font-ui); font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
@keyframes livepulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(15,157,88,.35); }
  50% { box-shadow: 0 0 0 4px rgba(15,157,88,0); }
}
@keyframes flash {
  0% { box-shadow: 0 0 0 0 rgba(15,157,88,.55); }
  100% { box-shadow: 0 0 0 8px rgba(15,157,88,0); }
}

.view { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }

/* metrics strip */
.metrics {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  padding: 16px 20px 0;
}
.metric {
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
}
.metric .label {
  font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 6px;
}
.metric .value {
  font-family: var(--font-mono); font-size: 21px; font-weight: 500;
  letter-spacing: -.02em;
  transition: color .4s var(--ease);
}
.metric .value.bump { color: var(--blue); }
.metric .hint { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }

/* pipeline board: 7 etapas, scroll horizontal */
.board {
  flex: 1; min-height: 0; display: flex; gap: 12px;
  padding: 16px 20px 20px; overflow-x: auto; overflow-y: hidden;
  overscroll-behavior-x: contain;   /* rolar o board nao vira swipe de historico */
}
.column { flex: 0 0 232px; min-width: 232px; display: flex; flex-direction: column; min-height: 0; }
.column-head {
  display: flex; align-items: baseline; gap: 8px;
  padding: 0 2px 10px; flex: none;
}
.column-head .name { font-family: var(--font-ui); font-weight: 600; font-size: 13px; }
.column-head .count { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); }
.column-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; padding-right: 2px; }
.column-empty {
  border: 1px dashed var(--line); border-radius: 12px;
  padding: 18px 14px; color: var(--ink-3); font-size: 12px; text-align: center;
}

/* lead card */
.card {
  position: relative;
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px 12px 17px; cursor: pointer;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
  overflow: hidden;
}
.card:hover { border-color: #D5D9E2; box-shadow: 0 1px 4px rgba(16,19,26,.05); }
.card.selected { border-color: var(--blue); }
.card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--edge, var(--blue));
  transition: background .4s var(--ease);
}
.card.enter { animation: cardenter .42s var(--ease); }
@keyframes cardenter {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}
.card.enter::after {
  content: ""; position: absolute; left: 0; top: 0; width: 3px; height: 30%;
  background: rgba(255,255,255,.85);
  animation: edgesweep .9s var(--ease) .1s both;
}
@keyframes edgesweep {
  from { top: -30%; } to { top: 130%; }
}
.card.ring { animation: ringdecay .8s var(--ease); }
@keyframes ringdecay {
  0% { box-shadow: 0 0 0 1.5px var(--blue); }
  100% { box-shadow: 0 0 0 1.5px rgba(18,56,200,0); }
}
.card.moving { transition: transform .42s var(--ease); }

.card-top { display: flex; align-items: center; gap: 9px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: var(--blue-soft); color: var(--blue);
  font-family: var(--font-ui); font-weight: 600; font-size: 11.5px;
  display: flex; align-items: center; justify-content: center;
}
.card-id { min-width: 0; }
.card-name {
  font-family: var(--font-ui); font-weight: 600; font-size: 14.5px;
  letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-sub {
  font-size: 12px; color: var(--ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-visit {
  font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-2);
  margin-top: 8px; display: flex; align-items: center; gap: 6px;
}
.card-visit svg { width: 13px; height: 13px; color: var(--ink-3); }
.card-chips { display: flex; align-items: center; gap: 6px; margin-top: 9px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--line); border-radius: 6px;
  padding: 2.5px 7px; font-size: 11px; color: var(--ink-2);
  background: var(--paper);
}
.chip.stage-novo { color: var(--blue); border-color: #C9D5F8; background: var(--blue-soft); }
.chip.stage-qualificado { color: var(--blue); border-color: #C9D5F8; background: var(--blue-soft); }
.chip.stage-visita_agendada { color: var(--green); border-color: #C4E3D2; background: #EDF8F1; }
.chip.stage-pos_visita { color: var(--amber); border-color: #EBD7B8; background: #FBF4E7; }
.chip.handoff { color: var(--red); border-color: #ECCFCB; background: #FBF0EE; }
.chip .wa-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--green);
  animation: livepulse 2s ease-in-out infinite;
}

/* matriculadora queue */
.queue { flex: 1; overflow-y: auto; padding: 16px 20px; }
.queue-row {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 16px; margin-bottom: 10px; cursor: pointer;
}
.queue-row:hover { border-color: #D5D9E2; }
.queue-row .who { flex: 1; min-width: 0; }
.queue-row .next {
  font-size: 12px; color: var(--ink-2); flex: 1.4;
}
.queue-row .next strong { font-weight: 600; color: var(--ink); }

/* agenda */
.agenda { flex: 1; overflow-y: auto; padding: 16px 20px; }
.agenda-day { margin-bottom: 20px; }
.agenda-day > .day-label {
  font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 8px;
}
.agenda-row {
  display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 16px; margin-bottom: 8px; cursor: pointer;
  position: relative; overflow: hidden; background: var(--paper);
}
.agenda-row::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--green);
}
.agenda-row.resched::before { background: var(--amber); }
.agenda-row.enter { animation: cardenter .42s var(--ease); }
.agenda-row .time { font-family: var(--font-mono); font-size: 13px; width: 88px; flex: none; }
.agenda-row .who { flex: 1; min-width: 0; }
.agenda-row .who .name { font-family: var(--font-ui); font-weight: 600; font-size: 13.5px; }
.agenda-row .who .meta { font-size: 12px; color: var(--ink-2); }
.agenda-row .school { font-size: 12.5px; color: var(--ink-2); }
.agenda-empty, .activity-empty { color: var(--ink-3); padding: 32px 20px; text-align: center; font-size: 12.5px; }

/* activity feed */
.activity { flex: 1; overflow-y: auto; padding: 16px 20px; max-width: 760px; }
.activity-row {
  display: flex; gap: 12px; padding: 11px 4px;
  border-bottom: 1px solid var(--line);
}
.activity-row.enter { animation: rowdrop .42s var(--ease); }
@keyframes rowdrop {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}
.actor-badge {
  flex: none; font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase;
  border-radius: 5px; padding: 2px 6px; height: fit-content; margin-top: 1px;
}
.actor-badge.agente { background: var(--blue-soft); color: var(--blue); }
.actor-badge.humano { background: var(--paper-2); color: var(--ink-2); }
.activity-row .body { flex: 1; min-width: 0; }
.activity-row .who { font-weight: 600; font-family: var(--font-ui); font-size: 13px; }
.activity-row .text { color: var(--ink-2); font-size: 12.5px; margin-top: 1px; overflow-wrap: anywhere; }
.activity-row .when { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); flex: none; }

/* reports */
.reports { flex: 1; overflow-y: auto; padding: 16px 20px; }
.reports .metrics { padding: 0 0 16px; }
.report-table { width: 100%; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.report-table table { width: 100%; border-collapse: collapse; }
.report-table th {
  text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 500; padding: 10px 14px;
  border-bottom: 1px solid var(--line); background: var(--paper-2);
}
.report-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.report-table tr:last-child td { border-bottom: none; }
.report-table .mono { font-family: var(--font-mono); font-size: 12px; }
.report-section-label {
  font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-3); margin: 6px 0 10px;
}
.reports .metrics + .report-section-label, .report-split + .report-section-label,
.report-table + .report-section-label { margin-top: 22px; }
.report-split { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; align-items: start; }
.report-split .metrics { grid-template-columns: repeat(2, 1fr); padding: 0; }
.funnel { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.funnel-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.funnel-row .flabel { width: 96px; flex: none; font-size: 12px; color: var(--ink-2); }
.funnel-row .fbar {
  flex: 1; min-width: 48px; height: 10px; border-radius: 999px; background: #EDEFF4; overflow: hidden;
}
.funnel-row .ffill {
  display: block; height: 100%; border-radius: 999px; background: var(--blue);
  transition: width .5s var(--ease);
}
.funnel-row .fnum { width: 64px; flex: none; text-align: right; font-family: var(--font-mono); font-size: 11.5px; }
@media (max-width: 1100px) { .report-split { grid-template-columns: 1fr; } }

/* tasks */
.task-row {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 16px; margin-bottom: 10px; cursor: pointer;
  transition: opacity .34s var(--ease), transform .34s var(--ease);
}
.task-row:hover { border-color: #D5D9E2; }
.task-row .who { flex: 1; min-width: 0; }
.task-row.enter { animation: cardenter .42s var(--ease); }
.task-row.done { opacity: 0; transform: translateX(14px); }
.task-row.done .task-check { background: var(--green); border-color: var(--green); color: #fff; }
.task-check {
  width: 22px; height: 22px; flex: none; border-radius: 7px;
  border: 1.5px solid #C9CDD8; color: transparent;
  display: flex; align-items: center; justify-content: center;
  transition: all .18s var(--ease);
}
.task-check:hover { border-color: var(--green); color: var(--green); }
.task-check svg { width: 13px; height: 13px; }
.task-origin { font-size: 11px; color: var(--ink-3); white-space: nowrap; }

/* sync pills: write-back to CRM + Google Agenda */
.sync-pills { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.sync-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; border-radius: 999px; padding: 3px 10px;
  border: 1px solid var(--line); color: var(--ink-2);
  width: fit-content; white-space: nowrap;
}
.sync-pill svg { width: 12px; height: 12px; }
.sync-pill.ok { color: var(--green); border-color: #CDEBDA; background: #F2FBF6; }
.sync-pill.wait { color: var(--amber); border-color: #F0E0C8; background: #FDF8F0; }
/* sequences and flows */
.sequences, .flows { flex: 1; overflow-y: auto; padding: 16px 20px; max-width: 760px; }
.seq-row {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px;
  display: flex; align-items: center; gap: 14px;
}
.seq-row .icon {
  width: 34px; height: 34px; border-radius: 9px; background: var(--blue-soft);
  color: var(--blue); display: flex; align-items: center; justify-content: center; flex: none;
}
.seq-row .body { flex: 1; }
.seq-row .name { font-family: var(--font-ui); font-weight: 600; font-size: 13.5px; }
.seq-row .desc { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.seq-row .state {
  font-family: var(--font-mono); font-size: 11px; color: var(--green);
  display: flex; align-items: center; gap: 5px;
}
.seq-row .state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.seq-row .state-planejada { color: var(--amber); }
.seq-row .state-planejada::before { background: var(--amber); }

/* thread */
.thread {
  flex: 1; overflow-y: auto; padding: 28px 20px 16px;
  display: flex; flex-direction: column; align-items: center;
}
.thread > * { width: 100%; max-width: 720px; }
.thread-empty { margin: auto; text-align: center; }
.thread-hello { color: var(--ink-2); font-size: 14px; margin-bottom: 16px; }
.suggestions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.suggestion {
  border: 1px solid var(--line); border-radius: 9px; padding: 7px 12px;
  font-size: 12.5px; color: var(--ink-2);
}
.suggestion:hover { border-color: #D5D9E2; color: var(--ink); }
.msg { margin-bottom: 18px; display: flex; }
.msg.user {
  justify-content: flex-end;
  animation: bubblein .38s cubic-bezier(.3, 1.3, .4, 1) both;
  transform-origin: bottom right;
}
@keyframes bubblein {
  from { opacity: 0; transform: translateY(10px) scale(.95); }
}
.msg.user .bubble {
  background: var(--paper-2); border-radius: 12px; padding: 10px 14px;
  max-width: 78%; font-size: 13.5px;
}
.msg.agent {
  display: block; font-size: 13.5px; line-height: 1.55;
  animation: rowdrop .35s var(--ease) both;
}
.msg.agent .reply { white-space: pre-wrap; }
.reply p { margin: 0 0 7px; }
.reply p:last-child { margin-bottom: 0; }
.reply ul { margin: 4px 0 8px; padding-left: 18px; }
.reply li { margin: 2px 0; }
.reply strong { font-weight: 600; }
.reply code { font-family: var(--font-mono); font-size: 12px; background: var(--paper-2); padding: 1px 4px; border-radius: 4px; }

.reply .chunk { animation: chunkin .4s var(--ease) both; }
@keyframes chunkin { from { opacity: 0; } }
.reply.streaming::after {
  content: ""; display: inline-block; width: 7px; height: 14px;
  background: var(--blue); margin-left: 3px; border-radius: 1.5px;
  vertical-align: -2px; animation: caretblink .9s steps(2) infinite;
}
@keyframes caretblink { 50% { opacity: 0; } }
.think-dots { display: inline-flex; gap: 4px; align-items: center; height: 14px; }
.think-dots i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3);
  animation: dotwave 1.1s ease-in-out infinite;
}
.think-dots i:nth-child(2) { animation-delay: .15s; }
.think-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dotwave {
  0%, 60%, 100% { transform: none; opacity: .45; }
  30% { transform: translateY(-4px); opacity: 1; }
}
.tool-status {
  display: flex; align-items: center; gap: 7px;
  color: var(--ink-3); font-size: 12px; margin-top: 8px;
  animation: rowdrop .3s var(--ease) both;
}
.tool-status::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--blue); animation: livepulse 1.6s ease-in-out infinite;
}
.tool-status.out { animation: toolout .25s var(--ease) forwards; }
@keyframes toolout { to { opacity: 0; transform: translateY(-4px); } }

/* embedded record card (thread): choreographed grow-in */
.thread-card {
  border: 1px solid var(--line); border-radius: 12px; margin-top: 12px;
  padding: 13px 16px 13px 19px; position: relative; overflow: hidden;
  box-shadow: 0 1px 4px rgba(16,19,26,.04); cursor: pointer;
  animation: cardgrow .55s cubic-bezier(.22, 1.2, .36, 1) both;
  transform-origin: top left;
}
@keyframes cardgrow {
  0% { opacity: 0; transform: scale(.9) translateY(10px); }
  60% { opacity: 1; }
  100% { transform: none; }
}
.thread-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--edge, var(--green));
}
.thread-card::after {
  content: ""; position: absolute; left: 0; top: -30%; width: 3px; height: 30%;
  background: rgba(255,255,255,.85);
  animation: edgesweep .9s var(--ease) .25s both;
}
.thread-card .avatar { animation: popin .5s cubic-bezier(.3, 1.6, .4, 1) .12s both; }
@keyframes popin { from { transform: scale(0); } }
.thread-card .card-name, .thread-card .card-sub {
  animation: rowdrop .4s var(--ease) .18s both;
}
.thread-card .chip { animation: chipin .4s var(--ease) both; }
.thread-card .chip:nth-child(1) { animation-delay: .3s; }
.thread-card .chip:nth-child(2) { animation-delay: .4s; }
.thread-card .chip:nth-child(3) { animation-delay: .5s; }
@keyframes chipin {
  from { opacity: 0; transform: translateY(6px) scale(.92); }
}

/* composer */
.composer { flex: none; padding: 10px 20px 20px; display: flex; justify-content: center; }
.composer-box {
  width: 100%; max-width: 720px;
  border: 1px solid var(--line); border-radius: 16px;
  padding: 12px 14px 10px;
  box-shadow: 0 1px 6px rgba(16,19,26,.04);
  transition: border-color .16s var(--ease);
}
.composer-box:focus-within { border-color: #C9D5F8; }
.composer-box textarea {
  width: 100%; border: none; outline: none; resize: none;
  font: inherit; font-size: 14px; color: var(--ink);
  max-height: 120px;
}
.composer-box textarea::placeholder { color: var(--ink-3); }
.composer-foot { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.composer-model { font-size: 12px; color: var(--ink-3); margin-left: auto; }
.send {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--blue-soft); color: var(--blue);
  display: flex; align-items: center; justify-content: center;
  transition: background .16s var(--ease), color .16s var(--ease);
}
.send:hover, .composer-box:focus-within .send { background: var(--blue); color: #fff; }

/* detail rail */
.rail {
  width: 340px; flex: none; border-left: 1px solid var(--line);
  overflow-y: auto;
  animation: railin .3s var(--ease);
}
@keyframes railin {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: none; }
}
.rail-inner { padding: 18px 18px 28px; }
.rail-head { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 4px; }
.rail-head .avatar { width: 38px; height: 38px; font-size: 13.5px; }
.rail-title { flex: 1; min-width: 0; }
.rail-title .name { font-family: var(--font-ui); font-weight: 600; font-size: 16px; letter-spacing: -.01em; }
.rail-title .sub { font-size: 12.5px; color: var(--ink-2); margin-top: 1px; }
.rail-close { color: var(--ink-3); display: flex; padding: 4px; }
.rail-close:hover { color: var(--ink); }
.rail-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 4px; }
.rail-section { margin-top: 18px; }
.rail-section > .label {
  font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 8px;
}
.field-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 6.5px 8px; margin: 0 -8px; border-radius: 7px; font-size: 12.5px;
}
.field-row .k { color: var(--ink-2); flex: none; }
.field-row .v { text-align: right; min-width: 0; }
.field-row .v.empty { color: var(--ink-3); }
.field-row .v.empty::after { content: "···"; letter-spacing: 2px; }
.field-row.wash { animation: fieldwash 1.2s var(--ease); }
@keyframes fieldwash {
  0% { background: var(--blue-soft); }
  100% { background: transparent; }
}
.visit-box {
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px;
  position: relative; overflow: hidden;
}
.visit-box::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--green);
}
.visit-box.fill::before { animation: greenfill .7s var(--ease); }
@keyframes greenfill { from { bottom: 100%; } to { bottom: 0; } }
.visit-box .when { font-family: var(--font-mono); font-size: 13px; }
.visit-box .where { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.visit-box .resched { font-size: 11.5px; color: var(--amber); margin-top: 5px; }
.tl { border-left: 1px solid var(--line); margin-left: 4px; padding-left: 14px; }
.tl-entry { position: relative; padding-bottom: 14px; }
.tl-entry.enter { animation: rowdrop .42s var(--ease); }
.tl-entry::before {
  content: ""; position: absolute; left: -17.5px; top: 4px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--paper); border: 1.5px solid var(--ink-3);
}
.tl-entry.agente::before { border-color: var(--blue); background: var(--blue-soft); }
.tl-entry .tl-top { display: flex; align-items: center; gap: 7px; margin-bottom: 2px; }
.tl-entry .when { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3); }
.tl-entry .text { font-size: 12.5px; line-height: 1.45; overflow-wrap: anywhere; }

/* rail conversation: the actual WhatsApp thread for each lead */
.rail-convo { display: flex; flex-direction: column; gap: 6px; max-height: 280px; overflow-y: auto; padding-right: 2px; }
.rail-msg {
  max-width: 82%; padding: 7px 10px; border-radius: 12px;
  font-size: 12.5px; line-height: 1.4; overflow-wrap: anywhere;
  animation: rowdrop .3s var(--ease) both;
}
.rail-msg.in { align-self: flex-start; background: var(--blue-soft); border-bottom-left-radius: 4px; }
.rail-msg.out { align-self: flex-end; background: var(--blue); color: #fff; border-bottom-right-radius: 4px; }
.rail-convo-empty { font-size: 12px; color: var(--ink-3); padding: 4px 0; }

/* toasts */
.toasts {
  position: fixed; right: 18px; bottom: 18px; z-index: 50;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
}
.toast {
  display: flex; align-items: center; gap: 9px;
  background: var(--ink); color: #fff;
  border-radius: 10px; padding: 10px 14px;
  font-size: 12.5px; max-width: 380px;
  box-shadow: 0 6px 24px rgba(16,19,26,.18);
  animation: toastin .3s var(--ease);
}
.toast.out { animation: toastout .3s var(--ease) forwards; }
@keyframes toastin {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@keyframes toastout {
  to { opacity: 0; transform: translateY(8px); }
}
.toast .glyph {
  width: 22px; height: 22px; border-radius: 6px; background: var(--blue);
  font-family: var(--font-ui); font-weight: 600; font-size: 12px;
  display: flex; align-items: center; justify-content: center; flex: none;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #DDE0E7; border-radius: 5px; border: 3px solid var(--paper); }
::-webkit-scrollbar-track { background: transparent; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media (max-width: 900px) {
  .rail {
    position: fixed; inset: 0 0 0 auto; z-index: 40;
    width: min(100vw, 360px); background: var(--paper);
    box-shadow: -10px 0 30px rgba(16,19,26,.12);
  }
}

@media (max-width: 760px) {
  body { overflow: auto; }
  .shell { display: block; min-height: 100vh; height: auto; }
  .sidebar {
    width: 100%; height: auto; max-height: 44vh;
    position: static; align-self: stretch;
    border-right: none; border-bottom: 1px solid var(--line);
  }
  .shell.navmin .sidebar, .shell.navmin .sidebar:hover { width: 100%; }
  .nav { max-height: 240px; }
  .sidebar-foot { margin-top: 8px; }
  .main { min-height: 100vh; }
  .topbar {
    position: sticky; top: 0; z-index: 20;
    background: var(--paper);
  }
  .view { overflow: visible; }
  .metrics, .board, .reports .metrics, .report-split .metrics {
    grid-template-columns: 1fr;
  }
  .board, .metrics, .agenda, .activity, .reports, .conversas,
  .queue, .queue-view, .escolas, .sequences, .flows {
    padding-left: 14px; padding-right: 14px;
  }
  .queue-row, .task-row, .agenda-row, .school-row > .head {
    align-items: flex-start; flex-wrap: wrap;
  }
  .queue-row .next, .task-origin, .agenda-row .school,
  .school-row .loc, .school-row .ucount {
    flex-basis: 100%;
  }
  .report-table { overflow-x: auto; }
  .composer { padding-left: 14px; padding-right: 14px; }
  .rail { inset: 0; width: 100%; }
  .toasts { left: 12px; right: 12px; align-items: stretch; }
  .toast { max-width: none; }
}

/* conversas */
.conversas { flex: 1; overflow-y: auto; padding: 16px 20px; max-width: 860px; }
.convo-row {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 16px; margin-bottom: 8px; cursor: pointer; background: var(--paper);
}
.convo-row:hover { border-color: #D5D9E2; }
.convo-row .who { flex: 1; min-width: 0; }
.convo-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.convo-top .when { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }
.convo-last {
  font-size: 12.5px; color: var(--ink-2); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.queue-view { padding: 16px 20px; overflow-y: auto; flex: 1; }

.nav-item.pulse { animation: navpulse .9s var(--ease); }
@keyframes navpulse {
  0% { background: var(--blue-soft); }
  100% { background: transparent; }
}

/* escolas: real network directory */
.escolas { flex: 1; overflow-y: auto; padding: 16px 20px; max-width: 860px; }
.escolas-claims {
  font-size: 12.5px; color: var(--ink-2); margin-bottom: 16px;
  display: flex; gap: 14px; flex-wrap: wrap;
}
.escolas-claims .num { font-family: var(--font-mono); color: var(--ink); }
.escolas .region-label {
  font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-3); margin: 18px 0 8px;
}
.school-row {
  border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px;
  background: var(--paper); overflow: hidden;
}
.school-row > .head {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; cursor: pointer; width: 100%; text-align: left;
}
.school-row > .head:hover { background: var(--paper-2); }
.school-row .brand { font-family: var(--font-ui); font-weight: 600; font-size: 13.5px; flex: 1; min-width: 0; }
.school-row .loc { font-size: 12px; color: var(--ink-2); }
.school-row .ucount { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); }
.school-row .units { border-top: 1px solid var(--line); padding: 6px 16px 10px; }
.school-row .unit-row { display: flex; gap: 10px; padding: 6px 0; font-size: 12.5px; }
.school-row .unit-row .uname { font-weight: 500; flex: none; min-width: 130px; }
.school-row .unit-row .uaddr { color: var(--ink-2); }
.school-row .segs { display: flex; gap: 5px; flex-wrap: wrap; padding: 0 16px 12px; }

/* rail school box */
.school-box { border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; }
.school-box .brand { font-family: var(--font-ui); font-weight: 600; font-size: 13px; }
.school-box .unit { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.school-box .addr { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; line-height: 1.4; }
.school-box .segs { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 8px; }

/* Harpian: edge bar por atraso/etapa terminal (default blue via var(--edge)) */
.card.edge-amber { --edge: var(--amber); }
.card.edge-red { --edge: var(--red); }
.card.edge-green { --edge: var(--green); }

/* chips por status */
.chip.blue { color: var(--blue); border-color: #C9D5F8; background: var(--blue-soft); }
.chip.green { color: var(--green); border-color: #C4E3D2; background: #EDF8F1; }
.chip.amber { color: var(--amber); border-color: #EBD7B8; background: #FBF4E7; }
.chip.red { color: var(--red); border-color: #ECCFCB; background: #FBF0EE; }
.chip.gray { color: var(--ink-3); }
.rail-chips .chip.dono { color: var(--ink-2); }

/* temperatura: dot solido pequeno, sem glow nem animacao */
.temp-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.temp-dot.hot { background: var(--red); }
.temp-dot.warm { background: var(--amber); }
.temp-dot.cold { background: var(--ink-3); }

/* proxima acao vencida no card */
.card-visit.venc, .card-visit.venc svg { color: var(--amber); }

/* rail: edicao inline de temperatura, proxima acao, etapa */
.rail-edit { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.rail-edit .edit-row { display: flex; flex-direction: column; gap: 6px; }
.rail-edit .ek { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.temp-switch .seg { display: flex; align-items: center; justify-content: center; gap: 5px; }
.edit-date, .edit-etapa {
  font: inherit; font-size: 12.5px; color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px;
  background: var(--paper); width: 100%;
  transition: border-color .16s var(--ease-smooth);
}
.edit-date { font-family: var(--font-mono); font-size: 12px; }
.edit-etapa { appearance: none; cursor: pointer; }
.edit-date:focus, .edit-etapa:focus { outline: none; border-color: #C9D5F8; }
.field-row .v.mono { font-family: var(--font-mono); font-size: 12px; }

/* revisao: botao Resolver + saida da linha resolvida */
.queue-row.done { opacity: 0; transform: translateX(14px); }
.resolver {
  font-size: 12px; color: var(--ink-2); flex: none;
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px;
  transition: border-color .16s var(--ease-smooth), color .16s var(--ease-smooth), background .16s var(--ease-smooth);
}
.resolver:hover { border-color: #D5D9E2; color: var(--ink); background: var(--paper-2); }

/* meta linha do card: canal + confianca em mono */
.card-meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }
.card-meta .conf { color: var(--ink-2); }

/* welcome / inicio */
.welcome { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; }
.welcome .big { font-family: var(--font-ui); font-size: 26px; font-weight: 600; letter-spacing: -.02em; margin-bottom: 8px; }
.welcome .lead { color: var(--ink-2); font-size: 14px; max-width: 440px; line-height: 1.55; }
.welcome .hint { margin-top: 20px; font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); border: 1px dashed var(--line); border-radius: 10px; padding: 10px 14px; }

/* ============================================================
   MOTION LAYER  (transitions.dev tokens, INSPIRA-calm)
   ============================================================ */
:root {
  --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.5, 1);
  --stagger: 42ms;
}

/* page-load + render staggered reveal: blurred rise */
@keyframes revealRise { from { opacity: 0; transform: translateY(12px); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }
.stagger > * { animation: revealRise .5s var(--ease-smooth) backwards; animation-delay: calc(var(--i, 0) * var(--stagger)); }

/* nav sliding pill: glides behind the active item */
.nav { position: relative; }
.nav-pill { position: absolute; left: 0; right: 0; height: 32px; border-radius: 8px; background: var(--paper); border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(16,19,26,.04); transform: translateY(var(--pill-y, 0)); opacity: 0; transition: transform .34s var(--ease-smooth), opacity .2s var(--ease-smooth); pointer-events: none; z-index: 0; }
.nav-pill.on { opacity: 1; }
.nav-item { position: relative; z-index: 1; background: transparent !important; border-color: transparent !important; transition: color .22s var(--ease-smooth); }
.nav-item.active { color: var(--ink); font-weight: 500; }
.nav-item.active svg { color: var(--ink); }
.nav-item:hover { color: var(--ink); }
.nav-item:hover svg { color: var(--ink-2); }

/* metric value: number pop-in on change */
.metric .value { position: relative; display: inline-block; }
.metric .value.pop { animation: numPop .5s var(--ease-smooth); }
@keyframes numPop { 0% { opacity: 0; transform: translateY(9px); filter: blur(2px); } 60% { opacity: 1; } 100% { transform: none; filter: none; } }
.metric { transition: border-color .2s var(--ease-smooth), box-shadow .24s var(--ease-smooth); }
.metric:hover { border-color: #DDE1EA; box-shadow: 0 2px 10px rgba(16,19,26,.04); }

/* card: refined lift on hover, spring press */
.card { transition: border-color .18s var(--ease-smooth), box-shadow .24s var(--ease-smooth), transform .24s var(--ease-smooth); will-change: transform; }
.card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(16,19,26,.08); border-color: #D5D9E2; }
.card:active { transform: translateY(0) scale(.994); transition-duration: .1s; }
.avatar { transition: transform .3s var(--ease-spring); }
.card:hover .avatar { transform: scale(1.06) rotate(-2deg); }

/* board card cascade (per render): rise + edge fill */
.card.pop { animation: cardPop .52s var(--ease-smooth) backwards; animation-delay: calc(var(--i, 0) * var(--stagger)); }
@keyframes cardPop { 0% { opacity: 0; transform: translateY(14px) scale(.98); filter: blur(2px); } 100% { opacity: 1; transform: none; filter: none; } }

/* column header + empty */
.column-head { animation: revealRise .44s var(--ease-smooth) backwards; animation-delay: calc(var(--col, 0) * 60ms); }

/* queue / feed rows cascade */
.queue-row.pop, .activity-row.pop { animation: cardPop .48s var(--ease-smooth) backwards; animation-delay: calc(var(--i, 0) * var(--stagger)); }
.queue-row { transition: opacity .34s var(--ease-smooth), transform .34s var(--ease-smooth), border-color .18s var(--ease-smooth), box-shadow .24s var(--ease-smooth); }
.queue-row:hover { transform: translateX(3px); border-color: #D5D9E2; box-shadow: 0 4px 14px rgba(16,19,26,.05); }

/* metric value color flash keeps working; add smooth */
.metric .value.bump { color: var(--blue); transition: color .4s var(--ease-smooth); }

/* segmented profile: sliding highlight */
.profile-switch .seg { transition: color .2s var(--ease-smooth); }
.profile-switch .seg.active { transition: background .28s var(--ease-smooth), color .2s var(--ease-smooth); }


/* skeleton shimmer for first load */
.skel { border: 1px solid var(--line); border-radius: 12px; height: 92px; position: relative; overflow: hidden; background: var(--paper-2); }
.skel::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent); animation: shimmer 1.4s linear infinite; }
@media (prefers-color-scheme: dark) { .skel::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent); } }
@keyframes shimmer { to { transform: translateX(100%); } }
.skel-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 16px 20px; }
.skel-col { display: flex; flex-direction: column; gap: 10px; }

/* View Transitions API: smooth cross-fade between views + shared rail morph */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .34s; animation-timing-function: var(--ease-smooth); }
::view-transition-group(rail-avatar) { animation-duration: .42s; animation-timing-function: var(--ease-smooth); }

/* rail slides with smoother easing */
.rail { animation: railin .34s var(--ease-smooth); }

@media (prefers-reduced-motion: reduce) {
  .stagger > *, .card.pop, .queue-row.pop, .activity-row.pop, .column-head, .metric .value.pop { animation: none !important; }
  .card:hover, .queue-row:hover { transform: none !important; }
  .card:hover .avatar { transform: none !important; }
  .nav-pill { transition: none !important; }
  ::view-transition-old(root), ::view-transition-new(root), ::view-transition-group(rail-avatar) { animation-duration: .001s !important; }
}

/* element-level staggered rise (nav items, metric cards) */
.rise { animation: revealRise .5s var(--ease-smooth) backwards; animation-delay: calc(var(--i, 0) * var(--stagger)); }
@media (prefers-reduced-motion: reduce) { .rise { animation: none !important; } }

/* ============================================================
   DRAG AND DROP  (hold a lead, drop into a column)
   ============================================================ */
.card.draggable { cursor: grab; touch-action: none; }
.card.draggable:active { cursor: grabbing; }
.column { transition: background .22s var(--ease-smooth); border-radius: 12px; }
.column-body { min-height: 40px; }
.board.is-dragging { user-select: none; }
/* durante o arrasto o FLIP inline e dono do transform dos vizinhos; hover fica quieto */
.board.is-dragging .card:not(.dragging) { will-change: transform; }
.board.is-dragging .card:hover { transform: none; box-shadow: none; }

/* the lifted card, fixed to the pointer */
.card.dragging {
  position: fixed; z-index: 200; margin: 0; pointer-events: none;
  border-color: var(--blue);
  box-shadow: 0 24px 60px rgba(16,19,26,.24), 0 0 0 1px rgba(18,56,200,.12);
  transition: none; will-change: transform; cursor: grabbing;
}
.card.dragging .avatar { transform: none; }

/* the dashed slot showing where it will land */
.card-ph {
  border: 1.5px dashed #B9C6F2; background: var(--blue-soft);
  border-radius: 12px; opacity: 0; animation: phIn .18s var(--ease-smooth) forwards;
}
@keyframes phIn { to { opacity: .7; } }

/* column that will receive the drop */
.column.drop-target { background: rgba(18,56,200,.045); }
.column.drop-target .column-head .name { color: var(--blue); transition: color .2s var(--ease-smooth); }

/* card landing after drop */
.card.landed { animation: landRing .7s var(--ease-smooth); }
@keyframes landRing { 0% { box-shadow: 0 0 0 2px var(--blue); } 100% { box-shadow: 0 0 0 2px rgba(18,56,200,0); } }

@media (prefers-reduced-motion: reduce) {
  .board.is-dragging .card:not(.dragging), .card-ph { transition: none !important; animation: none !important; }
  .card-ph { opacity: .7; }
  .card.landed { animation: none !important; }
}

/* ============================================================
   SIDEBAR RECOLHIVEL (navmin): fecha em 64px, abre no mouse
   ============================================================ */
/* abre como overlay: width cresce e a margem negativa compensa, entao o main
   nunca reflui (o board nao pisca quando o mouse passa na borda). Delay curto
   no fechar evita bater-e-fechar ao raspar a borda (hover intent). */
.shell.navmin .sidebar {
  width: 64px; margin-right: 0;
  z-index: 60;
  transition: width .3s var(--ease-smooth) .18s, margin-right .3s var(--ease-smooth) .18s, box-shadow .3s var(--ease-smooth) .18s;
}
.shell.navmin .sidebar:hover, .shell.navmin .sidebar:focus-within {
  width: 248px; margin-right: -184px;
  box-shadow: 14px 0 36px rgba(16, 19, 26, .1);
  transition-delay: .06s;
}
/* colapsado: os rotulos saem do fluxo (display:none), nao so opacity. Se ficam
   no fluxo, empurram a linha e o centralizar joga o icone para fora do trilho.
   Com eles fora, cada linha centra um unico icone no trilho de 64px. */
.shell.navmin .sidebar:not(:hover):not(:focus-within) .workspace-name,
.shell.navmin .sidebar:not(:hover):not(:focus-within) .quick-actions span,
.shell.navmin .sidebar:not(:hover):not(:focus-within) .quick-actions kbd,
.shell.navmin .sidebar:not(:hover):not(:focus-within) .section-label,
.shell.navmin .sidebar:not(:hover):not(:focus-within) .chev,
.shell.navmin .sidebar:not(:hover):not(:focus-within) .nav-badge,
.shell.navmin .sidebar:not(:hover):not(:focus-within) .profile-switch,
.shell.navmin .sidebar:not(:hover):not(:focus-within) .nav-item span {
  display: none;
}
.shell.navmin .sidebar:not(:hover):not(:focus-within) .workspace,
.shell.navmin .sidebar:not(:hover):not(:focus-within) .quick-actions,
.shell.navmin .sidebar:not(:hover):not(:focus-within) .nav-item { justify-content: center; }
.shell.navmin .sidebar:not(:hover):not(:focus-within) .quick-actions { padding: 6px 0; }
.shell.navmin .sidebar:not(:hover):not(:focus-within) .quick-row { justify-content: center; }
/* rotulos reaparecem suaves ao abrir */
.shell.navmin .sidebar:hover .nav-item span, .shell.navmin .sidebar:hover .workspace-name,
.shell.navmin .sidebar:focus-within .nav-item span, .shell.navmin .sidebar:focus-within .workspace-name {
  animation: revealRise .28s var(--ease-smooth) both;
}
.shell.navmin .nav-item, .shell.navmin .workspace { white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  .shell.navmin .sidebar, .shell.navmin .sidebar *, .shell.navmin .sidebar *::before { transition: none !important; animation: none !important; }
}

/* acoes da notificacao de e-mail sem lead (fila de revisao) */
.email-acoes { display: flex; align-items: center; gap: 7px; flex: none; }
.email-acoes select {
  font: inherit; font-size: 12px; color: var(--ink-2);
  border: 1px solid var(--line); border-radius: 7px; background: var(--paper);
  padding: 4px 7px; max-width: 132px;
  transition: border-color .16s var(--ease-smooth);
}
.email-acoes select:hover, .email-acoes select:focus { border-color: #C9D5F8; outline: none; }
.email-acoes .btn-add {
  font-size: 12px; border: 1px solid #C9D5F8; color: var(--blue); background: var(--blue-soft);
  border-radius: 7px; padding: 4px 10px;
  transition: background .16s var(--ease-smooth), color .16s var(--ease-smooth);
}
.email-acoes .btn-add:hover { background: var(--blue); color: #fff; }
.email-acoes .ou { font-size: 11px; color: var(--ink-3); }
.queue-row.has-acoes { flex-wrap: wrap; }
@media (max-width: 900px) { .email-acoes { flex-basis: 100%; } }

/* perfil do lead */
.quick-actions { cursor: pointer; }
.quick-actions:hover { border-color: #D5D9E2; color: var(--ink); }
.rail-perfil {
  display: block; width: 100%; margin-top: 12px;
  border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 10px; font-size: 12.5px; color: var(--ink-2);
  background: var(--paper); text-align: center;
  transition: border-color .16s var(--ease), color .16s var(--ease);
}
.rail-perfil:hover { border-color: #D5D9E2; color: var(--ink); }
.perfil { flex: 1; overflow-y: auto; padding: 16px 20px 28px; }
.perfil-back {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--line); border-radius: 8px;
  padding: 5px 11px 5px 7px; font-size: 12.5px; color: var(--ink-2);
  background: var(--paper); margin-bottom: 14px;
  transition: border-color .16s var(--ease), color .16s var(--ease);
}
.perfil-back:hover { border-color: #D5D9E2; color: var(--ink); }
.perfil-back svg { width: 14px; height: 14px; }
.perfil-grid { display: grid; grid-template-columns: 312px minmax(0, 1fr); gap: 20px; max-width: 1040px; align-items: start; }
.perfil-card { border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.perfil-card .avatar.perfil-avatar { width: 44px; height: 44px; font-size: 15px; }
.perfil-atv > .label {
  font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 4px;
}
.atv-row {
  display: flex; align-items: baseline; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.atv-row:last-child { border-bottom: none; }
.atv-tag { flex: none; width: 58px; font-size: 11px; color: var(--ink-3); }
.atv-body { flex: 1; min-width: 0; }
.atv-title { font-family: var(--font-ui); font-weight: 600; font-size: 13px; letter-spacing: -.01em; overflow-wrap: anywhere; }
.atv-title a { color: var(--blue); text-decoration: none; }
.atv-title a:hover { text-decoration: underline; }
.atv-text { font-size: 12.5px; color: var(--ink-2); margin-top: 1px; line-height: 1.45; overflow-wrap: anywhere; }
.atv-row .when { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); flex: none; }
.atv-vazio { font-size: 12.5px; color: var(--ink-3); padding: 10px 0; }
.nota-box textarea {
  width: 100%; resize: vertical; min-height: 62px;
  border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; font: inherit; font-size: 12.5px; color: var(--ink);
  background: var(--paper); outline: none;
}
.nota-box textarea:focus { border-color: var(--blue); }
.nota-add {
  margin-top: 8px; border-radius: 8px; padding: 6px 12px;
  background: var(--blue); color: #fff; font-size: 12.5px; font-weight: 500;
}
.nota-add:disabled { opacity: .55; cursor: default; }

/* busca (cmd+K) */
.cmdk {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(16, 19, 26, .28);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 14vh;
  animation: cmdkfade .18s var(--ease);
}
@keyframes cmdkfade { from { opacity: 0; } to { opacity: 1; } }
.cmdk-box {
  width: min(92vw, 520px);
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 16px 48px rgba(16, 19, 26, .18);
  overflow: hidden;
  animation: rowdrop .22s var(--ease);
}
.cmdk-box input {
  width: 100%; border: none; outline: none;
  padding: 13px 16px; font: inherit; font-size: 14px; color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.cmdk-list { max-height: 320px; overflow-y: auto; padding: 6px; }
.cmdk-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
}
.cmdk-row:hover, .cmdk-row.sel { background: var(--paper-2); }
.cmdk-row .who { flex: 1; min-width: 0; }
.cmdk-row .etapa { font-size: 11px; color: var(--ink-3); flex: none; }
.cmdk-vazio { font-size: 12.5px; color: var(--ink-3); padding: 12px 10px; }

@media (max-width: 900px) {
  .perfil-grid { grid-template-columns: 1fr; }
}
