/* ============================================================
   contatos.css — namespace .ctn-*
   ============================================================ */

.ctn-page { display:flex; flex-direction:column; gap:14px; padding:8px 0; }

.ctn-loading, .ctn-empty, .ctn-empty-sm, .ctn-error {
  padding:32px 16px; text-align:center; color:var(--cf-text-3, #64748b); font-size:13px;
}
.ctn-error { color:#dc2626; }
.ctn-empty-sm { padding:16px; }

.ctn-empty {
  padding:48px 24px; background:#f8fafc; border-radius:12px;
  border:2px dashed var(--cf-border, #e2e8f0);
  display:flex; flex-direction:column; gap:8px; align-items:center;
}
.ctn-empty-icon { display:inline-flex; align-items:center; justify-content:center; width:56px; height:56px; border-radius:50%; background:#f1f5f9; }
.ctn-empty-title { font-size:16px; font-weight:600; color:var(--cf-text, #0f172a); }
.ctn-empty-msg { font-size:13px; color:var(--cf-text-3, #64748b); }

/* head */
.ctn-head {
  display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap;
  padding:14px; background:#fff; border:1px solid var(--cf-border, #e2e8f0); border-radius:10px;
}
.ctn-head-left { flex:1; }
.ctn-head-right { display:flex; gap:8px; }
.ctn-search {
  width:100%; max-width:480px; padding:8px 12px;
  border:1px solid var(--cf-border, #e2e8f0); border-radius:8px;
  font-size:13px;
}

/* stats */
.ctn-stats { display:flex; gap:12px; }
.ctn-stat { display:flex; flex-direction:column; padding:10px 14px; background:#fff; border:1px solid var(--cf-border, #e2e8f0); border-radius:8px; }
.ctn-stat strong { font-size:18px; color:var(--cf-text, #0f172a); font-family:'IBM Plex Sans', sans-serif; }
.ctn-stat span { font-size:11px; color:var(--cf-text-3, #64748b); }

/* filters chips */
.ctn-filters-applied { display:flex; gap:6px; flex-wrap:wrap; }
.ctn-chip {
  display:inline-flex; align-items:center; gap:4px;
  padding:3px 10px; background:#dbeafe; color:#1e3a8a;
  border-radius:14px; font-size:12px;
}
.ctn-chip button { background:none; border:none; cursor:pointer; color:#1e3a8a; font-weight:bold; }

/* list */
.ctn-list-wrap { background:#fff; border:1px solid var(--cf-border, #e2e8f0); border-radius:10px; overflow:hidden; }
.ctn-list-head, .ctn-row {
  display:grid;
  grid-template-columns: 40px 2fr 1.5fr 1.2fr 1.5fr 1fr;
  gap:12px; padding:10px 12px; align-items:center; font-size:13px;
}
.ctn-list-head {
  background:#f8fafc; border-bottom:1px solid var(--cf-border, #e2e8f0);
  font-size:10px; font-weight:600; color:var(--cf-text-3, #64748b);
  text-transform:uppercase; letter-spacing:0.5px;
}
.ctn-row { border-bottom:1px solid #f1f5f9; cursor:pointer; }
.ctn-row:hover { background:#f8fafc; }
.ctn-row:last-child { border-bottom:none; }

.ctn-checkbox-cell { display:flex; align-items:center; justify-content:center; }
.ctn-checkbox-cell input { width:16px; height:16px; cursor:pointer; }

.ctn-row-name { display:flex; gap:10px; align-items:center; }
.ctn-avatar {
  width:32px; height:32px; border-radius:50%;
  background:var(--cf-brand, #1E5BAA); color:#fff;
  display:flex; align-items:center; justify-content:center;
  font-size:11px; font-weight:600; flex-shrink:0;
}
.ctn-name { font-weight:500; color:var(--cf-text, #0f172a); }
.ctn-meta { font-size:11px; color:var(--cf-text-3, #94a3b8); }

.ctn-row-tags { display:flex; gap:4px; flex-wrap:wrap; align-items:center; }
.ctn-tag-pill { padding:2px 8px; border-radius:10px; font-size:10px; font-weight:500; }

/* foot */
.ctn-foot {
  display:flex; justify-content:space-between; align-items:center;
  padding:12px; font-size:12px; color:var(--cf-text-3, #64748b);
}
.ctn-pagination { display:flex; gap:8px; align-items:center; }

/* buttons */
.ctn-btn-primary {
  background:var(--cf-brand, #1E5BAA); color:#fff; border:none;
  padding:8px 14px; border-radius:6px; font-size:13px; font-weight:500;
  cursor:pointer;
}
.ctn-btn-sm { padding:6px 12px; font-size:12px; }
.ctn-btn-ghost {
  background:transparent; color:var(--cf-text-2, #475569);
  border:1px solid var(--cf-border, #e2e8f0);
  padding:8px 14px; border-radius:6px; font-size:13px; cursor:pointer;
}
.ctn-btn-ghost-sm {
  background:transparent; color:var(--cf-text-2, #475569);
  border:1px solid var(--cf-border, #e2e8f0);
  padding:5px 10px; border-radius:5px; font-size:12px; cursor:pointer;
}
.ctn-btn-ghost-sm:hover { background:#f1f5f9; }
.ctn-btn-ghost:hover { background:#f1f5f9; }

/* form */
.ctn-form { display:flex; flex-direction:column; gap:12px; }
.ctn-grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
@media (max-width:720px) { .ctn-grid-2 { grid-template-columns:1fr; } }
.ctn-label { display:flex; flex-direction:column; gap:6px; font-size:13px; font-weight:500; color:var(--cf-text-2, #475569); }
.ctn-input {
  width:100%; padding:9px 12px;
  border:1px solid var(--cf-border, #e2e8f0); border-radius:7px;
  font-size:13px; background:#fff;
}
.ctn-input:focus { outline:none; border-color:var(--cf-brand, #1E5BAA); box-shadow: 0 0 0 3px rgba(30,91,170,.12); }
.ctn-input-sm { padding:6px 10px; font-size:12px; }
.ctn-textarea { resize:vertical; min-height:60px; font-family:inherit; }
.ctn-toggle { display:inline-flex; gap:6px; align-items:center; cursor:pointer; }

/* tab content */
.ctn-tab { display:flex; flex-direction:column; gap:14px; }
.ctn-section { padding:14px; background:#f8fafc; border-radius:8px; display:flex; flex-direction:column; gap:10px; }
.ctn-section-head { display:flex; justify-content:space-between; align-items:center; }
.ctn-section-head strong { font-size:13px; color:var(--cf-text, #0f172a); }

/* list inside tab */
.ctn-list { list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:6px; }
.ctn-list-item {
  display:flex; justify-content:space-between; gap:12px;
  padding:10px 12px; background:#fff; border-radius:6px;
}
.ctn-list-item-link { cursor:pointer; transition: border-color .12s; }
.ctn-list-item-link:hover { background:#f0f9ff; }
.ctn-list-meta { font-size:11px; color:var(--cf-text-3, #94a3b8); margin-top:2px; }

/* timeline */
.ctn-timeline { display:flex; flex-direction:column; gap:8px; }
.ctn-tl-item {
  display:grid; grid-template-columns: 32px 1fr; gap:10px;
  padding:10px; background:#fff; border-radius:6px;
}
.ctn-tl-icon {
  width:32px; height:32px; border-radius:50%; background:#f1f5f9;
  display:flex; align-items:center; justify-content:center; font-size:14px;
}
.ctn-tl-title { font-size:13px; font-weight:500; }
.ctn-tl-meta { font-size:12px; color:var(--cf-text-2, #475569); margin-top:2px; }
.ctn-tl-time { font-size:11px; color:var(--cf-text-3, #94a3b8); margin-top:4px; }

/* bulk bar */
.ctn-bulk-bar {
  position:fixed; bottom:24px; left:50%; transform:translateX(-50%);
  display:flex; gap:14px; align-items:center;
  background:#0f172a; color:#fff;
  padding:12px 20px; border-radius:50px;
  box-shadow: 0 10px 40px rgba(0,0,0,.25);
  z-index:1000;
  animation: bulkBarIn .25s ease-out;
}
@keyframes bulkBarIn {
  from { transform: translateX(-50%) translateY(20px); opacity:0; }
  to { transform: translateX(-50%); opacity:1; }
}
.ctn-bulk-close {
  background:rgba(255,255,255,.1); color:#fff; border:none;
  width:24px; height:24px; border-radius:50%; cursor:pointer;
  font-size:14px;
}
.ctn-bulk-count { font-size:13px; padding:0 8px; border-right:1px solid rgba(255,255,255,.2); }
.ctn-bulk-count strong { font-size:16px; }
.ctn-bulk-actions { display:flex; gap:6px; }
.ctn-bulk-btn {
  background:rgba(255,255,255,.1); color:#fff; border:none;
  padding:6px 12px; border-radius:6px; font-size:12px; cursor:pointer;
}
.ctn-bulk-btn:hover { background:rgba(255,255,255,.2); }
.ctn-bulk-btn-danger { background:rgba(220,38,38,.6); }
.ctn-bulk-btn-danger:hover { background:rgba(220,38,38,.9); }

.ctn-drawer-content { padding:0; }

/* Sessao 135: lista de arquivos do contato (cf_contact_history kind=file_uploaded) */
.ctn-files-list { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:6px; }
.ctn-file-row {
  display:flex; align-items:center; gap:10px;
  padding:8px 10px;
  background:#f8fafc;
  border-radius:8px;
}
.ctn-file-row:hover { background:#f1f5f9; }
.ctn-file-thumb {
  width:40px; height:40px; flex-shrink:0;
  border-radius:6px; overflow:hidden;
  display:flex; align-items:center; justify-content:center;
  background:#e2e8f0;
}
.ctn-file-thumb img { width:100%; height:100%; object-fit:cover; cursor:zoom-in; }
.ctn-file-thumb-icon { background:#fff; border:1px solid #e2e8f0; }
.ctn-file-meta { flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
.ctn-file-name {
  color:#0F172A; font-size:13px; font-weight:600;
  text-decoration:none;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.ctn-file-name:hover { color:#1E5BAA; text-decoration:underline; }
.ctn-file-meta small { font-size:11px; color:#64748b; }
.ctn-file-unlink {
  opacity:0; transition: opacity 120ms;
}
.ctn-file-row:hover .ctn-file-unlink { opacity:1; }
.ctn-file-unlink:hover { background:#fee2e2; color:#dc2626; }
