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

:root {
  --blue:     #1a56db;
  --blue-dk:  #1e429f;
  --green:    #057a55;
  --red:      #e02424;
  --bg:       #f3f4f6;
  --card:     #ffffff;
  --border:   #e5e7eb;
  --text:     #111827;
  --muted:    #6b7280;
  --tag-bg:   #e0e7ff;
  --tag-text: #3730a3;
  --radius:   8px;
  --shadow:   0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}

/* ── Botões ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .55rem 1.1rem; border-radius: var(--radius);
  font-size: .9rem; font-weight: 600; cursor: pointer;
  border: none; text-decoration: none; transition: opacity .15s, background .15s;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary  { background: var(--blue);  color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--blue-dk); }
.btn-outline  { background: transparent; color: var(--blue); border: 1.5px solid var(--blue); }
.btn-outline:hover { background: #eff6ff; }
.btn-danger   { background: var(--red);  color: #fff; }
.btn-sm       { padding: .3rem .75rem; font-size: .82rem; }
.btn-block    { width: 100%; }
.btn-green    { background: var(--green); color: #fff; }

/* ── Forms ── */
.field        { margin-bottom: 1rem; }
.field label  { display: block; font-weight: 600; font-size: .85rem; margin-bottom: .35rem; color: var(--muted); }
.field input, .field select {
  width: 100%; padding: .6rem .8rem;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  font-size: .95rem; transition: border .15s;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--blue); }
.field .hint  { font-size: .8rem; color: var(--muted); margin-top: .3rem; }
.form-error   { color: var(--red); font-size: .85rem; margin-top: .5rem; font-weight: 500; }
.form-success { color: var(--green); font-size: .85rem; margin-top: .5rem; font-weight: 500; }

/* ── Cards ── */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.25rem;
}

/* ── Badges / tags ── */
.badge {
  display: inline-block; padding: .2rem .55rem;
  border-radius: 99px; font-size: .75rem; font-weight: 600;
}
.badge-blue  { background: #dbeafe; color: var(--blue); }
.badge-green { background: #d1fae5; color: var(--green); }
.badge-gray  { background: var(--tag-bg); color: var(--tag-text); }
.badge-red   { background: #fee2e2; color: var(--red); }

/* ── Tag de termo ── */
.tag {
  display: inline-flex; align-items: center; gap: .35rem;
  background: var(--tag-bg); color: var(--tag-text);
  padding: .25rem .65rem; border-radius: 99px;
  font-size: .82rem; font-weight: 500;
}
.tag button {
  background: none; border: none; cursor: pointer;
  color: var(--tag-text); font-size: .9rem; line-height: 1;
  padding: 0; opacity: .6;
}
.tag button:hover { opacity: 1; }

/* ── Layout auth (login/cadastro) ── */
.auth-wrap {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 1.5rem;
}
.auth-box { width: 100%; max-width: 400px; }
.auth-logo { text-align: center; margin-bottom: 2rem; }
.auth-logo h1 { font-size: 1.5rem; color: var(--blue); font-weight: 800; }
.auth-logo p  { font-size: .85rem; color: var(--muted); }
.auth-tabs    { display: flex; margin-bottom: 1.5rem; border-bottom: 2px solid var(--border); }
.auth-tab     { flex: 1; padding: .7rem; text-align: center; font-weight: 600; cursor: pointer; font-size: .9rem; color: var(--muted); border: none; background: none; }
.auth-tab.active { color: var(--blue); border-bottom: 2px solid var(--blue); margin-bottom: -2px; }

/* ── Layout painel ── */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; background: var(--blue-dk); color: #fff;
  display: flex; flex-direction: column; flex-shrink: 0;
  padding: 1.5rem 1rem;
}
.sidebar .logo { font-size: 1.1rem; font-weight: 800; margin-bottom: 2rem; }
.sidebar .logo span { opacity: .7; font-size: .8rem; display: block; font-weight: 400; margin-top: .1rem; }
.nav-link {
  display: flex; align-items: center; gap: .6rem;
  padding: .6rem .8rem; border-radius: var(--radius);
  color: rgba(255,255,255,.75); font-size: .9rem; font-weight: 500;
  text-decoration: none; transition: background .15s;
}
.nav-link:hover, .nav-link.active { background: rgba(255,255,255,.15); color: #fff; }
.sidebar-footer { margin-top: auto; }
.sidebar-footer .email { font-size: .75rem; color: rgba(255,255,255,.5); margin-bottom: .5rem; }
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  background: var(--card); border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem; display: flex; align-items: center; justify-content: space-between;
}
.topbar h2 { font-size: 1.1rem; font-weight: 700; }
.content { padding: 1.5rem; overflow-y: auto; flex: 1; }

/* ── Oportunidade card ── */
.op-card {
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 1rem 1.25rem;
  margin-bottom: .75rem; transition: box-shadow .15s;
}
.op-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.op-card .op-title { font-weight: 600; font-size: .95rem; margin-bottom: .4rem; color: var(--text); }
.op-card .op-meta  { font-size: .8rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.op-card .op-actions { margin-top: .75rem; display: flex; gap: .5rem; align-items: center; }
.op-card .op-value { font-weight: 700; color: var(--green); font-size: .9rem; }
.op-card .op-prazo { font-size: .8rem; }
.op-card .op-prazo.urgente { color: var(--red); font-weight: 600; }

/* ── Grid stats ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card  { background: var(--card); border-radius: var(--radius); padding: 1rem 1.25rem; box-shadow: var(--shadow); }
.stat-card .stat-n  { font-size: 2rem; font-weight: 800; color: var(--blue); line-height: 1; }
.stat-card .stat-lbl { font-size: .8rem; color: var(--muted); margin-top: .2rem; }

/* ── Termos sidebar (painel) ── */
.termos-panel { background: var(--card); border-radius: var(--radius); padding: 1rem; }
.termos-panel h3 { font-size: .9rem; font-weight: 700; margin-bottom: .75rem; }
.termos-list  { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .75rem; }
.add-termo    { display: flex; gap: .4rem; }
.add-termo input { flex: 1; padding: .45rem .65rem; border: 1.5px solid var(--border); border-radius: var(--radius); font-size: .85rem; }
.add-termo input:focus { outline: none; border-color: var(--blue); }

/* ── Paginação ── */
.pagination { display: flex; gap: .5rem; justify-content: center; margin-top: 1.5rem; }
.page-btn   { padding: .4rem .9rem; border-radius: var(--radius); border: 1.5px solid var(--border); background: var(--card); cursor: pointer; font-size: .85rem; }
.page-btn.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── Loading / empty ── */
.loading { text-align: center; color: var(--muted); padding: 3rem; }
.empty   { text-align: center; color: var(--muted); padding: 3rem; }
.empty h3 { font-size: 1rem; margin-bottom: .5rem; }
.spinner  { display: inline-block; width: 22px; height: 22px; border: 3px solid #ddd; border-top-color: var(--blue); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Onboarding steps ── */
.steps { display: flex; gap: 0; margin-bottom: 2rem; }
.step  { flex: 1; text-align: center; position: relative; }
.step::after {
  content: ''; position: absolute; top: 14px; left: 50%; right: -50%;
  height: 2px; background: var(--border); z-index: 0;
}
.step:last-child::after { display: none; }
.step-dot {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--border); background: var(--card);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto .4rem; font-size: .75rem; font-weight: 700;
  position: relative; z-index: 1; color: var(--muted);
}
.step.active .step-dot  { border-color: var(--blue); color: var(--blue); background: #eff6ff; }
.step.done .step-dot    { border-color: var(--green); background: var(--green); color: #fff; }
.step-label { font-size: .72rem; color: var(--muted); }
.step.active .step-label { color: var(--blue); font-weight: 600; }

/* ── Onboarding layout ── */
.ob-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.ob-box  { width: 100%; max-width: 560px; }
.ob-logo { text-align: center; margin-bottom: 2rem; }
.ob-logo h1 { font-size: 1.4rem; font-weight: 800; color: var(--blue); }

/* ── Responsivo mobile ── */
@media (max-width: 640px) {
  .sidebar { width: 200px; }
  .content { padding: 1rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; padding: .75rem 1rem; align-items: center; }
  .sidebar .logo { margin-bottom: 0; margin-right: auto; }
  .sidebar-footer { margin-top: 0; }
  .nav-link span { display: none; }
}
