/* Campanhas — wizard estilo WASPeed */
html, body { overflow: auto; }
body { background: var(--bg-1); min-height: 100vh; }

.wizard-steps {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 18px 20px; background: var(--bg-0);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.wiz-step {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 20px;
  color: var(--text-3); font-weight: 600; font-size: .85rem;
  background: var(--bg-2);
}
.wiz-step.active { background: var(--yellow); color: #000; }
.wiz-step.done { background: var(--bg-3); color: var(--text-1); }
.wiz-step .n {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0,0,0,0.2); color: inherit; font-size: .75rem; font-weight: 800;
}
.wiz-step.active .n { background: #000; color: var(--yellow); }
.wiz-sep { width: 20px; height: 2px; background: var(--border); }

.wiz-body {
  max-width: 1400px; margin: 0 auto; padding: 24px 20px 80px;
}
.wiz-pane { animation: fadein .2s ease-out; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.wiz-header { margin-bottom: 20px; }
.wiz-header h2 { font-size: 1.4rem; font-weight: 800; color: var(--text-1); }
.wiz-header p { color: var(--text-2); font-size: .9rem; margin-top: 4px; }

/* Lista de campanhas */
.wiz-list-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.wiz-list-head h2 { font-size: 1.3rem; font-weight: 800; }
.campaigns-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.camp-card {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 16px; cursor: pointer;
  transition: all .15s;
}
.camp-card:hover { border-color: var(--yellow-dim); transform: translateY(-2px); }
.camp-card h4 { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.camp-card .meta { color: var(--text-3); font-size: .78rem; margin-bottom: 10px; }
.camp-card .progress-mini { height: 6px; background: var(--bg-3); border-radius: 3px; overflow: hidden; }
.camp-card .progress-mini .fill { height: 100%; background: var(--yellow); }
.camp-status { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: .68rem; font-weight: 700; text-transform: uppercase; }
.camp-status.draft { background: var(--bg-3); color: var(--text-2); }
.camp-status.running { background: var(--yellow); color: #000; }
.camp-status.paused { background: var(--warn); color: #000; }
.camp-status.done { background: var(--green); color: #000; }

/* Grid do passo Contatos */
.wiz-grid { display: grid; grid-template-columns: 220px 1fr 300px; gap: 16px; min-height: 500px; }
.wiz-grid2 { display: grid; grid-template-columns: 220px 1fr; gap: 16px; min-height: 500px; }
.wiz-side { background: var(--bg-2); border-radius: var(--r-lg); padding: 10px; }
.wiz-side-tabs { display: flex; flex-direction: column; gap: 4px; }
.ws-tab {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; background: none; border: none; color: var(--text-2);
  font-family: inherit; font-size: .85rem; font-weight: 600;
  border-radius: var(--r-md); cursor: pointer; text-align: left; width: 100%;
}
.ws-tab:hover { background: var(--bg-3); color: var(--text-1); }
.ws-tab.active { background: #000; color: var(--yellow); }
.ws-tab .badge { background: var(--yellow); color: #000; font-size: .7rem; padding: 1px 7px; border-radius: 10px; }

.wiz-center { background: var(--bg-2); border-radius: var(--r-lg); padding: 16px; min-height: 500px; }
.wiz-search { display: flex; gap: 8px; margin-bottom: 12px; }
.wiz-search input { flex: 1; padding: 10px 12px; background: var(--bg-0); border: 1px solid var(--border); border-radius: var(--r-md); color: var(--text-1); font-family: inherit; }
.filter-list { display: flex; flex-direction: column; gap: 4px; max-height: 520px; overflow-y: auto; }
.filter-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: var(--bg-0); border: 1px solid var(--border); border-radius: var(--r-md);
  cursor: pointer; transition: all .1s;
}
.filter-item:hover { border-color: var(--yellow-dim); }
.filter-item.selected { border-color: var(--yellow); background: var(--bg-3); }
.filter-item .check {
  width: 22px; height: 22px; border-radius: 50%; background: var(--bg-3);
  display: flex; align-items: center; justify-content: center; color: transparent;
}
.filter-item.selected .check { background: var(--green); color: #000; }
.filter-item .fi-title { font-weight: 600; font-size: .88rem; }
.filter-item .fi-sub { font-size: .72rem; color: var(--text-3); }

.manual-form { display: flex; gap: 8px; margin-top: 10px; }
.manual-form input { flex: 1; padding: 10px 12px; background: var(--bg-0); border: 1px solid var(--border); border-radius: var(--r-md); color: var(--text-1); font-family: inherit; }

.wiz-right { background: var(--bg-2); border-radius: var(--r-lg); padding: 14px; display: flex; flex-direction: column; }
.wiz-right-head { display: flex; justify-content: space-between; margin-bottom: 8px; }
.wiz-right-count { color: var(--text-3); font-size: .75rem; margin-bottom: 10px; }
.recipients-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; max-height: 460px; }
.recip-item {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg-0); padding: 6px 10px; border-radius: var(--r-md);
  font-size: .8rem;
}
.recip-item button { background: none; border: none; color: var(--red); cursor: pointer; font-size: 1rem; }

/* Ações */
.action-types { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; }
.atype {
  text-align: left; padding: 10px 12px; background: var(--bg-0);
  border: 1px solid var(--border); border-radius: var(--r-md);
  color: var(--text-1); cursor: pointer; font-family: inherit; font-size: .85rem;
}
.atype:hover { border-color: var(--yellow-dim); }
.atype.disabled { opacity: .4; cursor: not-allowed; }

.actions-seq { display: flex; flex-direction: column; gap: 10px; min-height: 300px; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 20px; color: var(--text-3); text-align: center; }
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 12px; }
.action-card {
  background: var(--bg-0); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 12px;
}
.action-card .ac-head { display: flex; justify-content: space-between; margin-bottom: 8px; }
.action-card .ac-title { font-weight: 700; font-size: .9rem; }
.action-card textarea {
  width: 100%; min-height: 110px; padding: 10px; background: var(--bg-1);
  color: var(--text-1); border: 1px solid var(--border); border-radius: var(--r-md);
  font-family: inherit; resize: vertical;
}
.action-card .ac-remove { background: none; border: none; color: var(--red); cursor: pointer; }

.vars-hint { margin-top: 12px; color: var(--text-3); font-size: .78rem; }
.vars-hint code { background: var(--bg-3); padding: 2px 6px; border-radius: 4px; margin: 0 2px; color: var(--yellow); }

.delay-row { margin-top: 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: var(--text-2); font-size: .85rem; }
.delay-row input { width: 80px; padding: 6px 8px; background: var(--bg-0); border: 1px solid var(--border); border-radius: var(--r-md); color: var(--text-1); }
.delay-row small { color: var(--text-3); font-size: .72rem; }

/* Revisão */
.review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.review-card { background: var(--bg-2); border-radius: var(--r-lg); padding: 16px; }
.review-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 10px; display: flex; justify-content: space-between; }
.review-card ul { list-style: none; display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.review-card ul li { padding: 8px 10px; background: var(--bg-0); border-radius: var(--r-md); font-size: .85rem; }
.review-stats { display: flex; justify-content: space-between; padding-top: 10px; border-top: 1px dashed var(--border); font-size: .85rem; color: var(--text-2); }
.review-recipients { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; max-height: 280px; overflow-y: auto; }
.review-recipients .r { padding: 6px 8px; background: var(--bg-0); border-radius: var(--r-sm); font-size: .78rem; }
.review-test { margin-top: 16px; background: var(--bg-2); border-radius: var(--r-lg); padding: 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.review-test input { flex: 1; min-width: 200px; padding: 8px 12px; background: var(--bg-0); border: 1px solid var(--border); border-radius: var(--r-md); color: var(--text-1); }

/* Progresso */
.progress-card { background: var(--bg-2); border-radius: var(--r-lg); padding: 20px; }
.progress-numbers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.progress-numbers div { background: var(--bg-0); border-radius: var(--r-md); padding: 14px; text-align: center; }
.progress-numbers span { display: block; font-size: 1.8rem; font-weight: 800; }
.progress-numbers small { color: var(--text-3); font-size: .72rem; text-transform: uppercase; font-weight: 700; }
.progress-bar-wrap { height: 10px; background: var(--bg-3); border-radius: 5px; overflow: hidden; margin-bottom: 14px; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--yellow), #ffd600); transition: width .5s ease; }
.progress-logs { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; font-family: 'SF Mono', monospace; font-size: .75rem; }
.progress-logs .log { padding: 4px 8px; background: var(--bg-0); border-radius: var(--r-sm); color: var(--text-2); }
.progress-logs .log.error { color: var(--red); }
.progress-logs .log.info { color: var(--text-2); }

/* Footer / botões */
.wiz-footer { display: flex; justify-content: space-between; margin-top: 20px; }
.btn-primary { padding: 10px 20px; background: var(--yellow); color: #000; border: none; border-radius: var(--r-md); font-weight: 700; cursor: pointer; font-family: inherit; font-size: .88rem; }
.btn-primary:hover { background: #ffd600; }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-secondary { padding: 10px 20px; background: var(--bg-3); color: var(--text-1); border: 1px solid var(--border-light); border-radius: var(--r-md); font-weight: 700; cursor: pointer; font-family: inherit; font-size: .88rem; }
.btn-secondary:hover { background: var(--bg-4); }
.btn-ghost { padding: 10px 16px; background: none; color: var(--text-2); border: 1px solid var(--border); border-radius: var(--r-md); cursor: pointer; font-family: inherit; font-size: .85rem; }
.btn-ghost:hover { color: var(--text-1); border-color: var(--border-light); }
.btn-link { background: none; border: none; color: var(--yellow); cursor: pointer; font-size: .8rem; font-family: inherit; }

/* Modal */
[hidden] { display: none !important; }
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.7); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: var(--bg-2); border-radius: var(--r-xl); padding: 24px; width: 400px; max-width: 92vw; }
.modal h3 { margin-bottom: 16px; }
.modal label { display: block; margin-top: 10px; font-size: .78rem; color: var(--text-3); font-weight: 600; }
.modal input, .modal select { width: 100%; margin-top: 6px; padding: 10px 12px; background: var(--bg-0); border: 1px solid var(--border); border-radius: var(--r-md); color: var(--text-1); font-family: inherit; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* Toast */
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--bg-3); color: var(--text-1); padding: 10px 18px; border-radius: var(--r-md); font-size: .85rem; z-index: 200; box-shadow: 0 4px 12px rgba(0,0,0,.4); }
.toast.err { background: var(--red); color: #fff; }
.toast.ok { background: var(--green); color: #000; }

@media (max-width: 900px) {
  .wiz-grid { grid-template-columns: 1fr; }
  .wiz-grid2 { grid-template-columns: 1fr; }
  .review-grid { grid-template-columns: 1fr; }
  .progress-numbers { grid-template-columns: repeat(2, 1fr); }
}
