:root {
  --purple: #8B1A8C;
  --purple-light: #a020a2;
  --purple-dark: #6a1269;
  --yellow: #F5C200;
  --yellow-light: #fff3cc;
  --bg: #f5f5f5;
  --white: #ffffff;
  --text: #222;
  --text-light: #666;
  --border: #e0e0e0;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); font-size: 15px; }

/* LOGIN */
#login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--purple) 0%, var(--purple-dark) 100%);
}
.login-box {
  background: var(--white); border-radius: var(--radius); padding: 40px 32px;
  width: 100%; max-width: 360px; text-align: center; box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.login-box h1 { color: var(--purple); font-size: 22px; margin-bottom: 4px; }
.login-box p { color: var(--text-light); font-size: 13px; margin-bottom: 28px; }
.login-box input {
  width: 100%; padding: 12px 16px; border: 2px solid var(--border);
  border-radius: 8px; font-size: 15px; margin-bottom: 12px; outline: none;
  transition: border-color 0.2s;
}
.login-box input:focus { border-color: var(--purple); }
.login-box .error { color: #e53935; font-size: 13px; margin-bottom: 8px; }

/* BOTÕES */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border: none; border-radius: 8px;
  font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.15s;
  text-decoration: none;
}
.btn-primary { background: var(--purple); color: var(--white); }
.btn-primary:hover { background: var(--purple-light); }
.btn-yellow { background: var(--yellow); color: var(--text); }
.btn-yellow:hover { background: #e6b800; }
.btn-ghost { background: transparent; color: var(--text-light); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg); }
.btn-danger { background: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }
.btn-danger:hover { background: #ffcdd2; }
.btn-full { width: 100%; justify-content: center; padding: 13px; font-size: 15px; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 6px; }

/* APP */
#app { display: none; min-height: 100vh; padding-bottom: 72px; }

/* HEADER */
.header {
  background: var(--purple); color: var(--white); padding: 16px 20px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.header h2 { font-size: 17px; font-weight: 700; }
.header .back-btn { background: none; border: none; color: white; font-size: 22px; cursor: pointer; padding: 0 8px 0 0; }

/* BOTTOM NAV */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; background: var(--white);
  border-top: 1px solid var(--border); display: flex; z-index: 100;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  padding: 10px 4px 8px; border: none; background: none; cursor: pointer;
  color: var(--text-light); font-size: 11px; font-weight: 500; gap: 3px;
  transition: color 0.15s;
}
.nav-item svg { width: 22px; height: 22px; }
.nav-item.active { color: var(--purple); }
.nav-item.active svg path, .nav-item.active svg circle, .nav-item.active svg rect { stroke: var(--purple); }

/* VIEWS */
.view { display: none; padding: 16px; }
.view.active { display: block; }

/* CARDS */
.card {
  background: var(--white); border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow);
}
.card-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }

/* MÉTRICAS */
.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.metric {
  background: var(--white); border-radius: var(--radius); padding: 14px 16px;
  box-shadow: var(--shadow); text-align: center;
}
.metric .value { font-size: 28px; font-weight: 700; color: var(--purple); }
.metric .label { font-size: 12px; color: var(--text-light); margin-top: 2px; }

/* LEAD ITEM */
.lead-item {
  background: var(--white); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 10px; box-shadow: var(--shadow);
  cursor: pointer; transition: box-shadow 0.15s; border-left: 4px solid transparent;
}
.lead-item:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
.lead-item.atrasado { border-left-color: #e53935; }
.lead-item.hoje { border-left-color: var(--yellow); }
.lead-name { font-weight: 600; font-size: 15px; margin-bottom: 2px; }
.lead-sub { font-size: 13px; color: var(--text-light); }
.lead-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

/* BADGES */
.badge {
  display: inline-flex; align-items: center; padding: 3px 8px;
  border-radius: 20px; font-size: 12px; font-weight: 600;
}
.badge-novo { background: #e3f2fd; color: #1565c0; }
.badge-em-conversa { background: #fff8e1; color: #e65100; }
.badge-follow-up { background: #fce4ec; color: #880e4f; }
.badge-inscrito { background: #e8f5e9; color: #2e7d32; }
.badge-perdido { background: #f5f5f5; color: #757575; }
.badge-lista-espera { background: #e8eaf6; color: #283593; }
.badge-presencial { background: #ede7f6; color: #4527a0; }
.badge-online { background: #e0f7fa; color: #006064; }
.badge-metodo-sala { background: var(--yellow-light); color: #7b4f00; }
.badge-urgente { background: #ffebee; color: #c62828; }

/* FORMULÁRIOS */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text-light); margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 12px 14px; border: 2px solid var(--border);
  border-radius: 8px; font-size: 15px; outline: none; font-family: inherit;
  transition: border-color 0.2s; background: white;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--purple); }
.form-group textarea { resize: vertical; min-height: 80px; }

/* SECTION TITLE */
.section-title {
  font-size: 13px; font-weight: 700; color: var(--text-light);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin: 20px 0 10px; padding: 0;
}

/* FILTROS */
.filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; }
.filters::-webkit-scrollbar { display: none; }
.filter-chip {
  flex-shrink: 0; padding: 6px 14px; border-radius: 20px; font-size: 13px;
  font-weight: 500; border: 2px solid var(--border); background: var(--white);
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.filter-chip.active { border-color: var(--purple); background: var(--purple); color: white; }

/* SEARCH */
.search-bar {
  width: 100%; padding: 11px 16px; border: 2px solid var(--border);
  border-radius: 24px; font-size: 15px; outline: none; margin-bottom: 14px;
  transition: border-color 0.2s;
}
.search-bar:focus { border-color: var(--purple); }

/* INTERAÇÕES */
.interaction {
  padding: 10px 14px; background: var(--bg); border-radius: 8px;
  margin-bottom: 8px; font-size: 14px;
}
.interaction .date { font-size: 11px; color: var(--text-light); margin-top: 4px; }

/* STATUS SELECTOR */
.status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.status-btn {
  padding: 10px 8px; border-radius: 8px; border: 2px solid var(--border);
  background: var(--white); cursor: pointer; text-align: center;
  font-size: 13px; font-weight: 600; transition: all 0.15s;
}
.status-btn.selected { border-color: var(--purple); background: #f3e5f5; color: var(--purple); }

/* FAB */
.fab {
  position: fixed; bottom: 84px; right: 20px;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--yellow); border: none; cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 300; transition: transform 0.15s;
  z-index: 50;
}
.fab:hover { transform: scale(1.05); }

/* EMPTY STATE */
.empty { text-align: center; padding: 40px 20px; color: var(--text-light); }
.empty .icon { font-size: 48px; margin-bottom: 12px; }
.empty p { font-size: 15px; }

/* DIVIDER */
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* ALERTA */
.alert {
  padding: 12px 16px; border-radius: 8px; font-size: 14px;
  margin-bottom: 12px; font-weight: 500;
}
.alert-warning { background: var(--yellow-light); color: #7b4f00; border-left: 4px solid var(--yellow); }
.alert-info { background: #e8f5e9; color: #2e7d32; border-left: 4px solid #4caf50; }

/* COURSE CARD */
.course-card {
  background: var(--white); border-radius: var(--radius);
  padding: 16px; margin-bottom: 10px; box-shadow: var(--shadow);
  border-left: 4px solid var(--purple);
}
.course-card.lotado { border-left-color: #ef5350; }
.course-card.encerrado { border-left-color: #9e9e9e; opacity: 0.7; }
.course-name { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.course-meta { font-size: 13px; color: var(--text-light); line-height: 1.6; }

/* MODAL */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 200; display: flex; align-items: flex-end; justify-content: center;
}
.modal {
  background: var(--white); border-radius: 20px 20px 0 0;
  padding: 24px 20px; width: 100%; max-width: 480px; max-height: 90vh;
  overflow-y: auto;
}
.modal-title { font-size: 17px; font-weight: 700; margin-bottom: 20px; }

@media (min-width: 480px) {
  .modal-overlay { align-items: center; }
  .modal { border-radius: 20px; max-height: 80vh; }
}
