/* GlobifyMedia Lead Intelligence — application styles */
:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --ink: #17212b;
  --ink-soft: #51606f;
  --ink-faint: #8595a5;
  --line: #e3e8ee;
  --brand: #0f62fe;
  --brand-dark: #0a4dc0;
  --brand-soft: #e8f0fe;
  --green: #12805c;
  --green-soft: #e2f5ec;
  --amber: #9a6700;
  --amber-soft: #fdf3d7;
  --red: #c62828;
  --red-soft: #fdeaea;
  --purple: #6941c6;
  --purple-soft: #f0eafd;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(23,33,43,.06), 0 4px 14px rgba(23,33,43,.05);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--ink);
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 21px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 0 0 10px; }
h3 { font-size: 14px; margin: 0 0 8px; }
p  { margin: 0 0 10px; }
.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12px; }
.nowrap { white-space: nowrap; }
code { font-family: var(--mono); background: var(--brand-soft); padding: 1px 5px; border-radius: 4px; font-size: 12px; }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; flex: 0 0 232px; background: #101b26; color: #c8d3de;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { padding: 18px 16px 14px; border-bottom: 1px solid #1d2c3a; }
.sidebar .brand .logo { display: flex; align-items: center; gap: 9px; font-weight: 700; color: #fff; font-size: 15px; }
.sidebar .brand .logo svg { flex: 0 0 auto; }
.sidebar .brand .sub { font-size: 11px; color: #7c8ea1; margin-top: 3px; }
.sidebar nav { padding: 10px 8px; flex: 1; overflow-y: auto; }
.sidebar nav a {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px; margin: 1px 0;
  color: #c8d3de; border-radius: 7px; font-weight: 500; font-size: 13.5px; text-decoration: none;
}
.sidebar nav a:hover { background: #1a2a3a; color: #fff; }
.sidebar nav a.active { background: var(--brand); color: #fff; }
.sidebar nav .nav-section { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: #64778c; padding: 14px 10px 5px; }
.sidebar .foot { padding: 12px 16px; border-top: 1px solid #1d2c3a; font-size: 12px; color: #7c8ea1; }
.sidebar .foot .dots { margin-top: 6px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: var(--panel); border-bottom: 1px solid var(--line);
  padding: 10px 26px; display: flex; align-items: center; gap: 14px; position: sticky; top: 0; z-index: 30;
}
.topbar .crumb { color: var(--ink-faint); font-size: 13px; }
.topbar .spacer { flex: 1; }
.content { padding: 24px 26px 60px; max-width: 1280px; width: 100%; }
.page-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .grow { flex: 1; min-width: 240px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  font-size: 13.5px; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.2;
}
.btn:hover { border-color: #c9d4df; text-decoration: none; box-shadow: var(--shadow); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-green { background: var(--green); border-color: var(--green); color: #fff; }
.btn-green:hover { background: #0d6a4c; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #a91f1f; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--brand); }
.btn-ghost:hover { background: var(--brand-soft); box-shadow: none; }
.btn-sm { padding: 4px 9px; font-size: 12.5px; border-radius: 6px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn .ic { font-size: 13px; }

/* ---------- cards / stats ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 18px; }
.card.tight { padding: 13px 16px; }
.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.grid.cols-6 { grid-template-columns: repeat(6, minmax(0,1fr)); }
@media (max-width: 1100px) { .grid.cols-4, .grid.cols-6 { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 860px)  { .grid.cols-2, .grid.cols-3, .grid.cols-4, .grid.cols-6 { grid-template-columns: repeat(2, minmax(0,1fr)); } .sidebar{display:none} }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.stat .lbl { font-size: 12px; color: var(--ink-soft); font-weight: 600; }
.stat .val { font-size: 26px; font-weight: 700; margin-top: 2px; }
.stat .sub { font-size: 11.5px; color: var(--ink-faint); }

/* hero (dashboard §78) */
.hero { background: linear-gradient(120deg, #0f1f33, #123a63); color: #fff; border-radius: 14px; padding: 30px 30px 26px; margin-bottom: 20px; box-shadow: var(--shadow); }
.hero h1 { font-size: 24px; color: #fff; }
.hero p { color: #b8c9dc; margin: 4px 0 18px; }
.hero .btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.hero .btn-hero { background: #fff; color: #123a63; border: none; font-size: 14px; padding: 11px 18px; }
.hero .btn-hero:hover { background: #e9f0f8; box-shadow: 0 6px 18px rgba(0,0,0,.25); }

/* ---------- badges / chips ---------- */
.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11.5px; font-weight: 700; }
.b-green { background: var(--green-soft); color: var(--green); }
.b-blue { background: var(--brand-soft); color: var(--brand-dark); }
.b-amber { background: var(--amber-soft); color: var(--amber); }
.b-red { background: var(--red-soft); color: var(--red); }
.b-purple { background: var(--purple-soft); color: var(--purple); }
.b-gray { background: #eef1f5; color: #5c6b7a; }
.chip { display: inline-block; background: var(--brand-soft); color: var(--brand-dark); padding: 3px 9px; border-radius: 6px; font-size: 12px; margin: 2px 3px 2px 0; font-weight: 600; }
.tag-fact { color: var(--green); font-weight: 700; }
.tag-inf { color: var(--purple); font-weight: 700; }
.tag-unk { color: var(--ink-faint); font-weight: 700; }

/* ---------- tables ---------- */
.tablewrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-faint);
  padding: 9px 10px; border-bottom: 1px solid var(--line); background: #fafbfd; white-space: nowrap; position: sticky; top: 0;
}
.tbl td { padding: 8px 10px; border-bottom: 1px solid #eef1f5; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: #f7f9fc; }
.tbl td.num { font-variant-numeric: tabular-nums; }
.tbl a.rowlink { font-weight: 600; }
.tbl .sub { display: block; font-size: 11.5px; color: var(--ink-faint); }

/* ---------- forms ---------- */
label.f { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=date], input[type=time], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #cbd5e0; border-radius: 7px; font: inherit; color: var(--ink);
  background: #fff; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15,98,254,.13); }
textarea { min-height: 90px; resize: vertical; }
.field { margin-bottom: 14px; }
.hint { font-size: 11.5px; color: var(--ink-faint); margin-top: 3px; }
.err-txt { color: var(--red); font-size: 12.5px; margin-top: 3px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 18px; }
@media (max-width: 800px) { .form-grid { grid-template-columns: 1fr; } }
.inline-fields { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.inline-fields .field { margin-bottom: 0; flex: 1; min-width: 140px; }

/* integration cards (spec §98) */
.intg { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 16px; }
.intg .head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.intg .head .name { font-weight: 700; }
.intg .head .cat { margin-left: auto; }
.intg .desc { font-size: 12.5px; color: var(--ink-soft); margin-bottom: 12px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.g { background: #1db954; box-shadow: 0 0 0 3px rgba(29,185,84,.18); }
.dot.a { background: #f5b301; box-shadow: 0 0 0 3px rgba(245,179,1,.18); }
.dot.r { background: #e04141; box-shadow: 0 0 0 3px rgba(224,65,65,.18); }
.dot.n { background: #c4ccd5; }

/* ---------- progress / pipeline ---------- */
.progress { background: #e9edf2; border-radius: 20px; height: 9px; overflow: hidden; }
.progress .bar { background: var(--brand); height: 100%; border-radius: 20px; transition: width .4s; }
.progress .bar.green { background: var(--green); }
.stages { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.stage { font-size: 11.5px; padding: 4px 10px; border-radius: 20px; background: #eef1f5; color: var(--ink-soft); font-weight: 600; }
.stage.done { background: var(--green-soft); color: var(--green); }
.stage.active { background: var(--brand); color: #fff; }
.stage.pending { opacity: .7; }

/* ---------- misc ---------- */
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 6px 14px; font-size: 13px; }
.kv dt { color: var(--ink-soft); font-weight: 600; }
.kv dd { margin: 0; }
.email-preview { border: 1px solid var(--line); border-radius: var(--radius); background: #fbfcfe; }
.email-preview .hdr { padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 13px; }
.email-preview .body { padding: 16px 18px; white-space: pre-wrap; font-size: 14px; line-height: 1.6; }
.alert { border-radius: 8px; padding: 11px 14px; margin-bottom: 14px; font-size: 13.5px; border: 1px solid transparent; }
.alert.ok { background: var(--green-soft); color: var(--green); border-color: #bfe7d4; }
.alert.err { background: var(--red-soft); color: var(--red); border-color: #f3c6c6; }
.alert.warn { background: var(--amber-soft); color: var(--amber); border-color: #efd98a; }
.alert.info { background: var(--brand-soft); color: var(--brand-dark); border-color: #c7d9f7; }
.scorebar { display: flex; gap: 4px; align-items: center; }
.scorebar .seg { width: 9px; height: 9px; border-radius: 2px; background: #e3e8ee; }
.scorebar .seg.on { background: var(--brand); }
.scorebar .seg.on.g { background: var(--green); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.filters select, .filters input { min-width: 120px; width: auto; }
.filters .field { margin: 0; }
.pager { display: flex; gap: 6px; align-items: center; margin-top: 12px; font-size: 13px; }
.filters-bar { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; font-weight: 600; color: var(--ink-soft); text-decoration: none; border-bottom: 2px solid transparent; font-size: 13.5px; }
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }
.toast-wrap { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #101b26; color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 13.5px; box-shadow: 0 8px 24px rgba(0,0,0,.28); max-width: 380px; }
.toast.ok { background: var(--green); } .toast.err { background: var(--red); }
.modal-back { position: fixed; inset: 0; background: rgba(10,18,26,.45); z-index: 150; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-back.open { display: flex; }
.modal { background: #fff; border-radius: 12px; padding: 22px; max-width: 560px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.3); max-height: 90vh; overflow-y: auto; }
.modal h3 { margin-top: 0; }
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { padding: 7px 0 7px 18px; border-left: 2px solid var(--line); position: relative; font-size: 13px; }
.activity li::before { content: ''; position: absolute; left: -5px; top: 13px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.activity li .t { color: var(--ink-faint); font-size: 11.5px; display: block; }
.right { text-align: right; }
.center { text-align: center; }
.flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.flex .grow { flex: 1; }
.mt0 { margin-top: 0; } .mb0 { margin-bottom: 0; } .mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; }
.insight { border-left: 3px solid var(--brand); background: #f7faff; padding: 10px 14px; border-radius: 0 8px 8px 0; margin-bottom: 8px; font-size: 13px; }
.insight.g { border-color: var(--green); background: #f4fcf8; }
.empty { padding: 40px 20px; text-align: center; color: var(--ink-faint); }
.empty .big { font-size: 30px; margin-bottom: 8px; }
input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--brand); }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #0f1f33, #123a63); padding: 20px; }
.login-card { background: #fff; border-radius: 14px; padding: 34px; width: 100%; max-width: 400px; box-shadow: 0 20px 70px rgba(0,0,0,.4); }
.login-card .logo { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.login-card h1 { font-size: 19px; }
.pct { font-size: 12px; color: var(--ink-soft); font-weight: 700; }
pre.json { background: #0f1b26; color: #c9e3ff; padding: 12px; border-radius: 8px; overflow-x: auto; font-size: 12px; font-family: var(--mono); }
.site-thumb { border: 1px solid var(--line); border-radius: 8px; max-width: 100%; }
.wscale { display: flex; gap: 2px; }
.wscale i { flex: 1; height: 7px; border-radius: 2px; background: #e3e8ee; }
.wscale i.on1 { background: #d97706; } .wscale i.on2 { background: #f5b301; } .wscale i.on3 { background: #16a34a; } .wscale i.on4 { background: #12805c; }
.bounce-note { font-size: 12px; }
hr.sep { border: none; border-top: 1px solid var(--line); margin: 14px 0; }
.batchgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 10px 0; }
.batchgrid .cell { background: #f7f9fc; border-radius: 8px; padding: 10px; text-align: center; }
.batchgrid .cell .n { font-size: 22px; font-weight: 700; }
