/* ============================================================
   CMS CROWD Operações — estilos
   ============================================================ */

:root {
  --bg: #0f1115;
  --bg-elevated: #171a21;
  --surface: #1c2029;
  --surface-2: #232834;
  --border: #2b313d;
  --border-strong: #3a4150;
  --text: #e7eaf0;
  --text-dim: #9aa3b2;
  --text-faint: #6b7280;

  /* Identidade CROWD — amarelo */
  --brand: #ffd200;
  --brand-600: #f0c400;
  --brand-ink: #14161b;   /* texto sobre o amarelo */

  --nova: #4f8cff;
  --troca: #b06bff;

  --prio-alta: #ff5a5a;
  --prio-media: #f5b13d;
  --prio-baixa: #59c977;

  --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  --radius: 12px;
  --radius-sm: 8px;

  --col-iniciar: #6b7280;
  --col-em_andamento: #4f8cff;
  --col-em_analise: #f5b13d;
  --col-aprovado: #b06bff;
  --col-em_atividade: #59c977;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  height: 100vh;
  overflow: hidden;
}

#app { display: flex; flex-direction: column; height: 100vh; }

/* ---------- Logo (imagem branca) ---------- */
.logo-img { display: block; width: auto; }
.logo-img-top { height: 26px; }
.logo-img-login { height: 40px; margin: 0 auto; }

/* Wordmark de texto (fallback, caso troque o logo) */
.wordmark {
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #ffffff;
  font-size: 22px;
  line-height: 1;
}
.wordmark .dot { color: var(--brand); }

/* ---------- Topbar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 20px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-divider { width: 1px; height: 26px; background: var(--border-strong); }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 13px; }
.brand-text span { color: var(--text-dim); font-size: 11.5px; }

.topbar-actions { display: flex; align-items: center; gap: 10px; }

.search-wrap input, #filter-type {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px; outline: none;
  transition: border-color .15s;
}
.search-wrap input { width: 240px; }
.search-wrap input:focus, #filter-type:focus { border-color: var(--brand); }
.search-wrap input::placeholder { color: var(--text-faint); }

.user-menu { display: flex; align-items: center; gap: 8px; margin-left: 4px; }
.user-badge {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--brand); color: var(--brand-ink);
  display: grid; place-items: center; font-weight: 800; font-size: 12px;
}

/* ---------- Buttons ---------- */
.btn {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 9px 14px; font-size: 13px; font-weight: 600;
  cursor: pointer; color: var(--text); background: var(--surface);
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: var(--brand-ink); font-weight: 700; }
.btn-primary:hover { background: var(--brand-600); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-dim); }
.btn-ghost:hover { color: var(--text); border-color: var(--border-strong); }
.btn-danger { background: transparent; border-color: #5a2b2b; color: #ff7a7a; }
.btn-danger:hover { background: #331a1a; }
.btn-block { width: 100%; justify-content: center; }
.btn .plus { font-weight: 800; margin-right: 2px; }

.icon-btn {
  background: transparent; border: none; color: var(--text-dim);
  font-size: 22px; cursor: pointer; line-height: 1;
  padding: 4px 8px; border-radius: 6px;
}
.icon-btn:hover { color: var(--text); background: var(--surface-2); }

/* ---------- Login ---------- */
.login-screen {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  background:
    radial-gradient(1200px 500px at 50% -10%, rgba(255,210,0,.08), transparent 60%),
    var(--bg);
  z-index: 100; padding: 20px;
}
.login-card {
  width: 100%; max-width: 360px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 28px 26px;
  box-shadow: var(--shadow);
}
.login-logo { text-align: center; margin-bottom: 22px; }
.login-logo .wordmark { font-size: 34px; }
.login-sub { display: block; margin-top: 8px; color: var(--text-dim); font-size: 12.5px; }
#login-form { display: flex; flex-direction: column; gap: 14px; }
.login-error {
  color: #ff8f8f; font-size: 12.5px; background: rgba(255,90,90,.1);
  border: 1px solid #5a2b2b; padding: 8px 10px; border-radius: 6px;
}

/* ---------- Board ---------- */
.board {
  flex: 1; display: flex; gap: 14px; padding: 18px 20px;
  overflow-x: auto; overflow-y: hidden; align-items: flex-start;
}
.column {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 300px; min-width: 300px; max-height: 100%;
  display: flex; flex-direction: column;
}
.column.drag-over { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.column-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px 10px; border-bottom: 1px solid var(--border);
}
.column-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; }
.column-dot { width: 9px; height: 9px; border-radius: 50%; }
.column-count {
  background: var(--surface-2); color: var(--text-dim);
  border-radius: 20px; padding: 2px 8px; font-size: 11px; font-weight: 700;
}
.column-body {
  padding: 10px; overflow-y: auto; flex: 1;
  display: flex; flex-direction: column; gap: 9px; min-height: 60px;
}
.column-add {
  margin: 4px 10px 12px; padding: 9px;
  border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
  color: var(--text-dim); font-size: 12px; font-weight: 600;
  cursor: pointer; text-align: center; background: transparent;
  transition: color .15s, border-color .15s, background .15s;
}
.column-add:hover { color: var(--text); border-color: var(--brand); background: var(--surface); }

/* ---------- Card ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 11px 12px;
  cursor: grab; position: relative; border-left: 3px solid var(--border-strong);
  transition: border-color .15s, transform .05s, box-shadow .15s;
}
.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.card:active { cursor: grabbing; }
.card.dragging { opacity: 0.45; }
.card.card-nova { border-left-color: var(--nova); }
.card.card-troca { border-left-color: var(--troca); }
.card-title { font-weight: 600; font-size: 13.5px; line-height: 1.35; margin-bottom: 8px; word-break: break-word; }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }

.tag { font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 20px; letter-spacing: .2px; text-transform: uppercase; }
.tag-nova { background: rgba(79,140,255,.15); color: #7dabff; }
.tag-troca { background: rgba(176,107,255,.15); color: #c79dff; }
.tag-hubspot { background: rgba(255,210,0,.15); color: #ffdf5a; }
.tag-prio-alta { background: rgba(255,90,90,.15); color: #ff8f8f; }
.tag-prio-media { background: rgba(245,177,61,.15); color: #f5c56e; }
.tag-prio-baixa { background: rgba(89,201,119,.15); color: #86d9a1; }

.card-proposta {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; color: var(--text-dim);
  margin-bottom: 8px; word-break: break-all;
}
.card-proposta a { color: #ffdf5a; text-decoration: none; }
.card-proposta a:hover { text-decoration: underline; }
.card-proposta .ic { opacity: .7; }

.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--text-dim); }
.card-people { display: flex; align-items: center; gap: 6px; min-width: 0; }
.card-client { font-weight: 600; color: var(--text); }
.avatar {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--surface-2); color: var(--text-dim);
  display: grid; place-items: center; font-size: 10px; font-weight: 700; flex-shrink: 0;
}

.empty-hint {
  color: var(--text-faint); font-size: 12px; text-align: center;
  padding: 18px 8px; border: 1px dashed var(--border); border-radius: var(--radius-sm);
}

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(5,7,10,.6);
  backdrop-filter: blur(2px); display: grid; place-items: center;
  z-index: 50; padding: 20px;
}
.modal {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); width: 100%; max-width: 460px;
  box-shadow: var(--shadow); animation: pop .12s ease-out;
  max-height: 92vh; overflow-y: auto;
}
@keyframes pop { from { transform: scale(.97); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--bg-elevated); z-index: 1;
}
.modal-head h2 { margin: 0; font-size: 15px; }
.modal-body { padding: 18px; display: flex; flex-direction: column; gap: 14px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12px; color: var(--text-dim); font-weight: 600; }
.field input, .field select, .field textarea {
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  padding: 9px 11px; border-radius: var(--radius-sm); font-size: 13px;
  outline: none; font-family: inherit; transition: border-color .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); }
.field textarea { resize: vertical; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }

.modal-foot { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.modal-foot .spacer { flex: 1; }

/* ---------- Painel de usuários ---------- */
.users-list { display: flex; flex-direction: column; gap: 8px; }
.user-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px;
}
.user-row .u-name { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.user-row .u-tag { font-size: 10px; font-weight: 700; text-transform: uppercase; padding: 2px 7px; border-radius: 20px; background: rgba(255,210,0,.15); color: #ffdf5a; }
.user-row .u-me { font-size: 11px; color: var(--text-faint); }
.link-danger { background: transparent; border: none; color: #ff7a7a; cursor: pointer; font-size: 12.5px; font-weight: 600; }
.link-danger:hover { text-decoration: underline; }
.link-danger:disabled { color: var(--text-faint); cursor: default; text-decoration: none; }

.users-new { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); }
.users-new h3 { margin: 0 0 12px; font-size: 13px; color: var(--text-dim); }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-dim); margin: 12px 0; cursor: pointer; }
.check-row input { width: 16px; height: 16px; accent-color: var(--brand); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text);
  padding: 11px 18px; border-radius: 24px; font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow); z-index: 120; animation: toastin .2s ease-out;
}
@keyframes toastin { from { transform: translate(-50%, 10px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

.hidden { display: none !important; }

.board::-webkit-scrollbar, .column-body::-webkit-scrollbar, .modal::-webkit-scrollbar { height: 10px; width: 8px; }
.board::-webkit-scrollbar-thumb, .column-body::-webkit-scrollbar-thumb, .modal::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 10px; }
.board::-webkit-scrollbar-track { background: transparent; }
