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

/* ============================================================
   RecomendaLeads — Design System
   Azul institucional (#2563EB) · Laranja só para ações (#F97316)
   ============================================================ */

:root {
  --brand: #2563EB;
  --brand-dark: #1D4ED8;
  --brand-soft: #EFF4FF;
  --brand-softer: #DBEAFE;

  --action: #F97316;
  --action-dark: #EA580C;
  --action-soft: #FFF1E8;

  --success: #22C55E;
  --success-dark: #15803D;
  --success-soft: #DCFCE7;

  --danger: #EF4444;
  --danger-dark: #B91C1C;
  --danger-soft: #FEE2E2;

  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-2: #F1F5F9;

  --text: #0F172A;
  --text-dim: #64748B;
  --text-faint: #94A3B8;

  --border: #E2E8F0;
  --border-strong: #CBD5E1;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-full: 999px;

  --shadow-sm: 0 1px 2px rgba(15,23,42,0.04), 0 1px 3px rgba(15,23,42,0.04);
  --shadow-md: 0 2px 4px rgba(15,23,42,0.04), 0 8px 24px rgba(15,23,42,0.06);
  --shadow-lg: 0 10px 40px rgba(15,23,42,0.10);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  --t-fast: 140ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.02em; color: var(--text); margin: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font); font-size: 0.92rem; font-weight: 600;
  padding: 11px 20px; border-radius: var(--r-md);
  border: 1px solid transparent; cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: default; transform: none; }
.btn .ti, .btn svg { width: 18px; height: 18px; }

.btn-action { background: var(--action); color: #fff; }
.btn-action:hover { background: var(--action-dark); }

.btn-brand { background: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-dark); }

.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--border-strong); background: var(--surface-2); }

.btn-ghost { background: transparent; color: var(--text-dim); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.btn-danger { background: var(--surface); color: var(--danger-dark); border-color: var(--danger-soft); }
.btn-danger:hover { background: var(--danger-soft); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t-base), transform var(--t-base);
}
.metric-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.metric-card .m-label { font-size: 0.78rem; color: var(--text-dim); font-weight: 500; display: flex; align-items: center; gap: 8px; }
.metric-card .m-label .ti { width: 16px; height: 16px; color: var(--brand); }
.metric-card .m-value { font-size: 2rem; font-weight: 700; letter-spacing: -0.03em; margin-top: 12px; }
.metric-card .m-value.sm { font-size: 1.15rem; }

/* ---------- Inputs ---------- */
.label { display: block; font-size: 0.82rem; color: var(--text-dim); font-weight: 500; margin: 14px 0 7px; }
.input, .textarea, input.input, textarea.textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 14px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--font);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.textarea { resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.input:focus, .textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.hint { font-size: 0.78rem; color: var(--text-dim); margin-top: 6px; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.74rem; font-weight: 600; padding: 4px 11px; border-radius: var(--r-full);
}
.badge-brand { background: var(--brand-soft); color: var(--brand-dark); }
.badge-success { background: var(--success-soft); color: var(--success-dark); }
.badge-danger { background: var(--danger-soft); color: var(--danger-dark); }
.badge-muted { background: var(--surface-2); color: var(--text-dim); }

/* ---------- App shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 244px; flex-shrink: 0;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 20px 14px;
  position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; }
.sidebar .brand .logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--brand); color: #fff; display: grid; place-items: center;
}
.sidebar .brand .logo .ti { width: 20px; height: 20px; }
.sidebar .brand b { font-size: 1rem; letter-spacing: -0.02em; }
.sidebar .brand span { display: block; font-size: 0.64rem; color: var(--text-faint); letter-spacing: 0.8px; text-transform: uppercase; }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--r-md);
  color: var(--text-dim); font-size: 0.9rem; font-weight: 500;
  cursor: pointer; border: none; background: transparent; width: 100%; text-align: left;
  transition: background var(--t-fast), color var(--t-fast);
}
.nav-item .ti { width: 19px; height: 19px; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }

.user-box { display: flex; align-items: center; gap: 10px; padding: 12px 8px 2px; border-top: 1px solid var(--border); margin-top: 8px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 0.9rem; }
.user-box .meta { flex: 1; min-width: 0; }
.user-box .meta b { font-size: 0.85rem; display: block; }
.user-box .meta small { font-size: 0.7rem; color: var(--text-dim); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Main / page head ---------- */
.main { flex: 1; padding: 32px 40px 64px; max-width: 1120px; }
.page-head h1 { font-size: 1.6rem; margin-bottom: 5px; }
.page-head p { color: var(--text-dim); margin: 0 0 28px; font-size: 0.95rem; }

/* ---------- Grids ---------- */
.grid { display: grid; gap: 16px; }
.grid-metrics { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-tiles { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

.tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 20px; cursor: pointer; text-decoration: none; color: inherit;
  box-shadow: var(--shadow-sm); transition: border-color var(--t-base), transform var(--t-base), box-shadow var(--t-base);
}
.tile:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.tile .ic { width: 40px; height: 40px; border-radius: var(--r-md); background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin-bottom: 14px; }
.tile .ic .ti { width: 20px; height: 20px; }
.tile b { display: block; font-size: 0.95rem; }
.tile small { color: var(--text-dim); font-size: 0.8rem; }

/* ---------- Status messages ---------- */
.status-msg { font-size: 0.85rem; font-weight: 600; }
.status-msg.ok { color: var(--success-dark); }
.status-msg.err { color: var(--danger-dark); }

/* ---------- Microinterações ---------- */
.fade-in { animation: fadeIn var(--t-base); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Responsivo ---------- */
@media (max-width: 860px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; padding: 10px 12px; overflow-x: auto; }
  .sidebar .brand { padding: 0 12px 0 4px; }
  .nav { flex-direction: row; }
  .nav-item span.txt { display: none; }
  .user-box { border-top: none; margin: 0; padding-left: 8px; }
  .user-box .meta { display: none; }
  .main { padding: 22px 16px 50px; }
}
