/* =========================================================
   Pulso — Contatos, perfil, listas, segmentos e tags (.ct-)
   ========================================================= */

/* ---------- Lista de contatos ---------- */
.ct-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ct-search { flex: 1 1 260px; min-width: 200px; }
.ct-sel { width: auto; min-width: 140px; flex: 0 1 180px; }
.ct-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; }
.ct-chips .chip { background: rgba(34, 211, 238, 0.08); border-color: rgba(34, 211, 238, 0.25); color: var(--text); }

.ct-bulk {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 14px; padding: 10px 12px 10px 14px; border-radius: 18px;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(6, 182, 212, 0.06));
  border: 1px solid rgba(34, 211, 238, 0.35);
  position: sticky; top: calc(var(--topbar-h) + 10px); z-index: 6;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 14px 30px -18px rgba(6, 182, 212, 0.7);
  animation: rise 0.3s var(--ease) both;
}
.ct-bulk-count { min-width: 28px; height: 28px; padding: 0 9px; border-radius: 99px; background: var(--cyan); color: #fff; display: inline-grid; place-items: center; font-weight: 600; font-size: 12px; font-variant-numeric: tabular-nums; }
.ct-bulk button.link { background: none; border: 0; cursor: pointer; }

.ct-table-wrap { margin-top: 14px; }
.ct-table td { padding-top: 10px; padding-bottom: 10px; }
.ct-who { min-width: 0; max-width: 260px; }
.ct-who .iconify { font-size: 13px; vertical-align: -2px; }
.ct-score { display: flex; align-items: center; gap: 8px; min-width: 92px; }
.ct-score .tnum { width: 22px; font-weight: 600; font-size: 12px; }
.ct-score .progress { flex: 1; height: 5px; max-width: 64px; }
.ct-tags { display: flex; gap: 4px; flex-wrap: nowrap; }
.ct-tag {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 99px;
  font-size: 11px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); color: var(--text-2); white-space: nowrap;
}
.ct-tag .dot { width: 6px; height: 6px; }
.ct-tag-more { color: var(--muted); }
.ct-sort { display: inline-flex; vertical-align: -2px; margin-left: 4px; opacity: 0.45; font-size: 12px; }
.table th.is-sorted { color: var(--text); }
.table th.is-sorted .ct-sort { opacity: 1; color: var(--cyan-2); }
@media (max-width: 1180px) { .ct-hide-md { display: none; } }
@media (max-width: 760px) {
  .ct-search { flex-basis: 100%; }
  .ct-sel { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .ct-bulk { top: calc(var(--topbar-h) + 6px); }
}
@media (max-width: 560px) { .ct-hide-xs { display: none; } .ct-who { max-width: 170px; } }

/* ---------- Escolha (tag/lista) ---------- */
.ct-pick { display: flex; flex-direction: column; gap: 4px; max-height: 300px; overflow-y: auto; margin: 0 -6px; padding: 0 6px; }
.ct-pick-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid transparent; cursor: pointer; font-size: 13px; transition: background 0.15s, border-color 0.15s; }
.ct-pick-item:hover { background: rgba(255, 255, 255, 0.05); }
.ct-pick-item input { position: absolute; opacity: 0; pointer-events: none; }
.ct-pick-item:has(input:checked) { background: rgba(34, 211, 238, 0.1); border-color: rgba(34, 211, 238, 0.35); }

/* Seleção de tags/listas em formulários */
.ct-tagpicks { display: flex; flex-wrap: wrap; gap: 6px; }
.ct-tagpick { position: relative; cursor: pointer; }
.ct-tagpick input { position: absolute; opacity: 0; pointer-events: none; }
.ct-tagpick span {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 99px; font-size: 12px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line-2); color: var(--muted); transition: all 0.15s;
}
.ct-tagpick span .dot { width: 7px; height: 7px; }
.ct-tagpick:hover span { color: var(--text); border-color: rgba(255, 255, 255, 0.25); }
.ct-tagpick input:checked + span { background: rgba(34, 211, 238, 0.12); border-color: rgba(34, 211, 238, 0.5); color: var(--text); }
.ct-tagpick input:focus-visible + span { outline: 2px solid var(--cyan-2); outline-offset: 2px; }
.ct-switch-row { cursor: pointer; align-items: flex-start; }
.ct-switch-row .switch { margin-top: 2px; }

/* ---------- Importação ---------- */
.ct-imp-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; flex-wrap: wrap; }
.ct-drop {
  display: flex; flex-direction: column; align-items: center; text-align: center; padding: 30px 20px; border-radius: 20px; cursor: pointer;
  border: 1.5px dashed rgba(255, 255, 255, 0.18); background: radial-gradient(circle at 50% 0%, rgba(56, 189, 248, 0.1), transparent 70%);
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.ct-drop:hover, .ct-drop.is-over { border-color: var(--sky-2); background: radial-gradient(circle at 50% 0%, rgba(56, 189, 248, 0.2), transparent 70%); }
.ct-drop.is-over { transform: scale(1.01); }
.ct-file-name { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 99px; font-size: 12px; background: rgba(16, 185, 129, 0.14); color: var(--emerald-2); border: 1px solid rgba(52, 211, 153, 0.3); }
.ct-paste { font-size: 12px; line-height: 1.6; }
.ct-map td { vertical-align: middle; }
.ct-map .select { min-width: 170px; }
.ct-samples { line-height: 1.6; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-imp-sum .tone, .ct-imp-sum .card { min-height: 108px; }
@media (max-width: 760px) { .ct-imp-sum { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; } .ct-imp-sum .big-num { font-size: 22px; } .ct-imp-sum .card-pad, .ct-imp-sum .tone { padding: 14px; } }
@media (max-width: 420px) { .ct-imp-sum { grid-template-columns: minmax(0, 1fr); } .ct-imp-sum .tone, .ct-imp-sum .card { min-height: 0; } }

/* ---------- Perfil 360º ---------- */
.ct-hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; overflow: hidden; }
.ct-hero::after { content: ""; position: absolute; right: -120px; top: -120px; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, rgba(34, 211, 238, 0.14), transparent 70%); pointer-events: none; z-index: -1; }
.ct-hero-main { display: flex; align-items: center; gap: 18px; flex: 1 1 420px; min-width: 0; }
.ct-hero-main .avatar-xl { box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.7); }
.ct-name { word-break: break-word; }
.ct-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.ct-meta > span, .ct-copy { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.ct-meta .iconify { font-size: 15px; color: var(--subtle); }
.ct-copy { color: var(--text-2); max-width: 100%; border-radius: 8px; padding: 2px 4px; margin: -2px -4px; transition: background 0.15s; }
.ct-copy:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.ct-hero-side { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.ct-ring-wrap { display: flex; align-items: center; gap: 14px; max-width: 260px; }
.ct-hero-actions { justify-content: flex-end; }

.ct-profile { display: grid; grid-template-columns: 300px minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.ct-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (max-width: 1320px) {
  .ct-profile { grid-template-columns: 290px minmax(0, 1fr); }
  .ct-col-right { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}
@media (max-width: 900px) {
  .ct-profile { grid-template-columns: minmax(0, 1fr); }
  .ct-hero-side { width: 100%; justify-content: space-between; }
}
@media (max-width: 560px) {
  .ct-hero-main { flex-direction: column; align-items: flex-start; gap: 14px; }
  .ct-hero-side { flex-direction: column; align-items: stretch; gap: 16px; }
  .ct-hero-actions { justify-content: flex-start; }
  .ct-hero-actions .btn:not(.btn-icon) { flex: 1; }
}

.ct-fields { display: flex; flex-direction: column; margin: 0 -8px; }
.ct-field { display: grid; grid-template-columns: 96px minmax(0, 1fr) 18px; align-items: center; gap: 8px; min-height: 38px; padding: 4px 8px; border-radius: 10px; cursor: pointer; transition: background 0.15s; }
.ct-field:hover:not(.is-static) { background: rgba(255, 255, 255, 0.04); }
.ct-field:focus-visible { outline: 2px solid var(--cyan-2); outline-offset: 0; }
.ct-field.is-static { cursor: default; }
.ct-field-label { font-size: 12px; color: var(--subtle); }
.ct-field-value { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ct-field-edit { color: var(--subtle); font-size: 13px; opacity: 0; transition: opacity 0.15s; }
.ct-field:hover .ct-field-edit { opacity: 1; }
.ct-field.editing { background: rgba(34, 211, 238, 0.06); cursor: default; }
.ct-field.editing .ct-field-edit { opacity: 0; }
.ct-field.editing .ct-field-value { overflow: visible; }

.ct-list-toggle { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); cursor: pointer; }
.ct-list-toggle:last-child { border-bottom: 0; }

.ct-composer .textarea { min-height: 76px; }
.ct-note { display: flex; gap: 10px; padding: 12px; border-radius: 14px; background: rgba(250, 204, 21, 0.05); border: 1px solid rgba(250, 204, 21, 0.14); }
.ct-note-text { white-space: pre-wrap; word-break: break-word; }

.ct-tl-seg { flex-wrap: wrap; }
.ct-timeline { position: relative; padding-left: 4px; }
.ct-timeline::before { content: ""; position: absolute; left: 17px; top: 8px; bottom: 8px; width: 1px; background: linear-gradient(180deg, var(--line-2), transparent); }
.ct-day { position: relative; margin: 14px 0 6px 40px; font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.12em; color: var(--subtle); }
.ct-day:first-child { margin-top: 0; }
.ct-tl-item { position: relative; display: flex; gap: 12px; padding: 8px 0; }
.ct-tl-ic { position: relative; z-index: 1; box-shadow: 0 0 0 4px #121214; }
.ct-tl-quote { padding: 8px 12px; border-left: 2px solid rgba(250, 204, 21, 0.5); background: rgba(255, 255, 255, 0.03); border-radius: 0 10px 10px 0; white-space: pre-wrap; word-break: break-word; }

.ct-ltv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, 0.2); }
.ct-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ct-mini > div { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 16px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); }
.ct-mini .big-num { font-size: 22px; }
.ct-side-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 18px 10px; border-radius: 14px; border: 1px dashed var(--line-2); }
.ct-side-empty > .iconify { font-size: 22px; color: var(--subtle); }

/* ---------- Listas ---------- */
.ct-lists { align-items: stretch; }
.ct-list-card { display: flex; flex-direction: column; }
.ct-list-card > .row:last-child { margin-top: auto; padding-top: 16px; }
.ct-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 39px; }
.ct-num-sm { font-size: 20px; }
.ct-add-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 250px; padding: 20px; text-align: center;
  border-radius: var(--r-xl); border: 1.5px dashed rgba(255, 255, 255, 0.14); color: var(--muted); transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.ct-add-card > .iconify { font-size: 30px; color: var(--cyan-2); margin-bottom: 4px; }
.ct-add-card:hover { border-color: var(--cyan-2); background: rgba(34, 211, 238, 0.05); color: var(--text); }
@media (max-width: 1180px) and (min-width: 761px) { .ct-lists { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .ct-add-card { min-height: 140px; } }

/* ---------- Segmentos ---------- */
.ct-ideas .grid { gap: 10px; }
.ct-idea {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px; border-radius: 16px; text-align: left; color: #fff;
  background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.24); transition: background 0.2s, transform 0.2s;
}
.ct-idea:hover { background: rgba(255, 255, 255, 0.2); transform: translateY(-1px); }
.ct-idea > .iconify { font-size: 14px; opacity: 0.8; margin-top: 2px; }
.ct-idea-text { display: block; color: rgba(255, 255, 255, 0.82); margin-top: 2px; line-height: 1.45; }
@media (max-width: 1180px) and (min-width: 761px) { .ct-ideas .grid { grid-template-columns: minmax(0, 1fr); } }

.ct-seg-list { padding: 6px 20px; }
.ct-seg-row { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.ct-seg-row:last-child { border-bottom: 0; }
.ct-conds { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ct-cond-chip { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 8px; font-size: 11px; background: rgba(168, 85, 247, 0.1); border: 1px solid rgba(192, 132, 252, 0.25); color: var(--text-2); }
.ct-join { font-size: 10px; font-weight: 600; letter-spacing: 0.1em; color: var(--purple-2); }
.ct-seg-count { text-align: right; min-width: 96px; }
.ct-seg-actions { flex-shrink: 0; }
@media (max-width: 760px) {
  .ct-seg-list { padding: 4px 16px; }
  .ct-seg-row { flex-wrap: wrap; gap: 12px; }
  .ct-seg-row > .grow { flex-basis: calc(100% - 52px); }
  .ct-seg-count { text-align: left; min-width: 0; flex: 1; }
}

/* Construtor de segmento */
.ct-builder { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.ct-builder-side { position: sticky; top: 0; }
.ct-match { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ct-cond {
  display: grid; grid-template-columns: 44px minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr) 30px; gap: 8px; align-items: center;
  padding: 8px; border-radius: 14px; background: rgba(255, 255, 255, 0.025); border: 1px solid var(--line); animation: rise 0.25s var(--ease) both;
}
.ct-cond-n { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--purple-2); text-align: center; }
.ct-cond-val { min-width: 0; }
.ct-suffix { display: flex; align-items: center; gap: 6px; }
.ct-suffix .input { min-width: 0; }
.ct-suffix span { font-size: 12px; color: var(--subtle); }
.ct-cond-empty { display: flex; align-items: center; gap: 8px; padding: 14px; border-radius: 14px; border: 1px dashed var(--line-2); }
.ct-shortcut { cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s; padding: 0 12px 0 10px; }
.ct-shortcut:hover { background: rgba(168, 85, 247, 0.12); border-color: rgba(192, 132, 252, 0.4); color: var(--text); }
.ct-white-bar { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.2); overflow: hidden; }
.ct-white-bar span { display: block; height: 100%; border-radius: inherit; background: #fff; transition: width 0.5s var(--ease); }
@media (max-width: 900px) {
  .ct-builder { grid-template-columns: minmax(0, 1fr); }
  .ct-builder-side { position: static; }
}
@media (max-width: 640px) {
  .ct-cond { grid-template-columns: 36px minmax(0, 1fr) 30px; }
  .ct-cond > [data-k="field"] { grid-column: 2; }
  .ct-cond > [data-k="op"] { grid-column: 2; grid-row: 2; }
  .ct-cond > .ct-cond-val { grid-column: 2; grid-row: 3; }
  .ct-cond > [data-rm] { grid-column: 3; grid-row: 1; }
}

/* ---------- Tags ---------- */
.ct-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.ct-swatch { position: relative; cursor: pointer; }
.ct-swatch input { position: absolute; opacity: 0; pointer-events: none; }
.ct-swatch span { display: block; width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.25); transition: transform 0.15s; }
.ct-swatch:hover span { transform: scale(1.1); }
.ct-swatch input:checked + span { border-color: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15); }
.ct-swatch input:focus-visible + span { outline: 2px solid var(--cyan-2); outline-offset: 2px; }
.ct-color-btn { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 10px; border-radius: 99px; font-size: 12px; color: var(--text-2); border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); transition: background 0.15s; }
.ct-color-btn:hover { background: rgba(255, 255, 255, 0.07); }
