/* Outbound Engine admin — modern, clean, light design system. One look across Import / Settings / Leads. */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --text: #111827;
  --text-2: #374151;
  --muted: #6b7280;
  --faint: #9ca3af;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef2ff;
  --good: #16a34a; --good-soft: #ecfdf3;
  --warm: #b45309; --warm-soft: #fff7ed;
  --cold: #1d4ed8; --cold-soft: #eff6ff;
  --danger: #dc2626; --danger-soft: #fef2f2;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
  --shadow-md: 0 4px 12px rgba(16,24,40,.08);
  --radius: 12px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── top nav ─────────────────────────────────────────────── */
.topnav {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255,255,255,.85); backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.topnav .bar { max-width: 1100px; margin: 0 auto; padding: 0 22px; height: 56px; display: flex; align-items: center; gap: 22px; }
.brand { font-weight: 700; font-size: 15px; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; color: var(--text); }
.brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.topnav nav { display: flex; gap: 4px; margin-left: auto; }
.topnav nav a {
  padding: 7px 13px; border-radius: 8px; font-size: 13.5px; font-weight: 500; color: var(--muted);
}
.topnav nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.topnav nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
/* Operator-only link — pushed right + de-emphasized so reps focus on Add Leads / My Leads / Help. */
.topnav nav a.nav-admin { margin-left: auto; opacity: 0.55; font-size: 12.5px; }
.topnav nav a.nav-admin:hover { opacity: 1; }
.topnav nav { display: flex; align-items: center; gap: 2px; flex: 1; }

/* ── layout ──────────────────────────────────────────────── */
.wrap { max-width: 1100px; margin: 0 auto; padding: 30px 22px 90px; }
.wrap.narrow { max-width: 760px; }
h1 { font-size: 26px; letter-spacing: -.02em; margin: 0 0 6px; }
h2.section { font-size: 17px; letter-spacing: -.01em; margin: 34px 0 4px; }
.sub { color: var(--muted); margin: 0 0 22px; font-size: 14.5px; }
.eyebrow { text-transform: uppercase; letter-spacing: .06em; font-size: 11px; font-weight: 700; color: var(--accent); margin-bottom: 6px; }

/* ── cards ───────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.card.pad-lg { padding: 26px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; flex-wrap: wrap; }
.card-head h3 { margin: 0; font-size: 15.5px; letter-spacing: -.01em; }

/* ── explainer / how-it-works ────────────────────────────── */
.explain { background: var(--accent-soft); border: 1px solid #e0e7ff; border-radius: var(--radius); padding: 18px 20px; margin-bottom: 24px; }
.explain h3 { margin: 0 0 8px; font-size: 14px; color: var(--accent); display: flex; align-items: center; gap: 8px; }
.explain ol { margin: 0; padding-left: 20px; }
.explain li { margin: 5px 0; font-size: 13.5px; color: var(--text-2); }
.flow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); margin-top: 8px; }
.flow .step { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 6px 11px; font-weight: 500; }
.flow .arrow { color: var(--faint); }

/* ── forms ───────────────────────────────────────────────── */
label { display: block; font-weight: 600; margin: 0 0 6px; font-size: 13px; color: var(--text-2); }
.help { color: var(--muted); font-weight: 400; font-size: 12.5px; margin: 3px 0 9px; line-height: 1.5; }
.hint { color: var(--faint); font-weight: 400; font-size: 12px; }
input[type=text], input[type=password], select, textarea, input[type=file] {
  width: 100%; padding: 10px 12px; border-radius: 9px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font-size: 14px; font-family: inherit;
}
textarea { line-height: 1.5; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field { margin-bottom: 15px; }
.row { display: flex; gap: 15px; flex-wrap: wrap; }
.row > .field { flex: 1; min-width: 200px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ── buttons ─────────────────────────────────────────────── */
button, .btn {
  display: inline-flex; align-items: center; gap: 7px; background: var(--accent); color: #fff; border: 0;
  border-radius: 9px; padding: 10px 18px; font-weight: 600; font-size: 14px; cursor: pointer; font-family: inherit;
}
button:hover, .btn:hover { background: var(--accent-hover); }
button.secondary { background: var(--surface); color: var(--text-2); border: 1px solid var(--border-strong); }
button.secondary:hover { background: var(--surface-2); }
button.danger-ghost { background: none; color: var(--danger); border: 1px solid #f0caca; padding: 7px 12px; font-size: 12.5px; }
button.danger-ghost:hover { background: var(--danger-soft); }
button:disabled { opacity: .45; cursor: not-allowed; }

/* ── badges ──────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 20px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.badge.cold { background: var(--cold-soft); color: var(--cold); border-color: #dbeafe; }
.badge.warm { background: var(--warm-soft); color: var(--warm); border-color: #fde7cf; }
.badge.good { background: var(--good-soft); color: var(--good); border-color: #d1fae5; }
.badge.danger { background: var(--danger-soft); color: var(--danger); border-color: #fadcdc; }
.badge.accent { background: var(--accent-soft); color: var(--accent); border-color: #e0e7ff; }
.tag { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--muted); background: var(--surface-2); padding: 1px 7px; border-radius: 5px; border: 1px solid var(--border); }

/* ── stats ───────────────────────────────────────────────── */
.stats { display: flex; gap: 14px; flex-wrap: wrap; margin: 4px 0 20px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow); min-width: 120px; }
.stat .n { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.stat .l { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

/* ── table ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th { position: sticky; top: 56px; background: var(--surface-2); text-align: left; padding: 10px 12px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-bottom: 1px solid var(--border); }
tbody td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-2); }

/* ── chips (filters) ─────────────────────────────────────── */
.chips { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin: 8px 0 16px; }
.chips .lbl { font-size: 12px; font-weight: 600; color: var(--muted); margin-right: 2px; }
.chip { display: inline-block; padding: 5px 12px; border-radius: 20px; font-size: 12.5px; text-decoration: none; background: var(--surface); border: 1px solid var(--border-strong); color: var(--text-2); }
.chip:hover { border-color: var(--accent); text-decoration: none; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── messages / banners ──────────────────────────────────── */
.msg { padding: 11px 14px; border-radius: 9px; margin: 12px 0; font-size: 13.5px; }
.msg.ok { background: var(--good-soft); border: 1px solid #bbf7d0; color: #15803d; }
.msg.err { background: var(--danger-soft); border: 1px solid #fadcdc; color: #b91c1c; }
.saved { background: var(--good-soft); border: 1px solid #bbf7d0; color: #15803d; padding: 11px 14px; border-radius: 9px; margin-bottom: 18px; font-size: 13.5px; }

.empty { color: var(--faint); }
.hidden { display: none; }
code { background: var(--surface-2); padding: 1px 6px; border-radius: 5px; font-size: 13px; border: 1px solid var(--border); }
.mapping-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; align-items: center; }
.mapping-grid .src { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; font-family: ui-monospace, Menlo, monospace; }
details summary { cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--accent); }
hr.div { border: 0; border-top: 1px solid var(--border); margin: 22px 0; }
