:root {
  --bg-main: #0B0E14;
  --bg-card: #121824;
  --bg-card-hover: #182232;
  --bg-surface: #162030;
  --bg-input: #0E131C;
  
  --gold: #C5A059;
  --gold-light: #DFC282;
  --gold-dark: #9A7736;
  --gold-glow: rgba(197, 160, 89, 0.2);
  --border-gold: rgba(197, 160, 89, 0.3);
  --border-subtle: rgba(255, 255, 255, 0.08);

  --text-primary: #F3F4F6;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  
  --c-blue: #3B82F6;
  --c-amber: #F59E0B;
  --c-purple: #A855F7;
  --c-cyan: #06B6D4;
  --c-emerald: #10B981;
  --c-gray: #64748B;
  --c-rose: #F43F5E;

  --font-sans: 'Plus Jakarta Sans', 'IBM Plex Sans', -apple-system, sans-serif;
  --font-serif: 'Libre Baskerville', Georgia, serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   1. LOGIN SCREEN
   ============================================================ */
.login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background: radial-gradient(circle at 50% 20%, rgba(197, 160, 89, 0.12) 0%, transparent 60%),
              linear-gradient(180deg, #0D121B 0%, #080A0E 100%);
}

.login-box {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  text-align: center;
}

.brand-crest {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 16px;
  background: rgba(197, 160, 89, 0.08);
  box-shadow: 0 0 20px var(--gold-glow);
}

.login-brand h2 {
  font-family: var(--font-sans);
  font-size: 18px;
  letter-spacing: 2px;
  color: var(--text-primary);
  margin-bottom: 6px;
  font-weight: 700;
}

.brand-sub {
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--gold-light);
  font-weight: 600;
  margin-bottom: 8px;
}

.brand-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

.input-group {
  text-align: left;
  margin-bottom: 16px;
}

.input-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.input-group input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-sans);
  transition: all 0.2s ease;
}

.input-group input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold-glow);
}

.login-err-msg {
  display: none;
  color: var(--c-rose);
  font-size: 12px;
  margin-bottom: 16px;
}

.btn-login {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: #0A0D14;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px var(--gold-glow);
}

.btn-login:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.login-footer {
  margin-top: 24px;
  font-size: 11px;
  color: var(--text-muted);
}

/* ============================================================
   2. DASHBOARD WRAPPER & NAVBAR
   ============================================================ */
.dashboard-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.admin-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.nav-brand-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--text-primary);
}

.nav-brand-sub {
  display: block;
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--gold-light);
  font-weight: 600;
}

.nav-role-badge {
  background: rgba(197, 160, 89, 0.15);
  border: 1px solid var(--border-gold);
  color: var(--gold-light);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.meta-capi-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: var(--c-emerald);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.meta-capi-badge:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.6);
  transform: translateY(-1px);
}

.capi-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c-emerald);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
}

.live-pulse {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--c-emerald);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--c-emerald);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

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

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-muted);
}

.nav-btn-gold {
  background: rgba(197, 160, 89, 0.15);
  border-color: var(--border-gold);
  color: var(--gold-light);
}

.nav-btn-gold:hover {
  background: rgba(197, 160, 89, 0.25);
  border-color: var(--gold);
}

.nav-btn-danger:hover {
  background: rgba(244, 63, 94, 0.15);
  border-color: var(--c-rose);
  color: var(--c-rose);
}

/* ============================================================
   3. METRICS RIBBON
   ============================================================ */
.metrics-ribbon {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  padding: 18px 24px;
  background: linear-gradient(180deg, rgba(18, 24, 36, 0.6) 0%, transparent 100%);
  border-bottom: 1px solid var(--border-subtle);
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  transition: all 0.2s ease;
}

.metric-card:hover {
  border-color: rgba(197, 160, 89, 0.3);
  transform: translateY(-2px);
}

.metric-card-highlight {
  border-color: var(--border-gold);
  background: linear-gradient(135deg, rgba(197, 160, 89, 0.1) 0%, var(--bg-card) 100%);
}

.metric-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.metric-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.2;
}

.metric-sub {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.metric-gold { color: var(--gold-light); }
.metric-cyan { color: var(--c-cyan); }
.metric-emerald { color: var(--c-emerald); }

/* ============================================================
   4. TOOLBAR & FILTERS
   ============================================================ */
.toolbar-section {
  padding: 14px 24px;
  background: var(--bg-main);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.search-box {
  flex: 1;
  min-width: 240px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  color: var(--text-muted);
}

.search-box input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-sans);
}

.search-box input:focus {
  outline: none;
}

.filter-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-group select {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  padding: 8px 14px;
  font-size: 12px;
  cursor: pointer;
  outline: none;
}

.filter-group select:focus {
  border-color: var(--gold);
}

/* ============================================================
   5. KANBAN BOARD & DUAL EVENT SECTIONS
   ============================================================ */
.kanban-area {
  flex: 1;
  padding: 20px 24px;
  overflow-x: auto;
  background: var(--bg-main);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.event-board-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.event-board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
  gap: 12px;
}

.event-board-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.event-date-badge {
  padding: 4px 10px;
  background: rgba(197, 160, 89, 0.2);
  border: 1px solid var(--border-gold);
  color: var(--gold-light);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  border-radius: 4px;
}

.event-date-badge-imersao {
  background: rgba(6, 182, 212, 0.15);
  border-color: rgba(6, 182, 212, 0.4);
  color: var(--c-cyan);
}

.event-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: 0.5px;
}

.event-guest {
  font-size: 12px;
  color: var(--gold);
  font-weight: 600;
  background: rgba(197, 160, 89, 0.08);
  padding: 2px 8px;
  border-radius: 4px;
}

.event-board-stats {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stat-pill-mesa, .stat-pill-total {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 4px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
}

.stat-pill-mesa .pill-val {
  color: var(--c-emerald);
  font-weight: 800;
}

.stat-pill-total .pill-val {
  color: var(--gold-light);
  font-weight: 800;
}

/* Event Divider */
.event-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0 10px 0;
}

.event-divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-gold), transparent);
}

.event-divider-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold-light);
  padding: 4px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
}

.kanban-columns {
  display: flex;
  gap: 16px;
  min-width: max-content;
  align-items: flex-start;
}

.kanban-col {
  width: 320px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 240px);
}

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

.col-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.col-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.col-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--text-primary);
}

.col-count {
  background: var(--bg-surface);
  color: var(--text-secondary);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}

/* Col Dots */
.col-blue .col-dot { background: var(--c-blue); }
.col-amber .col-dot { background: var(--c-amber); }
.col-purple .col-dot { background: var(--c-purple); }
.col-cyan .col-dot { background: var(--c-cyan); }
.col-emerald .col-dot { background: var(--c-emerald); }
.col-gray .col-dot { background: var(--c-gray); }

.col-cards {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  flex: 1;
  min-height: 120px;
}

/* Custom Scrollbar */
.col-cards::-webkit-scrollbar { width: 5px; }
.col-cards::-webkit-scrollbar-thumb { background: var(--border-subtle); border-radius: 4px; }
.col-cards::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================================
   6. LEAD CARD
   ============================================================ */
.lead-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.lead-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(197, 160, 89, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.lead-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.lead-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.lead-event-pill {
  font-size: 9px;
  padding: 2px 6px;
  background: rgba(197, 160, 89, 0.15);
  border: 1px solid var(--border-gold);
  color: var(--gold-light);
  border-radius: 4px;
  font-weight: 600;
  white-space: nowrap;
}

.lead-specialty {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.lead-badges-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.revenue-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
}

.revenue-high {
  background: rgba(197, 160, 89, 0.2);
  color: var(--gold-light);
  border: 1px solid rgba(197, 160, 89, 0.4);
}

.utm-pill {
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  background: var(--bg-input);
  padding: 2px 6px;
  border-radius: 4px;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.lead-time {
  font-size: 11px;
  color: var(--text-muted);
}

.btn-card-wa {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #25D366;
  background: rgba(37, 211, 102, 0.1);
  padding: 4px 8px;
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-card-wa:hover {
  background: rgba(37, 211, 102, 0.2);
}

/* ============================================================
   7. MODAL STYLES
   ============================================================ */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-card {
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  background: var(--bg-surface);
}

.modal-event-tag {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gold-light);
  font-weight: 700;
  margin-bottom: 4px;
}

.modal-header h3 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
}

.modal-sub-info {
  font-size: 12px;
  color: var(--text-secondary);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
}

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

.modal-body {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  overflow-y: auto;
  flex: 1;
}

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

.modal-col-left {
  padding: 24px;
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-col-right {
  padding: 24px;
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dossier-section h4, .notes-section h4 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gold-light);
  margin-bottom: 10px;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.info-lbl {
  font-size: 11px;
  color: var(--text-muted);
}

.info-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.info-gold {
  color: var(--gold-light);
}

.btn-quick-wa {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #25D366;
  color: #0A0D14;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  width: fit-content;
}

.btn-quick-wa:hover {
  filter: brightness(1.1);
}

.modal-challenge-box {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.utm-pills-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.stage-control-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stage-control-box label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.stage-select {
  padding: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
}

.btn-save-stage {
  padding: 10px;
  background: var(--gold);
  color: #0A0D14;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-save-stage:hover {
  filter: brightness(1.1);
}

.add-note-box textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-sans);
  resize: vertical;
  margin-bottom: 8px;
}

.add-note-box textarea:focus {
  outline: none;
  border-color: var(--gold);
}

.btn-add-note {
  width: 100%;
  padding: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  color: var(--gold-light);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-add-note:hover {
  background: rgba(197, 160, 89, 0.15);
}

.notes-timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 240px;
  overflow-y: auto;
  margin-top: 10px;
}

.timeline-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.timeline-meta {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.timeline-author {
  font-weight: 700;
  color: var(--gold-light);
}

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

.note-empty {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 14px 0;
}
