/* Estilos do CRM Kanban - EscoteirosTM */

/* 1. Tela de Login */
.login-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: var(--bg-secondary);
  padding: 24px;
}

.login-card {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo {
  background: linear-gradient(135deg, var(--brand-color), var(--brand-hover));
  color: #ffffff;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 24px;
  box-shadow: var(--shadow-glow);
  margin-bottom: 16px;
}

.login-header h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.login-header p {
  font-size: 13px;
  color: var(--text-secondary);
}

.login-footer {
  text-align: center;
  margin-top: 32px;
  font-size: 12px;
  color: var(--text-tertiary);
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
}

/* 2. Layout Geral do CRM */
.crm-wrapper {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-primary);
}

/* Header do CRM */
.crm-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background-color: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  z-index: 10;
}

[data-theme="dark"] .crm-header {
  background-color: rgba(9, 9, 11, 0.7);
}

.crm-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.crm-logo-icon {
  background: linear-gradient(135deg, var(--brand-color), var(--brand-hover));
  color: #ffffff;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  box-shadow: var(--shadow-glow);
}

.crm-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.crm-subtitle {
  font-size: 11px;
  color: var(--text-secondary);
}

.crm-user-profile {
  display: flex;
  align-items: center;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background-color: var(--brand-light);
  color: var(--brand-color);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
}

.user-info h4 {
  font-size: 13px;
  font-weight: 600;
}

.user-info span {
  font-size: 11px;
  color: var(--text-tertiary);
}

/* Controles (Filtros e Busca) */
.crm-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  gap: 16px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  max-width: 480px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  font-size: 14px;
}

.search-box input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-primary);
  font-size: 14px;
  transition: all var(--transition-fast);
}

.search-box input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.filter-group {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Kanban Board Layout */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(6, minmax(280px, 1fr));
  gap: 16px;
  padding: 24px;
  overflow-x: auto;
  overflow-y: hidden;
  height: calc(100vh - 145px);
  background-color: var(--bg-secondary);
}

.kanban-column {
  background-color: var(--kanban-column-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  transition: border-color var(--transition-normal);
}

/* Destaque ao arrastar sobre a coluna */
.kanban-column.drag-over {
  border-color: var(--brand-color);
  background-color: rgba(16, 185, 129, 0.02);
}

.column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.column-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  background-color: var(--bg-tertiary);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.card-list {
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-grow: 1;
  min-height: 100px;
}

/* Kanban Cards */
.kanban-card {
  background-color: var(--kanban-card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: grab;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  user-select: none;
}

.kanban-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--text-tertiary);
}

.kanban-card:active {
  cursor: grabbing;
}

.card-tags {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  display: inline-block;
}

/* Cores das Badges por Tipo */
.badge-jovem {
  background-color: var(--brand-light);
  color: var(--brand-color);
}

.badge-voluntario {
  background-color: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.badge-parceiro {
  background-color: rgba(249, 115, 22, 0.1);
  color: #f97316;
}

.card-name {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.card-sub-type {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-tertiary);
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
  margin-top: 12px;
}

/* 3. Modal Dialog do Lead */
.lead-modal {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 960px;
  width: 90%;
  height: 80vh;
  margin: auto;
  background-color: var(--bg-primary);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  color: var(--text-primary);
}

.lead-modal::backdrop {
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-tertiary);
  padding: 4px;
  transition: color var(--transition-fast);
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

.modal-body-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  height: calc(80vh - 75px);
  overflow: hidden;
}

@media (max-width: 768px) {
  .modal-body-grid {
    grid-template-columns: 1fr;
    overflow-y: auto;
    height: auto;
  }
}

.modal-col-form {
  padding: 24px;
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  height: 100%;
}

.modal-col-interactions {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
  background-color: var(--bg-secondary);
}

/* Tabs das interações */
.interaction-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-tertiary);
}

.int-tab-btn {
  flex: 1;
  padding: 14px;
  background: none;
  border: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
}

.int-tab-btn:hover {
  color: var(--text-primary);
}

.int-tab-btn.active {
  color: var(--brand-color);
  border-bottom-color: var(--brand-color);
  background-color: var(--bg-secondary);
}

.interaction-panel {
  padding: 20px;
  overflow-y: auto;
  flex-grow: 1;
  display: none;
  flex-direction: column;
  gap: 16px;
}

.interaction-panel.active {
  display: flex;
}

/* Formulário de Nota */
.note-input-container {
  display: flex;
  flex-direction: column;
}

.note-input-container textarea {
  resize: none;
}

/* Timeline de Notas */
.notes-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.note-item {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  padding: 16px;
  border-radius: var(--radius-md);
  position: relative;
}

.note-header {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

.note-author {
  font-weight: 600;
  color: var(--text-secondary);
}

.note-text {
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-line;
}

.note-delete-btn {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 11px;
  padding: 2px;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.note-item:hover .note-delete-btn {
  opacity: 0.8;
}

.note-delete-btn:hover {
  opacity: 1 !important;
}

/* Timeline de Logs */
.timeline-list {
  display: flex;
  flex-direction: column;
  position: relative;
  padding-left: 20px;
}

.timeline-list::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background-color: var(--border-color);
}

.timeline-item {
  position: relative;
  padding-bottom: 20px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background-color: var(--bg-tertiary);
  border: 2px solid var(--brand-color);
  box-shadow: 0 0 0 3px var(--bg-secondary);
}

.timeline-time {
  font-size: 10px;
  color: var(--text-tertiary);
  margin-bottom: 2px;
}

.timeline-desc {
  font-size: 13px;
  color: var(--text-primary);
}

/* Registro de Log Manual */
.manual-log-container {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  padding: 16px;
  border-radius: var(--radius-md);
  margin-bottom: 8px;
}
