/* ============================================================
   Vilareal Talentos — estilo
   Base no design-guide FAVA: minimalista, preto + roxo + branco,
   sem serifa, bordas finas, radius baixo, sombras mínimas.
   ============================================================ */
:root {
  --roxo: #6B2ED6;
  --roxo-claro: #8A57E6;
  --roxo-bg: #F3EEFC;
  --preto: #0D0D0D;
  --branco: #FFFFFF;
  --cinza-1: #F6F6F7;   /* fundo da área de trabalho */
  --cinza-2: #ECECEE;   /* hovers */
  --cinza-3: #D9D9DE;   /* bordas */
  --cinza-txt: #6B6B72; /* texto secundário */
  --verde: #1E9E5A;
  --vermelho: #C0392B;
  --amarelo: #C99A0C;
  --azul: #2D6CDF;
  --shadow: 0 1px 2px rgba(13,13,13,.06);
  --r: 6px;
  --sidebar-w: 232px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--preto);
  background: var(--cinza-1);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
a { color: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--preto);
  color: #fff;
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  padding: 22px 0;
  z-index: 20;
}
.brand {
  padding: 0 22px 22px;
  display: flex;
  align-items: baseline;
  gap: 2px;
  border-bottom: 1px solid #232323;
  margin-bottom: 14px;
}
.brand .b1 { font-weight: 800; font-size: 19px; letter-spacing: -.5px; }
.brand .b2 { font-weight: 800; font-size: 19px; color: var(--roxo-claro); letter-spacing: -.5px; }
.brand .dot { width: 6px; height: 6px; background: var(--roxo-claro); border-radius: 50%; transform: translateY(-2px); margin-left: 2px; }
.brand small { display: block; width: 100%; font-size: 10px; letter-spacing: 3px; color: #8a8a8a; text-transform: uppercase; margin-top: 4px; }

.nav { display: flex; flex-direction: column; gap: 2px; padding: 0 12px; }
.nav button {
  display: flex; align-items: center; gap: 11px;
  background: none; border: 0; color: #c7c7cc;
  padding: 10px 12px; border-radius: var(--r); text-align: left;
  font-size: 14px; width: 100%; transition: .12s;
}
.nav button .ico { width: 18px; text-align: center; opacity: .9; font-size: 15px; }
.nav button:hover { background: #1d1d1d; color: #fff; }
.nav button.active { background: var(--roxo); color: #fff; }

.sidebar-foot { margin-top: auto; padding: 14px 18px 0; border-top: 1px solid #232323; }
.sidebar-foot button { background: none; border: 0; color: #8a8a8a; font-size: 12px; padding: 6px 0; display: block; }
.sidebar-foot button:hover { color: #fff; }
.sidebar-foot .status { font-size: 11px; color: #6b6b72; margin-bottom: 8px; }
.sidebar-foot .status b { color: var(--amarelo); }

.main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: 60px; background: #fff; border-bottom: 1px solid var(--cinza-3);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; position: sticky; top: 0; z-index: 10;
}
.topbar h1 { font-size: 18px; font-weight: 700; letter-spacing: -.3px; }
.topbar .sub { font-size: 12px; color: var(--cinza-txt); margin-top: 1px; }

.content { padding: 26px 28px 60px; flex: 1; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--roxo); color: #fff; border: 0;
  padding: 9px 15px; border-radius: var(--r); font-size: 13px; font-weight: 600;
  transition: .12s;
}
.btn:hover { background: var(--roxo-claro); }
.btn.ghost { background: #fff; color: var(--preto); border: 1px solid var(--cinza-3); }
.btn.ghost:hover { background: var(--cinza-2); }
.btn.danger { background: #fff; color: var(--vermelho); border: 1px solid var(--cinza-3); }
.btn.danger:hover { background: #fdecea; }
.btn.sm { padding: 6px 10px; font-size: 12px; }

/* ---------- Cards / KPIs ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 26px; }
.kpi {
  background: #fff; border: 1px solid var(--cinza-3); border-radius: var(--r);
  padding: 18px 18px 16px; box-shadow: var(--shadow);
}
.kpi .label { font-size: 12px; color: var(--cinza-txt); text-transform: uppercase; letter-spacing: .5px; }
.kpi .value { font-size: 30px; font-weight: 800; letter-spacing: -1px; margin-top: 6px; line-height: 1; }
.kpi .value small { font-size: 14px; font-weight: 600; color: var(--cinza-txt); }
.kpi .foot { font-size: 12px; color: var(--cinza-txt); margin-top: 8px; }
.kpi.accent { border-left: 3px solid var(--roxo); }

.panel { background: #fff; border: 1px solid var(--cinza-3); border-radius: var(--r); box-shadow: var(--shadow); margin-bottom: 22px; }
.panel-head { padding: 16px 18px; border-bottom: 1px solid var(--cinza-3); display: flex; align-items: center; justify-content: space-between; }
.panel-head h2 { font-size: 15px; font-weight: 700; }
.panel-body { padding: 18px; }

.section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--cinza-txt); margin: 4px 0 12px; }

/* ---------- Funil ---------- */
.funil { display: flex; flex-direction: column; gap: 10px; }
.funil-row { display: grid; grid-template-columns: 110px 1fr 38px; align-items: center; gap: 12px; }
.funil-row .nm { font-size: 13px; font-weight: 600; }
.funil-bar { height: 26px; background: var(--cinza-1); border-radius: 4px; overflow: hidden; }
.funil-bar > span { display: block; height: 100%; background: var(--roxo); border-radius: 4px; transition: width .4s; min-width: 2px; }
.funil-row .qt { font-size: 13px; font-weight: 700; text-align: right; }

/* ---------- Tabelas ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .grow { flex: 1; }
.search {
  display: flex; align-items: center; gap: 8px; background: #fff;
  border: 1px solid var(--cinza-3); border-radius: var(--r); padding: 8px 12px; min-width: 240px;
}
.search input { border: 0; outline: 0; width: 100%; background: none; }
.select { padding: 8px 12px; border: 1px solid var(--cinza-3); border-radius: var(--r); background: #fff; }

table { width: 100%; border-collapse: collapse; background: #fff; }
.table-wrap { background: #fff; border: 1px solid var(--cinza-3); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--cinza-txt); padding: 12px 16px; border-bottom: 1px solid var(--cinza-3); font-weight: 700; }
td { padding: 13px 16px; border-bottom: 1px solid var(--cinza-1); font-size: 13.5px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--cinza-1); cursor: pointer; }
td .nome { font-weight: 600; }
td .muted { color: var(--cinza-txt); font-size: 12.5px; }

/* ---------- Badges / tags ---------- */
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px; letter-spacing: .2px; }
.badge.aberta { background: #e7f6ee; color: var(--verde); }
.badge.fechada { background: var(--cinza-2); color: var(--cinza-txt); }
.badge.pausada { background: #fbf3dd; color: var(--amarelo); }
.tag { display: inline-block; background: var(--roxo-bg); color: var(--roxo); font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 4px; margin: 0 4px 4px 0; }
.tag.gray { background: var(--cinza-2); color: var(--cinza-txt); }

/* ---------- Kanban ---------- */
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 16px; align-items: flex-start; }
.col {
  flex: 0 0 252px; background: var(--cinza-1); border: 1px solid var(--cinza-3);
  border-radius: var(--r); display: flex; flex-direction: column; max-height: calc(100vh - 220px);
}
.col-head { padding: 11px 13px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--cinza-3); position: sticky; top: 0; }
.col-head .ct { font-size: 13px; font-weight: 700; }
.col-head .qt { font-size: 11px; font-weight: 700; color: var(--cinza-txt); background: #fff; border: 1px solid var(--cinza-3); border-radius: 20px; padding: 1px 8px; }
.col[data-etapa="Contratado"] .col-head { border-bottom-color: var(--verde); }
.col[data-etapa="Reprovado"] { opacity: .82; }
.col-body { padding: 10px; display: flex; flex-direction: column; gap: 9px; overflow-y: auto; min-height: 60px; flex: 1; }
.col-body.dragover { background: var(--roxo-bg); outline: 2px dashed var(--roxo); outline-offset: -4px; }

.card-cand {
  background: #fff; border: 1px solid var(--cinza-3); border-radius: var(--r);
  padding: 11px 12px; box-shadow: var(--shadow); cursor: grab; transition: .1s;
}
.card-cand:hover { border-color: var(--roxo); }
.card-cand.dragging { opacity: .45; }
.card-cand .cn { font-weight: 700; font-size: 13.5px; }
.card-cand .ch { font-size: 12px; color: var(--cinza-txt); margin-top: 1px; }
.card-cand .meta { display: flex; align-items: center; justify-content: space-between; margin-top: 9px; }
.stars { font-size: 12px; letter-spacing: 1px; color: var(--amarelo); }
.stars .off { color: var(--cinza-3); }
.card-cand .src { font-size: 10px; color: var(--cinza-txt); text-transform: uppercase; letter-spacing: .4px; }

/* avatar */
.av { width: 30px; height: 30px; border-radius: 50%; background: var(--roxo); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.av.lg { width: 46px; height: 46px; font-size: 17px; }
.cell-person { display: flex; align-items: center; gap: 10px; }

/* ---------- Empty ---------- */
.empty { text-align: center; padding: 50px 20px; color: var(--cinza-txt); }
.empty .big { font-size: 40px; margin-bottom: 10px; opacity: .35; }
.empty p { margin-bottom: 16px; }

/* ---------- Modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(13,13,13,.45); display: none; align-items: flex-start; justify-content: center; z-index: 50; padding: 40px 16px; overflow-y: auto; }
.overlay.open { display: flex; }
.modal { background: #fff; border-radius: 8px; width: 100%; max-width: 560px; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.modal.wide { max-width: 720px; }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--cinza-3); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { font-size: 16px; font-weight: 700; }
.modal-head .x { background: none; border: 0; font-size: 22px; line-height: 1; color: var(--cinza-txt); }
.modal-body { padding: 22px; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--cinza-3); display: flex; justify-content: flex-end; gap: 10px; }

.field { margin-bottom: 15px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--cinza-txt); margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--cinza-3); border-radius: var(--r); outline: 0; background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--roxo); }
.field textarea { min-height: 80px; resize: vertical; }
.field .hint { font-size: 11px; color: var(--cinza-txt); margin-top: 4px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* detalhe candidato */
.detail-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.detail-head .cn { font-size: 18px; font-weight: 800; }
.detail-head .ch { font-size: 13px; color: var(--cinza-txt); }
.dl { display: grid; grid-template-columns: 130px 1fr; gap: 8px 14px; font-size: 13.5px; margin-bottom: 6px; }
.dl dt { color: var(--cinza-txt); font-weight: 600; }
.hist { list-style: none; border-left: 2px solid var(--cinza-3); margin-left: 6px; padding-left: 16px; }
.hist li { position: relative; padding: 5px 0; font-size: 13px; }
.hist li::before { content: ''; position: absolute; left: -22px; top: 10px; width: 9px; height: 9px; border-radius: 50%; background: var(--roxo); border: 2px solid #fff; }

/* score editor */
.score-edit { display: inline-flex; gap: 3px; cursor: pointer; }
.score-edit span { font-size: 18px; color: var(--cinza-3); }
.score-edit span.on { color: var(--amarelo); }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--preto); color: #fff; padding: 11px 18px; border-radius: var(--r);
  font-size: 13px; opacity: 0; pointer-events: none; transition: .25s; z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.hidden { display: none !important; }

/* ---------- Dashboard 2 colunas ---------- */
.row2-dash { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-bottom: 22px; }
.funil-row .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- SLA ---------- */
.sla { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 4px; }
.sla.ok { background: var(--cinza-2); color: var(--cinza-txt); }
.sla.estourado { background: #fdecea; color: var(--vermelho); }

/* ---------- Canais (badges) ---------- */
.canais-mini { display: flex; flex-wrap: wrap; gap: 4px; }
.canal { font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 4px; color: var(--cc, var(--roxo)); background: color-mix(in srgb, var(--cc, var(--roxo)) 12%, #fff); border: 1px solid color-mix(in srgb, var(--cc, var(--roxo)) 30%, #fff); white-space: nowrap; }

/* strip de divulgação no topo do pipeline */
.divul-strip { background: #fff; border: 1px solid var(--cinza-3); border-radius: var(--r); padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; box-shadow: var(--shadow); flex-wrap: wrap; }
.ds-left, .ds-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ds-label { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--cinza-txt); font-weight: 700; }
.ds-sep { width: 1px; height: 18px; background: var(--cinza-3); }

/* ---------- Toggles de canais no modal ---------- */
.canais-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.canal-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 13px; border: 1px solid var(--cinza-3); border-radius: var(--r); cursor: pointer; user-select: none; transition: .1s; }
.canal-row:hover { border-color: var(--roxo); background: var(--cinza-1); }
.canal-nome { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.canal-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.switch { width: 34px; height: 19px; border-radius: 20px; background: var(--cinza-3); position: relative; transition: .15s; flex-shrink: 0; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: #fff; transition: .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.switch.on { background: var(--roxo); }
.switch.on::after { left: 17px; }

@media (max-width: 720px) { .row2-dash, .canais-grid { grid-template-columns: 1fr; } }

@media (max-width: 720px) {
  .sidebar { transform: translateX(-100%); transition: .2s; }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .row2 { grid-template-columns: 1fr; }
}
