/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
  --teal:      #0D9488;
  --teal-d:    #0f766e;
  --teal-l:    #ccfbf1;
  --teal-xl:   #f0fdfa;
  --mag:       #E91E8C;
  --mag-l:     #fce7f3;
  --bg:        #f1f5f9;
  --surface:   #ffffff;
  --surface-2: #f8fafc;
  --border:    #e2e8f0;
  --border-2:  #cbd5e1;
  --text:      #1e293b;
  --text-2:    #334155;
  --muted:     #64748b;
  --muted-l:   #94a3b8;
  --sidebar-bg:   #1e293b;
  --sidebar-text: #e2e8f0;
  --sidebar-muted:#94a3b8;
  --radius:    8px;
  --radius-lg: 12px;
  --shadow:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,.12);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.16);
  --sidebar-w: 224px;
  --topbar-h:  56px;
}

/* ── Reset ──────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-size: 14px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  overflow: hidden;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted-l); }

/* ── Sidebar ─────────────────────────────────────────────────────────────────*/
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  transition: width .25s, min-width .25s;
  overflow: hidden;
  z-index: 100;
}
.sidebar.collapsed { width: 60px; min-width: 60px; }
.sidebar.collapsed .sidebar-name,
.sidebar.collapsed .nav-section,
.sidebar.collapsed .user-info,
.sidebar.collapsed .btn-logout { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 10px; }

.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 16px; border-bottom: 1px solid rgba(255,255,255,.07);
}
.sidebar-logo {
  width: 36px; height: 36px; min-width: 36px;
  background: var(--teal); border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; color: #fff;
}
.sidebar-name {
  font-size: 15px; font-weight: 700; color: #fff;
  white-space: nowrap;
}
.sidebar-name span { color: var(--teal); }

.sidebar-nav { flex: 1; padding: 12px 8px; overflow-y: auto; }
.nav-section {
  font-size: 10px; font-weight: 700; letter-spacing: 1px;
  color: var(--sidebar-muted); padding: 16px 8px 6px;
  text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius);
  color: var(--sidebar-text); font-size: 13.5px; font-weight: 500;
  transition: background .15s, color .15s; white-space: nowrap;
  margin-bottom: 2px;
}
.nav-item:hover    { background: rgba(255,255,255,.07); }
.nav-item.active   { background: var(--teal); color: #fff; }
.nav-icon { font-size: 16px; min-width: 20px; text-align: center; }

.sidebar-footer {
  padding: 12px; border-top: 1px solid rgba(255,255,255,.07);
  display: flex; align-items: center; gap: 8px;
}
.user-chip { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.user-avatar {
  width: 32px; height: 32px; min-width: 32px; border-radius: 50%;
  background: var(--teal); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
}
.user-info { min-width: 0; }
.user-name { font-size: 12px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--sidebar-muted); text-transform: capitalize; }
.btn-logout {
  background: none; border: none; color: var(--sidebar-muted);
  font-size: 18px; padding: 4px; border-radius: 6px;
  transition: color .15s, background .15s;
}
.btn-logout:hover { color: #ef4444; background: rgba(239,68,68,.1); }

/* ── Main ────────────────────────────────────────────────────────────────────*/
.main-wrapper {
  flex: 1; display: flex; flex-direction: column;
  height: 100vh; overflow: hidden; min-width: 0;
}
.main-content {
  flex: 1; overflow: auto; padding: 0;
}

/* ── Topbar ──────────────────────────────────────────────────────────────────*/
.topbar {
  height: var(--topbar-h); background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; padding: 0 16px;
  flex-shrink: 0; position: sticky; top: 0; z-index: 50;
}
.topbar-toggle {
  background: none; border: none; font-size: 20px; color: var(--muted);
  padding: 4px 8px; border-radius: var(--radius);
}
.topbar-toggle:hover { background: var(--bg); }

.topbar-view-switch {
  display: flex; background: var(--bg); border-radius: var(--radius);
  padding: 3px; gap: 2px;
}
.view-btn {
  background: none; border: none; padding: 5px 10px;
  border-radius: 6px; font-size: 16px; color: var(--muted);
  transition: background .15s, color .15s;
}
.view-btn.active { background: var(--surface); color: var(--teal); box-shadow: var(--shadow); }

.topbar-filters {
  display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0;
}
.filter-select {
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 6px 10px; font-size: 12.5px;
  color: var(--text); outline: none; cursor: pointer; height: 34px;
}
.filter-select:focus { border-color: var(--teal); }
.search-box { position: relative; flex: 1; max-width: 220px; }
.search-box input {
  width: 100%; padding: 6px 10px 6px 32px;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  background: var(--bg); font-size: 12.5px; height: 34px; outline: none;
}
.search-box input:focus { border-color: var(--teal); background: #fff; }
.search-icon { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); font-size: 13px; }

.btn-new-lead {
  background: var(--teal); color: #fff; border: none;
  padding: 8px 16px; border-radius: var(--radius);
  font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: background .15s;
}
.btn-new-lead:hover { background: var(--teal-d); }

/* ── Kanban ──────────────────────────────────────────────────────────────────*/
.kanban-board {
  display: flex; gap: 12px;
  padding: 20px; height: 100%;
  overflow-x: auto; overflow-y: hidden;
  align-items: flex-start;
}
.kanban-column {
  min-width: 240px; max-width: 240px; display: flex;
  flex-direction: column; background: var(--surface);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  max-height: calc(100vh - var(--topbar-h) - 40px);
  border-top: 3px solid transparent;
}
.col-header {
  padding: 12px 12px 8px;
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.col-icon  { font-size: 16px; line-height: 1; }
.col-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; flex: 1; color: var(--text-2); }
.col-count {
  background: var(--bg); color: var(--muted);
  font-size: 11px; font-weight: 700; padding: 2px 7px;
  border-radius: 99px; min-width: 22px; text-align: center;
}
.col-cards {
  flex: 1; overflow-y: auto; padding: 4px 8px;
  display: flex; flex-direction: column; gap: 8px;
}
.col-cards.drag-over { background: var(--teal-xl); border-radius: 8px; }
.col-add-btn {
  margin: 6px 8px 10px; padding: 7px; border: 1.5px dashed var(--border);
  border-radius: var(--radius); background: none; color: var(--muted-l);
  font-size: 12px; width: calc(100% - 16px); transition: all .15s;
  flex-shrink: 0;
}
.col-add-btn:hover { border-color: var(--teal); color: var(--teal); background: var(--teal-xl); }

/* ── Kanban Card ─────────────────────────────────────────────────────────────*/
.k-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 12px;
  cursor: pointer; transition: box-shadow .15s, transform .1s;
  border-left: 3px solid transparent; position: relative;
  user-select: none;
}
.k-card:hover       { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.k-card.selected    { background:#f0fdfb; box-shadow:0 0 0 2px var(--teal); }
.k-card.dragging    { opacity: .4; transform: rotate(1.5deg); }
/* Checkbox circular no canto superior esquerdo do card */
.k-card-cb {
  position: absolute; top: 7px; right: 8px;
  width: 16px; height: 16px; border-radius: 50%;
  border: 1.5px solid #cbd5e1; background: #fff;
  cursor: pointer; opacity: 0; transition: opacity .15s, background .15s;
  flex-shrink: 0;
}
.k-card-cb::after {
  content: '✓'; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: #fff; opacity: 0;
}
.k-card:hover .k-card-cb,
.k-card.selected .k-card-cb  { opacity: 1; }
.k-card-cb.checked            { background: var(--teal); border-color: var(--teal); }
.k-card-cb.checked::after     { opacity: 1; }
.k-card.drop-before { margin-top: 0; }
.k-card.drop-before::before {
  content: '';
  display: block;
  height: 3px;
  background: var(--teal);
  border-radius: 2px;
  margin: -6px -12px 6px;
}
.k-card-name        { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.4; margin-bottom: 4px; }
.k-card-company     { font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.k-card-meta        { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.k-card-tags        { display: flex; gap: 3px; flex-wrap: wrap; margin-top: 6px; }
.k-card-next        { font-size: 10px; margin-top: 6px; display: flex; align-items: center; gap: 3px; }
.k-card-next.overdue   { color: #ef4444; }
.k-card-next.today     { color: #f59e0b; }
.k-card-next.upcoming  { color: #10b981; }
.k-card-footer         { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 5px; }
.k-card-idle           { font-size: 10px; }
.k-card-idle.idle-ok   { color: #94a3b8; }
.k-card-idle.idle-warn { color: #f59e0b; }
.k-card-idle.idle-alert{ color: #ef4444; font-weight: 600; }
.k-card-location       { font-size: 10px; color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }

/* ── Badges ──────────────────────────────────────────────────────────────────*/
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 7px; border-radius: 99px;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
}
.badge-area-ux          { background: #ede9fe; color: #7c3aed; }
.badge-area-inovacao    { background: #fef3c7; color: #b45309; }
.badge-area-programacao { background: #dbeafe; color: #1d4ed8; }

.badge-origin           { background: var(--bg); color: var(--muted); }
.badge-origin-linkedin  { background: #dbeafe; color: #1d4ed8; }
.badge-origin-bni       { background: #fef3c7; color: #b45309; }
.badge-origin-palestra  { background: #f3e8ff; color: #7e22ce; }
.badge-origin-indicacao { background: #dcfce7; color: #15803d; }
.badge-origin-trafego-pago { background: #ffe4e6; color: #be123c; }
.badge-origin-outro     { background: var(--bg); color: var(--muted); }

.tag-chip {
  display: inline-flex; align-items: center;
  padding: 2px 7px; border-radius: 99px;
  font-size: 10px; font-weight: 600; color: #fff;
}

/* ── List View ───────────────────────────────────────────────────────────────*/
.list-wrapper {
  padding: 20px;
  height: calc(100vh - var(--topbar-h));
  overflow: auto;
}
.list-table-wrap {
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); overflow: hidden;
}
.list-table { width: 100%; border-collapse: collapse; }
.list-table th {
  background: var(--surface-2); padding: 10px 14px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--muted); text-align: left;
  border-bottom: 1px solid var(--border); white-space: nowrap; cursor: pointer;
}
.list-table th:hover { color: var(--teal); }
.list-table th.sorted { color: var(--teal); }
.list-table td {
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  font-size: 13px; vertical-align: middle;
}
.list-table tr:last-child td { border-bottom: none; }
.list-table tr:hover td { background: var(--teal-xl); cursor: pointer; }
.list-table tr.selected td  { background: #f0fdfb; }
.list-cell-name  { font-weight: 600; color: var(--text); }
.list-cell-comp  { font-size: 12px; color: var(--muted); margin-top: 2px; }
.list-empty      { text-align: center; padding: 60px 20px; color: var(--muted); }
/* Coluna checkbox da lista */
.list-check-th   { width: 36px; padding: 0 8px !important; }
.list-check-td   { width: 36px; padding: 0 8px; cursor: default; }
.list-cb {
  width: 16px; height: 16px; border-radius: 4px;
  border: 1.5px solid #cbd5e1; background: #fff;
  cursor: pointer; position: relative; transition: background .15s;
}
.list-cb.checked         { background: var(--teal); border-color: var(--teal); }
.list-cb.checked::after  { content:'✓'; position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-size:11px; color:#fff; }

/* ── Barra de ação em lote ───────────────────────────────────────────────────*/
.batch-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 900;
  background: #1e293b; color: #fff;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 24px;
  transform: translateY(100%); transition: transform .25s ease;
  box-shadow: 0 -4px 24px rgba(0,0,0,.25);
}
.batch-bar--open      { transform: translateY(0); }
.batch-count          { font-size: 13px; font-weight: 700; white-space: nowrap; }
.batch-tags-label     { font-size: 12px; color: #94a3b8; white-space: nowrap; }
.batch-tags-picker    { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; align-items: center; }
.batch-tag-opt        { cursor: pointer; }
.batch-tag-opt input  { display: none; }
.batch-tag-chip {
  display: inline-block; padding: 3px 9px; border-radius: 12px;
  font-size: 11px; font-weight: 600; color: #fff;
  opacity: .45; transition: opacity .15s, box-shadow .15s;
}
.batch-tag-opt:has(input:checked) .batch-tag-chip {
  opacity: 1; box-shadow: 0 0 0 2px #fff;
}
.batch-actions        { display: flex; gap: 8px; flex-shrink: 0; }
.batch-btn-clear {
  padding: 7px 13px; border-radius: 6px; border: 1px solid #475569;
  background: transparent; color: #cbd5e1; font-size: 12px; font-weight: 600; cursor: pointer;
}
.batch-btn-clear:hover { background: #334155; }
.batch-btn-apply {
  padding: 7px 14px; border-radius: 6px; border: none;
  background: var(--teal); color: #fff; font-size: 13px; font-weight: 700; cursor: pointer;
}
.batch-btn-apply:hover    { background: var(--teal-d); }
.batch-btn-apply:disabled { opacity: .6; cursor: not-allowed; }
.batch-btn-remove {
  padding: 7px 14px; border-radius: 6px; border: none;
  background: #dc2626; color: #fff; font-size: 13px; font-weight: 700; cursor: pointer;
}
.batch-btn-remove:hover    { background: #b91c1c; }
.batch-btn-remove:disabled { opacity: .6; cursor: not-allowed; }

/* ── Dashboard ───────────────────────────────────────────────────────────────*/
.dashboard-wrap { padding: 24px; overflow: auto; height: calc(100vh - var(--topbar-h)); }
.dash-grid      { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 20px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 6px;
}
.stat-card .stat-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.stat-card .stat-value { font-size: 32px; font-weight: 800; color: var(--text); }
.stat-card .stat-sub   { font-size: 12px; color: var(--muted-l); }
.stat-card.accent      { background: var(--teal); }
.stat-card.accent .stat-label,
.stat-card.accent .stat-value,
.stat-card.accent .stat-sub { color: #fff; }
.stat-card.warn        { background: #fef3c7; }
.stat-card.warn .stat-value { color: #b45309; }

.dash-section       { margin-bottom: 24px; }
.dash-section h3    { font-size: 14px; font-weight: 700; margin-bottom: 12px; color: var(--text-2); }
.funnel-bar         { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.funnel-label       { font-size: 12px; color: var(--muted); width: 100px; text-align: right; text-transform: capitalize; }
.funnel-track       { flex: 1; background: var(--bg); border-radius: 99px; height: 10px; }
.funnel-fill        { height: 10px; border-radius: 99px; background: var(--teal); transition: width .6s; }
.funnel-num         { font-size: 12px; font-weight: 700; color: var(--text-2); width: 30px; }

/* ── Tags View ───────────────────────────────────────────────────────────────*/
.tags-wrap { padding: 24px; overflow: auto; height: calc(100vh - var(--topbar-h)); }
.tags-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.tags-header h2 { font-size: 18px; font-weight: 700; }
.tags-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.tag-card {
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 14px 16px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 12px; min-width: 160px;
}
.tag-swatch { width: 24px; height: 24px; border-radius: 6px; flex-shrink: 0; }
.tag-info   { flex: 1; min-width: 0; }
.tag-name   { font-size: 13px; font-weight: 600; }
.tag-count  { font-size: 11px; color: var(--muted); }
.tag-actions { display: flex; gap: 4px; }
.tag-action-btn {
  background: none; border: none; padding: 4px 7px;
  border-radius: 6px; color: var(--muted); font-size: 13px;
  transition: background .15s, color .15s;
}
.tag-action-btn:hover { background: var(--bg); color: var(--text); }
.tag-action-btn.del:hover { color: #ef4444; background: #fef2f2; }

input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 6px; }
input[type="color"]:hover { border-color: var(--teal); }

/* ── Users View ──────────────────────────────────────────────────────────────*/
.users-wrap { padding: 24px; overflow: auto; height: calc(100vh - var(--topbar-h)); }
.users-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.users-header h2 { font-size: 18px; font-weight: 700; }
.users-table-wrap { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
.users-table { width: 100%; border-collapse: collapse; }
.users-table th { background: var(--surface-2); padding: 10px 14px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); text-align: left; border-bottom: 1px solid var(--border); }
.users-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
.users-table tr:last-child td { border-bottom: none; }
.status-pill { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; }
.status-pill.active   { background: #dcfce7; color: #15803d; }
.status-pill.inactive { background: #f1f5f9; color: var(--muted); }

/* ── Modal ───────────────────────────────────────────────────────────────────*/
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-box {
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); width: 100%; max-width: 900px;
  max-height: 90vh; display: flex; flex-direction: column;
  transform: scale(.96) translateY(8px); transition: transform .2s;
}
.modal-overlay.open .modal-box { transform: none; }

.modal-header {
  padding: 18px 22px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; flex-shrink: 0;
}
.modal-title { font-size: 17px; font-weight: 700; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.modal-close {
  background: none; border: none; font-size: 20px; color: var(--muted);
  padding: 4px 8px; border-radius: var(--radius); transition: background .15s;
  flex-shrink: 0;
}
.modal-close:hover { background: var(--bg); color: var(--text); }

.modal-body {
  display: grid; grid-template-columns: 1fr 380px;
  flex: 1; overflow: hidden;
}
.modal-form   { padding: 20px; overflow-y: auto; border-right: 1px solid var(--border); }
.modal-history{ padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }

.form-row       { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.form-row.full  { grid-template-columns: 1fr; }
.field-group    { margin-bottom: 12px; }
.field-group label {
  display: block; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 5px;
}
.field-group input,
.field-group select,
.field-group textarea {
  width: 100%; padding: 8px 12px; border: 1.5px solid var(--border);
  border-radius: var(--radius); font-size: 13px; color: var(--text);
  outline: none; transition: border-color .2s, box-shadow .2s; background: #fff;
}
.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus {
  border-color: var(--teal); box-shadow: 0 0 0 3px rgba(13,148,136,.1);
}
.field-group textarea { resize: vertical; min-height: 72px; }

.tags-selector    { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; border: 1.5px solid var(--border); border-radius: var(--radius); min-height: 40px; cursor: text; }
.tags-selector .tag-chip { cursor: pointer; }
.tags-selector .tag-chip::after { content: ' ×'; opacity: .6; }
.tag-option       { padding: 3px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; color: #fff; cursor: pointer; opacity: .6; transition: opacity .15s; }
.tag-option.selected { opacity: 1; }

.modal-footer {
  padding: 14px 22px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; flex-shrink: 0;
}
.btn-save {
  background: var(--teal); color: #fff; border: none;
  padding: 9px 22px; border-radius: var(--radius);
  font-size: 14px; font-weight: 600; transition: background .15s;
}
.btn-save:hover { background: var(--teal-d); }
.btn-save:disabled { opacity: .6; cursor: not-allowed; }
.btn-delete {
  background: none; border: 1.5px solid #fecaca; color: #ef4444;
  padding: 8px 16px; border-radius: var(--radius); font-size: 13px; font-weight: 600;
  transition: background .15s;
}
.btn-delete:hover { background: #fef2f2; }

/* ── History Timeline ────────────────────────────────────────────────────────*/
.history-title { font-size: 13px; font-weight: 700; color: var(--text-2); }
.history-add   { display: flex; flex-direction: column; gap: 6px; }
.history-add textarea {
  width: 100%; padding: 8px 10px; border: 1.5px solid var(--border);
  border-radius: var(--radius); font-size: 12px; resize: vertical; min-height: 56px;
  outline: none;
}
.history-add textarea:focus { border-color: var(--teal); }
.history-add-row { display: flex; gap: 6px; }
.history-type-select {
  flex: 1; padding: 6px 8px; border: 1.5px solid var(--border);
  border-radius: var(--radius); font-size: 12px; outline: none;
}
.btn-add-hist {
  background: var(--teal); color: #fff; border: none;
  padding: 6px 14px; border-radius: var(--radius);
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.btn-add-hist:hover { background: var(--teal-d); }

.timeline       { display: flex; flex-direction: column; gap: 0; }
.timeline-item  { display: flex; gap: 10px; padding-bottom: 16px; position: relative; }
.timeline-item::before {
  content: ''; position: absolute; left: 14px; top: 24px;
  width: 1px; bottom: 0; background: var(--border);
}
.timeline-item:last-child::before { display: none; }
.tl-icon {
  width: 28px; height: 28px; min-width: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex-shrink: 0; background: var(--bg);
  border: 2px solid var(--border);
}
.tl-icon.created       { background: var(--teal-l); border-color: var(--teal); }
.tl-icon.status_change { background: #ede9fe; border-color: #7c3aed; }
.tl-icon.note          { background: #f0f9ff; border-color: #0ea5e9; }
.tl-icon.email         { background: #fef3c7; border-color: #d97706; }
.tl-icon.call          { background: #dcfce7; border-color: #16a34a; }
.tl-icon.meeting       { background: #fce7f3; border-color: var(--mag); }
.tl-body        { flex: 1; min-width: 0; }
.tl-desc        { font-size: 12px; color: var(--text); line-height: 1.5; }
.tl-meta        { font-size: 10px; color: var(--muted-l); margin-top: 2px; }
.history-title  { display: flex; align-items: center; gap: 8px; }
.hist-show-hidden-btn {
  font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 10px;
  border: 1px dashed var(--border); background: none; color: var(--muted);
  cursor: pointer; transition: border-color .15s, color .15s;
}
.hist-show-hidden-btn:hover { border-color: var(--teal); color: var(--teal); }
.hist-hide-btn {
  opacity: 0; flex-shrink: 0; align-self: flex-start;
  background: none; border: none; cursor: pointer;
  color: var(--muted-l); font-size: 11px; padding: 2px 4px;
  border-radius: 4px; transition: opacity .15s, color .15s; line-height: 1;
}
.timeline-item:hover .hist-hide-btn { opacity: 1; }
.hist-hide-btn:hover { color: var(--red); }
.hist-hidden { opacity: 0.38; }
.hist-hidden .hist-hide-btn { opacity: 1; color: var(--teal); }
.hist-hidden .hist-hide-btn:hover { color: var(--teal-d); }

/* ── Forms / Buttons (shared) ────────────────────────────────────────────────*/
.btn-secondary {
  background: var(--bg); border: 1.5px solid var(--border); color: var(--text-2);
  padding: 8px 16px; border-radius: var(--radius); font-size: 13px; font-weight: 600;
  transition: background .15s;
}
.btn-secondary:hover { background: var(--border); }
.btn-linkedin {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  padding: 7px 11px; border-radius: var(--radius); font-size: 12px; font-weight: 600;
  background: #0a66c2; color: #fff; text-decoration: none;
  transition: background .15s; flex-shrink: 0;
}
.btn-linkedin:hover { background: #004182; }
.btn-primary {
  background: var(--teal); color: #fff; border: none;
  padding: 8px 18px; border-radius: var(--radius); font-size: 13px; font-weight: 600;
  transition: background .15s;
}
.btn-primary:hover { background: var(--teal-d); }

/* ── Loading ─────────────────────────────────────────────────────────────────*/
.loading-screen {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; gap: 16px; color: var(--muted);
}
.spinner {
  width: 36px; height: 36px; border: 3px solid var(--border);
  border-top-color: var(--teal); border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ───────────────────────────────────────────────────────────────────*/
.toast-container {
  position: fixed; bottom: 20px; right: 20px;
  display: flex; flex-direction: column; gap: 8px; z-index: 9999;
}
.toast {
  background: var(--text); color: #fff; padding: 11px 18px;
  border-radius: var(--radius); font-size: 13px; box-shadow: var(--shadow-md);
  animation: toast-in .2s ease; min-width: 200px; max-width: 340px;
}
.toast.success { background: #16a34a; }
.toast.error   { background: #dc2626; }
@keyframes toast-in { from { opacity:0; transform: translateX(20px); } }

/* ── Utilities ───────────────────────────────────────────────────────────────*/
.hidden     { display: none !important; }
.admin-only { display: none; }
body.is-admin .admin-only { display: flex; }
.text-muted { color: var(--muted); }
.text-sm    { font-size: 12px; }
.fw-bold    { font-weight: 700; }
.gap-4      { gap: 4px; }
.flex       { display: flex; }
.flex-center{ display: flex; align-items: center; justify-content: center; }
.empty-state {
  text-align: center; padding: 64px 20px; color: var(--muted);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; opacity: .4; }
.empty-state p { font-size: 14px; }

/* ── Column status colors ────────────────────────────────────────────────────*/
[data-col="oportunidades"]  { border-top-color: #94a3b8; } [data-col="oportunidades"]  .col-count { background:#f1f5f9; color:#94a3b8; }
[data-col="prospeccao"]     { border-top-color: #3b82f6; } [data-col="prospeccao"]     .col-count { background:#eff6ff; color:#3b82f6; }
[data-col="conexao"]        { border-top-color: #22c55e; } [data-col="conexao"]        .col-count { background:#f0fdf4; color:#22c55e; }
[data-col="qualificacao"]   { border-top-color: #a855f7; } [data-col="qualificacao"]   .col-count { background:#faf5ff; color:#a855f7; }
[data-col="diagnostico"]    { border-top-color: #f59e0b; } [data-col="diagnostico"]    .col-count { background:#fffbeb; color:#f59e0b; }
[data-col="elaboracao"]     { border-top-color: #f97316; } [data-col="elaboracao"]     .col-count { background:#fff7ed; color:#f97316; }
[data-col="proposta"]       { border-top-color: #ec4899; } [data-col="proposta"]       .col-count { background:#fdf2f8; color:#ec4899; }
[data-col="negociacao"]     { border-top-color: #ef4444; } [data-col="negociacao"]     .col-count { background:#fef2f2; color:#ef4444; }
[data-col="aprovacao"]      { border-top-color: #10b981; } [data-col="aprovacao"]      .col-count { background:#ecfdf5; color:#10b981; }
[data-col="contrato"]       { border-top-color: #0ea5e9; } [data-col="contrato"]       .col-count { background:#f0f9ff; color:#0ea5e9; }
[data-col="execucao"]       { border-top-color: #6366f1; } [data-col="execucao"]       .col-count { background:#eef2ff; color:#6366f1; }
[data-col="nutricao"]       { border-top-color: #06b6d4; } [data-col="nutricao"]       .col-count { background:#ecfeff; color:#06b6d4; }
[data-col="recusado"]       { border-top-color: #dc2626; } [data-col="recusado"]       .col-count { background:#fef2f2; color:#dc2626; }
