/* ============================================================
   CENTRAL DE LEADS — estilos compartilhados
   Paleta: garagem/oficina — grafite + laranja sinalização
   Tipografia: Barlow Condensed (display/placas) + Inter (corpo)
   + JetBrains Mono (contadores, estilo painel/odômetro)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700;800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
  --bg: #14171c;
  --surface: #1c2027;
  --surface-2: #23282f;
  --border: #2d333c;
  --text: #edeff2;
  --text-muted: #8a93a3;
  --accent: #d91e2b;
  --accent-dark: #a8151f;
  --green: #2fbf71;
  --amber: #f2802b;
  --red: #e8432f;
  --blue: #2e86ff;
  --whatsapp: #25d366;
  --whatsapp-dark: #1da851;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin: 0;
}

a { color: inherit; }

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar .brand .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}
.topbar .brand h1 { font-size: 22px; color: var(--text); }
.topbar .brand img.logo-topo { height: 34px; width: auto; }
.topbar .user-info { font-size: 13px; color: var(--text-muted); display:flex; align-items:center; gap:12px; }

/* ---------- Layout ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 200px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 16px 0;
  flex-shrink: 0;
}
.sidebar button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 20px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  border-left: 3px solid transparent;
}
.sidebar button:hover { color: var(--text); background: var(--surface-2); }
.sidebar button.active { color: var(--accent); border-left-color: var(--accent); background: var(--surface-2); }

.main { flex: 1; padding: 24px; max-width: 1400px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- Cards / Forms ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}
.card h2 { font-size: 20px; margin-bottom: 16px; color: var(--text); }
.card h3 { font-size: 16px; color: var(--text-muted); margin-bottom: 10px; }

.form-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 160px; }
.field label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
input[type=text], input[type=password], input[type=tel], select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.radio-group { display: flex; gap: 16px; align-items: center; }
.radio-group label { display: flex; gap: 6px; align-items: center; font-size: 14px; color: var(--text); cursor: pointer; }

.btn {
  background: var(--accent);
  color: #14171c;
  border: none;
  padding: 10px 18px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn:hover { background: var(--accent-dark); }
.btn:disabled { background: var(--border); color: var(--text-muted); cursor: not-allowed; }
.btn.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn.secondary:hover { background: var(--border); }
.btn.danger { background: var(--red); color: #fff; }
.btn.whatsapp { background: var(--whatsapp); color: #06210f; }
.btn.whatsapp:hover { background: var(--whatsapp-dark); }
.btn.small { padding: 6px 12px; font-size: 12px; }

/* ---------- Table ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left;
  padding: 10px 12px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-family: 'Barlow Condensed', sans-serif;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}
td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:hover td { background: rgba(255,255,255,0.02); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge.tag-interno { background: rgba(47,191,113,0.15); color: var(--green); }
.badge.tag-externo { background: rgba(255,90,31,0.15); color: var(--accent); }

/* ---------- Contadores estilo painel/odômetro ---------- */
.timer {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.02em;
}
.timer::before { content: ''; width: 7px; height: 7px; border-radius: 50%; }
.timer.green { background: rgba(47,191,113,0.12); color: var(--green); border: 1px solid rgba(47,191,113,0.35); }
.timer.green::before { background: var(--green); box-shadow: 0 0 6px var(--green); }
.timer.amber { background: rgba(242,183,5,0.12); color: var(--amber); border: 1px solid rgba(242,183,5,0.35); }
.timer.amber::before { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.timer.red { background: rgba(232,67,47,0.14); color: var(--red); border: 1px solid rgba(232,67,47,0.4); animation: pulse 1.4s infinite; }
.timer.red::before { background: var(--red); box-shadow: 0 0 6px var(--red); }
.timer.blue { background: rgba(46,134,255,0.14); color: var(--blue); border: 1px solid rgba(46,134,255,0.4); }
.timer.blue::before { background: var(--blue); box-shadow: 0 0 6px var(--blue); }
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:0.55;} }

/* ---------- Tag chips (vendedor) ---------- */
.tag-select { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-chip {
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
}
.tag-chip.active { background: var(--accent); color: #14171c; border-color: var(--accent); font-weight: 700; }

/* ---------- Lead card (painel do vendedor) ---------- */
.lead-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}
.lead-card .lead-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; flex-wrap: wrap; gap: 8px; }
.lead-card .lead-name { font-family: 'Barlow Condensed', sans-serif; font-size: 20px; font-weight: 700; }
.lead-card .lead-meta { color: var(--text-muted); font-size: 13px; margin-top: 2px; }
.lead-card .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 20% 20%, rgba(217,30,43,0.10), transparent 40%),
    var(--bg);
}
.login-box {
  width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}
.login-box .logo { text-align: center; margin-bottom: 24px; }
.login-box .logo img.logo-login { max-width: 220px; height: auto; margin-bottom: 12px; }
.login-box .logo .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); display: inline-block; margin-bottom: 8px; }
.login-box .logo h1 { font-size: 30px; }
.login-box .logo p { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.login-tabs { display: flex; margin-bottom: 20px; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.login-tabs button { flex: 1; padding: 10px; background: var(--surface-2); border: none; color: var(--text-muted); font-weight: 700; cursor: pointer; font-family: 'Barlow Condensed', sans-serif; text-transform: uppercase; letter-spacing: 0.03em; }
.login-tabs button.active { background: var(--accent); color: #14171c; }
.login-box .btn { width: 100%; margin-top: 6px; padding: 12px; }
.error-msg { color: var(--red); font-size: 13px; margin-top: 10px; text-align: center; min-height: 16px; }

.checkbox-cell { text-align: center; }
.select-vendedor-inline { min-width: 150px; }

.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.muted { color: var(--text-muted); font-size: 13px; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state h3 { color: var(--text); margin-bottom: 6px; }

@media (max-width: 800px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; display: flex; overflow-x: auto; padding: 8px; }
  .sidebar button { border-left: none; border-bottom: 3px solid transparent; white-space: nowrap; }
  .sidebar button.active { border-bottom-color: var(--accent); border-left-color: transparent; }
  table { display: block; overflow-x: auto; }
}

/* ---------- Impressão (Relatório em PDF) ---------- */
@media print {
  .topbar, .sidebar, .no-print { display: none !important; }
  .shell, .main { display: block !important; padding: 0 !important; margin: 0 !important; max-width: 100% !important; }
  .tab-panel { display: none !important; }
  #tab-relatorio { display: block !important; }
  body { background: #fff !important; color: #111 !important; }
  .card { background: #fff !important; border: 1px solid #ccc !important; box-shadow: none !important; color: #111 !important; page-break-inside: avoid; }
  h1, h2, h3, .display { color: #111 !important; }
  table { color: #111 !important; }
  th { background: #eee !important; color: #333 !important; }
  td { border-bottom: 1px solid #ddd !important; }
  .muted { color: #666 !important; }
  .badge { border: 1px solid #999 !important; }
}
