/* ==============================================================================
   AGÊNCIA NINJA — DASHBOARD & LAYOUT STYLES
   ============================================================================== */

/* Layout Container */
.app-container {
  max-width: 1560px;
  margin: 0 auto;
  padding: 24px 28px 80px;
  position: relative;
  z-index: 1;
}

/* Header & Barra Superior */
.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  margin-bottom: 28px;
  border-radius: 20px;
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logo-img {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  object-fit: cover;
  border: 1.5px solid rgba(0, 245, 212, 0.4);
  box-shadow: 0 0 15px rgba(0, 245, 212, 0.25);
}

.brand-info h1 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-info p {
  font-size: 0.8rem;
  color: var(--neon-cyan);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.engine-status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 30px;
  background: rgba(8, 12, 20, 0.7);
  border: 1px solid var(--border-subtle);
  font-size: 0.82rem;
  font-weight: 600;
}

/* Grid de Métricas / KPIs */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 30px;
}

.kpi-card {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 128px;
  position: relative;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.kpi-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 245, 212, 0.4);
}

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.kpi-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.icon-cyan {
  background: rgba(0, 245, 212, 0.12);
  color: var(--neon-cyan);
  border: 1px solid rgba(0, 245, 212, 0.25);
}

.icon-purple {
  background: rgba(157, 78, 221, 0.15);
  color: var(--neon-purple-soft);
  border: 1px solid rgba(157, 78, 221, 0.3);
}

.icon-green {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.icon-blue {
  background: rgba(2, 132, 199, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(2, 132, 199, 0.3);
}

.kpi-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
  color: #ffffff;
}

.kpi-footer {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.kpi-footer .highlight {
  color: var(--neon-cyan);
  font-weight: 600;
}

/* Layout Principal: 2 Colunas */
.main-dashboard-grid {
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 26px;
  margin-bottom: 30px;
}

@media (max-width: 1200px) {
  .main-dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* Painel de Lançamento / Nova Busca */
.panel-section-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 7px;
}

.ninja-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  color: #ffffff;
  font-size: 0.95rem;
  font-family: inherit;
  transition: all var(--transition-fast);
}

.ninja-input:focus {
  outline: none;
  border-color: var(--neon-cyan);
  box-shadow: 0 0 12px rgba(0, 245, 212, 0.25);
  background: rgba(11, 16, 26, 0.95);
}

.ninja-input::placeholder {
  color: var(--text-muted);
}

/* Tags de Nichos Quentes */
.quick-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tag-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tag-btn:hover {
  background: rgba(0, 245, 212, 0.12);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
}

/* Slider de Raio e Mini Mapa */
.radius-slider-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 6px;
}

.radius-slider {
  flex: 1;
  -webkit-appearance: none;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  outline: none;
}

.radius-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--neon-cyan);
  cursor: pointer;
  box-shadow: 0 0 10px var(--neon-cyan);
  transition: transform 0.1s;
}

.radius-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.radius-val-badge {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--neon-cyan);
  background: rgba(0, 245, 212, 0.1);
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid rgba(0, 245, 212, 0.25);
  min-width: 60px;
  text-align: center;
}

.mini-map-preview {
  height: 170px;
  border-radius: 12px;
  overflow: hidden;
  margin-top: 10px;
  border: 1px solid var(--border-subtle);
  background: #080c14;
}

.mini-map-preview .leaflet-tile-pane,
.ninja-map-tiles {
  filter: brightness(0.65) invert(1) contrast(3) hue-rotate(205deg) saturate(0.25) brightness(0.75);
}

/* Seletor de Quantidade / Profundidade */
.depth-selector {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  background: var(--bg-input);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
}

.depth-btn {
  background: transparent;
  border: none;
  padding: 8px 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.depth-btn:hover {
  color: #ffffff;
}

.depth-btn.active {
  background: var(--grad-aurora);
  color: #05070a;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(0, 245, 212, 0.3);
}

/* Toggles e Checkboxes Customizados */
.options-toggle-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 18px 0;
}

.toggle-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
}

.toggle-label:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

.toggle-switch {
  position: relative;
  width: 40px;
  height: 22px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  transition: .3s;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: .3s;
}

.toggle-switch input:checked + .switch-slider {
  background-color: var(--neon-cyan);
}

.toggle-switch input:checked + .switch-slider:before {
  transform: translateX(18px);
  background-color: #05070a;
}

/* Fila de Buscas (Live Jobs) */
.jobs-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}

.job-item {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(14, 20, 31, 0.8);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.job-item:hover {
  border-color: rgba(0, 245, 212, 0.35);
  background: rgba(20, 28, 44, 0.9);
  transform: translateX(3px);
}

.job-item.active-job {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 15px rgba(0, 245, 212, 0.15);
  background: rgba(16, 25, 40, 0.95);
}

.job-item.working::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: var(--grad-aurora);
  animation: progressPulse 1.8s infinite linear;
}

@keyframes progressPulse {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.job-main-info {
  flex: 1;
  min-width: 0;
}

.job-title-text {
  font-weight: 600;
  font-size: 0.95rem;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.job-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.job-leads-count {
  text-align: right;
  margin-right: 14px;
}

.job-leads-count b {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
  color: var(--neon-cyan);
  display: block;
}

.job-leads-count span {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.job-actions-btns {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn-danger {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.icon-btn-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-danger);
}

/* Seção de Resultados & Tabela de Leads */
.results-section {
  margin-top: 10px;
}

.results-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.results-title-group h2 {
  font-size: 1.35rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.results-title-group p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.results-actions-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Filtros da Tabela */
.table-filters-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(14, 20, 31, 0.6);
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-input-box {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-input-box input {
  padding-left: 36px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.filter-select {
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text-main);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
}

.filter-select:focus {
  border-color: var(--neon-cyan);
}

.filter-pill-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
}

.filter-pill-check:hover {
  background: rgba(255, 255, 255, 0.06);
}

.filter-pill-check input:checked ~ span {
  color: var(--neon-cyan);
  font-weight: 600;
}

/* Tabela de Leads */
.leads-table-container {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  background: rgba(11, 16, 25, 0.7);
}

.ninja-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.ninja-table th {
  background: rgba(14, 20, 31, 0.95);
  padding: 14px 16px;
  font-weight: 700;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.ninja-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.ninja-table tbody tr {
  transition: background var(--transition-fast);
}

.ninja-table tbody tr:hover {
  background: rgba(0, 245, 212, 0.03);
}

.lead-company-cell .company-title {
  font-weight: 600;
  color: #ffffff;
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.lead-company-cell .company-cat {
  font-size: 0.78rem;
  color: var(--neon-cyan);
}

.contact-links-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wa-btn-direct {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-fast);
  width: fit-content;
}

.wa-btn-direct:hover {
  background: rgba(16, 185, 129, 0.28);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.email-link {
  color: #93c5fd;
  text-decoration: none;
  font-size: 0.8rem;
}

.email-link:hover {
  text-decoration: underline;
}

.website-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.website-link:hover {
  color: var(--neon-cyan);
}

.rating-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  color: #fbbf24;
}

.reviews-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 2px;
}

/* Modais Futuristas */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  width: 90%;
  max-width: 600px;
  background: var(--bg-surface);
  border: 1px solid var(--border-highlight);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), var(--shadow-neon-cyan);
  border-radius: 20px;
  padding: 28px;
  position: relative;
  max-height: 85vh;
  overflow-y: auto;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.modal-close-btn:hover {
  color: #ffffff;
}

/* Toast Notificações */
.ninja-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(14, 20, 31, 0.95);
  border: 1px solid var(--neon-cyan);
  box-shadow: var(--shadow-neon-cyan);
  color: #ffffff;
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 1000;
  transform: translateY(100px);
  opacity: 0;
  transition: all var(--transition-normal);
  display: flex;
  align-items: center;
  gap: 10px;
}

.ninja-toast.show {
  transform: translateY(0);
  opacity: 1;
}
