:root {
  --bg: #f5f6fb;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --surface-3: #eef0f7;
  --text: #161824;
  --muted: #6f7386;
  --muted-2: #9a9daf;
  --line: #e8e9f1;
  --line-strong: #dfe1eb;
  --primary: #6557e8;
  --primary-600: #5748db;
  --primary-100: #eeebff;
  --purple: #8b5cf6;
  --orange: #f97042;
  --orange-100: #fff1eb;
  --blue: #4376f7;
  --blue-100: #edf3ff;
  --green: #19a974;
  --green-100: #eaf8f2;
  --red: #e84c64;
  --red-100: #fff0f3;
  --yellow: #d49a13;
  --yellow-100: #fff8e6;
  --cyan: #13a9b8;
  --shadow-xs: 0 1px 2px rgba(18, 22, 47, .04);
  --shadow-sm: 0 7px 18px rgba(24, 27, 58, .06);
  --shadow-md: 0 18px 42px rgba(25, 27, 58, .10);
  --radius-sm: 9px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --nav-h: 72px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 2%, rgba(101, 87, 232, .08), transparent 23%),
    radial-gradient(circle at 96% 14%, rgba(67, 118, 247, .06), transparent 22%),
    var(--bg);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.app-shell { min-height: 100vh; }
.global-nav {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.88);
  border-bottom: 1px solid rgba(223,225,235,.8);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 212px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px; position: relative; display: grid; place-items: center;
  background: linear-gradient(145deg, #7466f1, #5140d3); box-shadow: 0 8px 18px rgba(101,87,232,.28);
}
.brand-mark span { position: absolute; display: block; border-radius: 4px; background: #fff; }
.brand-mark span:nth-child(1) { width: 6px; height: 12px; left: 9px; bottom: 9px; opacity:.7; }
.brand-mark span:nth-child(2) { width: 6px; height: 18px; left: 16px; bottom: 9px; opacity:.85; }
.brand-mark span:nth-child(3) { width: 6px; height: 23px; left: 23px; bottom: 9px; }
.brand-copy, .user-copy { display:flex; flex-direction:column; line-height:1.15; }
.brand-copy strong { font-size: 15px; letter-spacing: -.2px; }
.brand-copy small, .user-copy small { color: var(--muted-2); margin-top: 4px; font-size: 11px; }
.nav-links { display: flex; align-items: center; gap: 4px; flex: 1; }
.nav-link {
  border: 0; background: transparent; color: var(--muted); padding: 10px 13px; border-radius: 10px;
  display:flex; align-items:center; gap:8px; font-weight: 650; transition: .2s ease;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active { background: var(--primary-100); color: var(--primary-600); }
.nav-icon { width: 18px; text-align:center; font-size:17px; }
.nav-actions { display:flex; align-items:center; gap:10px; }
.system-status { display:flex; align-items:center; gap:7px; color:#338266; background:#edf9f4; border:1px solid #d9f0e6; padding:8px 10px; border-radius:999px; font-size:12px; font-weight:650; }
.system-status span { width:7px; height:7px; border-radius:50%; background:#19a974; box-shadow:0 0 0 4px rgba(25,169,116,.12); }
.icon-button { width:38px; height:38px; border:1px solid var(--line); background:#fff; border-radius:11px; position:relative; color:var(--muted); }
.notification-dot { width:6px; height:6px; border-radius:50%; background:var(--red); position:absolute; top:8px; right:8px; border:1px solid #fff; }
.user-menu { border:0; background:transparent; display:flex; align-items:center; gap:9px; padding:5px 4px 5px 6px; border-radius:12px; }
.user-menu:hover { background:var(--surface-2); }
.avatar { width:34px; height:34px; display:grid; place-items:center; border-radius:10px; font-size:11px; font-weight:800; color:#fff; background:linear-gradient(135deg,#171a29,#52566f); }
.user-copy { text-align:left; min-width:92px; }
.user-copy strong { font-size:12px; }
.mobile-nav-toggle { display:none; border:0; background:transparent; font-size:24px; }

.page { max-width: 1540px; margin: 0 auto; padding: 28px 30px 56px; animation: pageIn .28s ease; }
@keyframes pageIn { from { opacity:0; transform:translateY(5px); } to { opacity:1; transform:none; } }
.page-header { display:flex; justify-content:space-between; gap:22px; align-items:flex-start; margin-bottom:24px; }
.page-title-wrap { display:flex; gap:14px; align-items:center; }
.page-icon { width:46px; height:46px; border-radius:15px; display:grid; place-items:center; font-size:21px; box-shadow:var(--shadow-sm); }
.icon-hub { background:linear-gradient(145deg,#6557e8,#8b5cf6); color:white; }
.icon-scraper { background:linear-gradient(145deg,#ff8b52,#e8583d); color:white; }
.icon-pool { background:linear-gradient(145deg,#4f7df2,#7656e6); color:white; }
.icon-email { background:linear-gradient(145deg,#1cb984,#19a6b2); color:white; }
h1,h2,h3,h4,p { margin-top:0; }
h1 { font-size:27px; letter-spacing:-.7px; margin-bottom:5px; }
.page-subtitle { color:var(--muted); margin:0; line-height:1.5; }
.header-actions { display:flex; gap:10px; align-items:center; }

.button { border:1px solid var(--line-strong); background:#fff; color:var(--text); border-radius:11px; padding:10px 14px; font-weight:700; display:inline-flex; align-items:center; justify-content:center; gap:8px; transition:.18s ease; white-space:nowrap; box-shadow:var(--shadow-xs); }
.button:hover { transform:translateY(-1px); border-color:#cfd2df; box-shadow:var(--shadow-sm); }
.button.primary { color:#fff; border-color:transparent; background:linear-gradient(135deg,var(--primary),#7967ed); box-shadow:0 8px 18px rgba(101,87,232,.22); }
.button.orange { color:#fff; border-color:transparent; background:linear-gradient(135deg,#ff8a4d,#ed5c3c); box-shadow:0 8px 18px rgba(240,103,62,.22); }
.button.green { color:#fff; border-color:transparent; background:linear-gradient(135deg,#1db27e,#13a9b8); box-shadow:0 8px 18px rgba(25,169,116,.20); }
.button.danger { color:var(--red); border-color:#f4cdd4; background:#fff8f9; }
.button.small { padding:7px 10px; font-size:12px; border-radius:9px; }
.button.icon-only { width:38px; height:38px; padding:0; }
.button:disabled { opacity:.55; cursor:not-allowed; transform:none; }

.kpi-grid { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:14px; margin-bottom:20px; }
.kpi-grid.five { grid-template-columns:repeat(5,minmax(0,1fr)); }
.kpi-grid.four { grid-template-columns:repeat(4,minmax(0,1fr)); }
.kpi-card { background:rgba(255,255,255,.94); border:1px solid var(--line); border-radius:16px; padding:16px; box-shadow:var(--shadow-xs); min-height:112px; position:relative; overflow:hidden; }
.kpi-card:after { content:""; position:absolute; width:70px; height:70px; right:-28px; top:-30px; border-radius:50%; background:var(--tint,var(--primary-100)); }
.kpi-top { display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; }
.kpi-label { color:var(--muted); font-size:12px; font-weight:650; }
.kpi-symbol { width:30px; height:30px; display:grid; place-items:center; border-radius:9px; background:var(--tint,var(--primary-100)); color:var(--accent,var(--primary)); font-weight:800; }
.kpi-value { font-size:25px; letter-spacing:-.7px; font-weight:800; margin-bottom:7px; }
.kpi-delta { color:var(--muted); font-size:11px; }
.kpi-delta b { color:var(--green); }
.kpi-delta.warn b { color:var(--yellow); }

.card { background:rgba(255,255,255,.96); border:1px solid var(--line); border-radius:var(--radius-lg); box-shadow:var(--shadow-xs); }
.card-header { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:18px 20px; border-bottom:1px solid var(--line); }
.card-header h2,.card-header h3 { margin:0; font-size:15px; letter-spacing:-.2px; }
.card-header p { margin:4px 0 0; color:var(--muted); font-size:12px; }
.card-body { padding:20px; }
.section-heading { display:flex; justify-content:space-between; align-items:end; margin:26px 0 14px; }
.section-heading h2 { font-size:18px; margin:0 0 4px; letter-spacing:-.35px; }
.section-heading p { color:var(--muted); margin:0; font-size:12px; }
.text-link { border:0; background:transparent; color:var(--primary); font-weight:700; }

.hero-panel { background:linear-gradient(130deg,#171a2b 0%,#262449 58%,#403796 130%); color:white; padding:28px; border-radius:24px; position:relative; overflow:hidden; display:grid; grid-template-columns:1.1fr .9fr; align-items:center; gap:28px; box-shadow:0 18px 38px rgba(30,31,65,.18); margin-bottom:18px; }
.hero-panel:before,.hero-panel:after { content:""; position:absolute; border-radius:50%; filter:blur(2px); }
.hero-panel:before { width:320px; height:320px; background:rgba(117,99,244,.17); top:-170px; right:8%; }
.hero-panel:after { width:180px; height:180px; background:rgba(28,185,132,.10); bottom:-110px; left:36%; }
.hero-copy { position:relative; z-index:1; }
.eyebrow { display:inline-flex; align-items:center; gap:7px; color:#d7d3ff; border:1px solid rgba(220,216,255,.18); background:rgba(255,255,255,.06); padding:6px 9px; border-radius:999px; font-size:11px; font-weight:750; margin-bottom:12px; }
.hero-copy h2 { font-size:26px; line-height:1.2; letter-spacing:-.7px; margin:0 0 9px; max-width:570px; }
.hero-copy p { color:#bcbfd1; max-width:620px; line-height:1.55; margin-bottom:18px; }
.hero-actions { display:flex; gap:10px; }
.hero-actions .button:not(.primary) { color:#fff; border-color:rgba(255,255,255,.15); background:rgba(255,255,255,.08); box-shadow:none; }
.pipeline-mini { position:relative; z-index:1; display:flex; align-items:center; justify-content:center; gap:8px; }
.pipeline-node { flex:1; min-width:0; background:rgba(255,255,255,.09); border:1px solid rgba(255,255,255,.13); border-radius:16px; padding:14px 10px; text-align:center; backdrop-filter:blur(8px); }
.pipeline-node b { display:block; font-size:12px; margin-top:8px; }
.pipeline-node small { color:#aeb1c6; font-size:10px; }
.pipeline-node .node-icon { width:34px; height:34px; display:grid; place-items:center; border-radius:10px; margin:auto; background:rgba(255,255,255,.12); font-size:17px; }
.pipeline-arrow { color:#777b94; font-size:18px; }

.tool-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.tool-card { background:#fff; border:1px solid var(--line); border-radius:20px; overflow:hidden; box-shadow:var(--shadow-xs); transition:.2s ease; }
.tool-card:hover { transform:translateY(-3px); box-shadow:var(--shadow-md); }
.tool-card-top { padding:20px; display:flex; align-items:flex-start; justify-content:space-between; }
.tool-icon { width:46px; height:46px; border-radius:14px; color:white; display:grid; place-items:center; font-size:21px; }
.tool-card:nth-child(1) .tool-icon { background:linear-gradient(145deg,#ff8c52,#e95b3d); }
.tool-card:nth-child(2) .tool-icon { background:linear-gradient(145deg,#4a7cf3,#7657e6); }
.tool-card:nth-child(3) .tool-icon { background:linear-gradient(145deg,#1cb57f,#14a5b4); }
.health-badge { padding:5px 8px; border-radius:999px; color:var(--green); background:var(--green-100); font-size:10px; font-weight:750; }
.tool-card-main { padding:0 20px 16px; }
.tool-card-main h3 { font-size:17px; margin:0 0 7px; }
.tool-card-main p { color:var(--muted); font-size:12px; line-height:1.55; min-height:38px; }
.mini-stats { display:grid; grid-template-columns:repeat(3,1fr); border-top:1px solid var(--line); border-bottom:1px solid var(--line); }
.mini-stat { padding:13px 16px; border-right:1px solid var(--line); }
.mini-stat:last-child { border:0; }
.mini-stat strong { display:block; font-size:15px; }
.mini-stat span { display:block; color:var(--muted); font-size:10px; margin-top:3px; }
.tool-card-footer { padding:14px 16px; display:flex; justify-content:space-between; align-items:center; }
.tool-card-footer small { color:var(--muted); }

.activity-grid { display:grid; grid-template-columns:1.1fr .9fr; gap:16px; }
.activity-list { list-style:none; padding:0; margin:0; }
.activity-item { display:flex; gap:12px; align-items:flex-start; padding:13px 0; border-bottom:1px solid var(--line); }
.activity-item:first-child { padding-top:0; }
.activity-item:last-child { border:0; padding-bottom:0; }
.activity-dot { width:32px; height:32px; border-radius:10px; display:grid; place-items:center; flex:0 0 auto; }
.activity-dot.orange{background:var(--orange-100);color:var(--orange)} .activity-dot.blue{background:var(--blue-100);color:var(--blue)} .activity-dot.green{background:var(--green-100);color:var(--green)}
.activity-copy { flex:1; min-width:0; }
.activity-copy strong { display:block; font-size:12px; }
.activity-copy span { display:block; color:var(--muted); font-size:11px; margin-top:4px; }
.activity-time { color:var(--muted-2); font-size:10px; white-space:nowrap; }
.chart-bars { display:flex; gap:10px; height:170px; align-items:end; padding-top:10px; }
.chart-col { flex:1; display:flex; align-items:center; flex-direction:column; gap:7px; height:100%; justify-content:flex-end; }
.chart-bar { width:100%; max-width:35px; min-height:8px; border-radius:8px 8px 3px 3px; background:linear-gradient(180deg,#7869eb,#b7aff9); position:relative; }
.chart-col small { color:var(--muted-2); font-size:10px; }

/* scraper */
.split-layout { display:grid; grid-template-columns:340px minmax(0,1fr); gap:18px; align-items:start; }
.sidebar-stack { display:grid; gap:16px; position:sticky; top:calc(var(--nav-h) + 20px); }
.form-card { padding:18px; }
.form-title { display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; }
.form-title h2 { font-size:15px; margin:0; }
.form-group { margin-bottom:14px; }
.form-label { display:flex; justify-content:space-between; color:#4e5265; font-weight:700; font-size:11px; margin-bottom:7px; }
.form-hint { color:var(--muted-2); font-weight:500; }
.input,.select,.textarea { width:100%; border:1px solid var(--line-strong); background:#fff; border-radius:11px; padding:10px 12px; color:var(--text); outline:none; transition:.18s ease; }
.input:focus,.select:focus,.textarea:focus { border-color:#a89ff3; box-shadow:0 0 0 4px rgba(101,87,232,.08); }
.textarea { min-height:92px; resize:vertical; line-height:1.45; }
.form-row { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.range-wrap { display:grid; grid-template-columns:1fr 38px; gap:10px; align-items:center; }
.range { accent-color:var(--primary); width:100%; }
.range-value { height:34px; display:grid; place-items:center; border:1px solid var(--line); border-radius:9px; background:var(--surface-2); font-weight:800; }
.job-list { padding:8px 16px 12px; }
.job-item { padding:12px 0; border-bottom:1px solid var(--line); }
.job-item:last-child { border:0; }
.job-top { display:flex; justify-content:space-between; gap:8px; }
.job-name { font-size:12px; font-weight:750; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.job-meta { display:flex; justify-content:space-between; color:var(--muted); font-size:10px; margin-top:5px; }
.job-actions { display:flex; gap:8px; margin-top:9px; }
.status { display:inline-flex; align-items:center; gap:5px; font-size:10px; font-weight:750; padding:4px 7px; border-radius:999px; }
.status.done,.status.completed { color:#23855f; background:var(--green-100); }
.status.running,.status.sending { color:#5b50c7; background:var(--primary-100); }
.status.failed { color:var(--red); background:var(--red-100); }
.status.paused { color:var(--yellow); background:var(--yellow-100); }
.status.draft { color:var(--muted); background:var(--surface-3); }
.progress-card { padding:17px 18px; margin-bottom:14px; display:none; }
.progress-card.visible { display:block; animation:pageIn .22s ease; }
.progress-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; }
.progress-head strong { font-size:13px; }
.progress-track { height:9px; border-radius:999px; background:#eceef5; overflow:hidden; }
.progress-fill { height:100%; width:0; border-radius:inherit; background:linear-gradient(90deg,#f97042,#ffab5d); transition:width .35s ease; }
.progress-meta { display:flex; justify-content:space-between; color:var(--muted); font-size:10px; margin-top:8px; }
.data-card { overflow:hidden; }
.toolbar { display:flex; gap:9px; align-items:center; flex-wrap:wrap; padding:13px 14px; border-bottom:1px solid var(--line); }
.searchbox { position:relative; min-width:210px; flex:1; max-width:330px; }
.searchbox input { padding-left:35px; }
.searchbox:before { content:"⌕"; position:absolute; left:12px; top:9px; color:var(--muted); font-size:17px; }
.toolbar-spacer { flex:1; }
.table-wrap { overflow:auto; }
table { width:100%; border-collapse:separate; border-spacing:0; min-width:940px; }
th { position:sticky; top:0; z-index:1; background:#f8f9fc; color:#686c7f; font-size:10px; text-transform:uppercase; letter-spacing:.45px; text-align:left; padding:11px 13px; border-bottom:1px solid var(--line); font-weight:800; }
td { padding:12px 13px; border-bottom:1px solid #eff0f5; font-size:11px; color:#414557; vertical-align:middle; }
tbody tr { transition:.16s ease; }
tbody tr:hover { background:#fafaff; }
tbody tr.clickable { cursor:pointer; }
tbody tr.selected { background:#f4f2ff; }
.company-cell strong { display:block; color:#232637; font-size:11.5px; }
.company-cell small { display:block; color:var(--muted-2); margin-top:3px; }
.rating { color:#d58a0b; font-weight:750; }
.source-badge,.industry-badge,.quality-badge,.email-badge { display:inline-flex; align-items:center; gap:4px; border-radius:7px; padding:5px 7px; font-size:9px; font-weight:800; white-space:nowrap; }
.source-badge.gmap { background:var(--orange-100); color:#d75934; }
.source-badge.tv { background:#eef8ff; color:#277bb0; }
.source-badge.hsct { background:var(--primary-100); color:#6254d0; }
.source-badge.mst { background:#f2f3f7; color:#5e6271; }
.industry-badge { background:#f2f4f8; color:#4f5363; }
.quality-badge.a { background:var(--green-100); color:#15875b; }
.quality-badge.b { background:var(--blue-100); color:#3566dc; }
.quality-badge.c { background:var(--yellow-100); color:#ad7b09; }
.quality-badge.d,.quality-badge.f { background:var(--red-100); color:#c54459; }
.email-badge.valid { color:#18815b; background:var(--green-100); }
.email-badge.typo { color:#a2740c; background:var(--yellow-100); }
.email-badge.invalid { color:#c54459; background:var(--red-100); }
.pagination { display:flex; align-items:center; justify-content:space-between; padding:12px 14px; }
.pagination-info { color:var(--muted); font-size:11px; }
.pagination-pages { display:flex; gap:5px; }
.page-btn { min-width:30px; height:30px; padding:0 8px; border:1px solid var(--line); background:#fff; border-radius:8px; color:var(--muted); font-size:11px; }
.page-btn.active { color:#fff; background:var(--primary); border-color:var(--primary); }

/* tabs and data pool */
.tabs-shell { background:#fff; border:1px solid var(--line); border-radius:17px; box-shadow:var(--shadow-xs); overflow:hidden; }
.tabs-nav { display:flex; gap:4px; padding:7px; overflow:auto; border-bottom:1px solid var(--line); background:#fbfbfd; }
.tab-button { border:0; background:transparent; color:var(--muted); border-radius:10px; padding:10px 13px; font-weight:700; white-space:nowrap; }
.tab-button:hover { background:#f1f2f7; color:var(--text); }
.tab-button.active { background:#fff; color:var(--primary); box-shadow:0 2px 8px rgba(28,31,59,.08); }
.tab-content { min-height:460px; }
.tab-pane { animation:pageIn .22s ease; }
.filters { display:flex; gap:8px; flex-wrap:wrap; padding:13px 14px; border-bottom:1px solid var(--line); }
.filters .searchbox { min-width:200px; }
.filters .select { width:auto; min-width:125px; padding:9px 30px 9px 10px; }
.detail-layout { display:grid; grid-template-columns:minmax(0,1fr) 0; transition:.25s ease; }
.detail-layout.open { grid-template-columns:minmax(0,1fr) 330px; }
.detail-panel { border-left:1px solid var(--line); overflow:hidden; background:#fbfbfd; opacity:0; pointer-events:none; transition:.2s ease; }
.detail-layout.open .detail-panel { opacity:1; pointer-events:auto; }
.detail-panel-inner { width:330px; padding:18px; position:sticky; top:var(--nav-h); }
.detail-panel-head { display:flex; justify-content:space-between; align-items:start; margin-bottom:18px; }
.detail-panel-head h3 { font-size:15px; margin:0 0 4px; }
.detail-panel-head p { color:var(--muted); font-size:11px; }
.close-detail { border:0; background:#eef0f5; width:28px; height:28px; border-radius:8px; }
.score-ring { width:84px; height:84px; border-radius:50%; margin:0 auto 16px; display:grid; place-items:center; background:conic-gradient(var(--green) 0 88%, #e8eaf0 88%); position:relative; }
.score-ring:before { content:""; position:absolute; inset:8px; border-radius:50%; background:#fff; }
.score-ring strong { position:relative; font-size:20px; }
.score-ring span { position:relative; font-size:9px; color:var(--muted); }
.detail-section { padding:14px 0; border-top:1px solid var(--line); }
.detail-section h4 { font-size:10px; text-transform:uppercase; color:var(--muted); letter-spacing:.5px; margin-bottom:10px; }
.detail-field { display:grid; grid-template-columns:90px 1fr; gap:8px; margin-bottom:9px; font-size:11px; }
.detail-field span { color:var(--muted); }
.detail-field strong { font-weight:650; overflow-wrap:anywhere; }
.detail-actions { display:flex; gap:8px; }
.bulk-bar { display:none; align-items:center; justify-content:space-between; gap:12px; padding:10px 14px; color:#fff; background:#25273a; }
.bulk-bar.visible { display:flex; }
.bulk-bar .button { color:#fff; border-color:rgba(255,255,255,.14); background:rgba(255,255,255,.08); box-shadow:none; }

.import-layout { display:grid; grid-template-columns:1fr .95fr; gap:18px; padding:18px; }
.source-chips { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0 16px; }
.chip { border:1px solid var(--line); background:#fff; color:var(--muted); border-radius:999px; padding:8px 11px; font-size:11px; font-weight:700; }
.chip.active { color:var(--primary); border-color:#c8c1fa; background:var(--primary-100); }
.upload-zone { border:1.5px dashed #cfd2e1; border-radius:16px; padding:35px 20px; text-align:center; background:#fafafe; transition:.2s ease; }
.upload-zone:hover,.upload-zone.drag { border-color:#9187ef; background:#f7f5ff; }
.upload-icon { width:46px; height:46px; margin:0 auto 11px; display:grid; place-items:center; border-radius:14px; background:var(--primary-100); color:var(--primary); font-size:21px; }
.upload-zone h3 { margin:0 0 6px; font-size:14px; }
.upload-zone p { color:var(--muted); font-size:11px; margin-bottom:14px; }
.mapping-list { display:grid; gap:8px; margin-top:13px; }
.mapping-item { display:grid; grid-template-columns:1fr 24px 1fr 50px; align-items:center; gap:8px; border:1px solid var(--line); border-radius:11px; padding:10px; font-size:11px; }
.confidence { color:var(--green); font-weight:800; text-align:right; }
.preview-table { border:1px solid var(--line); border-radius:13px; overflow:auto; }
.preview-table table { min-width:560px; }
.empty-state { padding:70px 20px; text-align:center; }
.empty-state-icon { width:56px; height:56px; display:grid; place-items:center; border-radius:17px; margin:0 auto 13px; font-size:25px; background:var(--surface-3); color:var(--muted); }
.empty-state h3 { font-size:15px; margin-bottom:6px; }
.empty-state p { color:var(--muted); font-size:11px; }

.segment-grid,.template-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; padding:18px; }
.segment-card,.template-card { border:1px solid var(--line); border-radius:16px; padding:16px; background:#fff; }
.segment-card-top,.template-card-top { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:13px; }
.segment-icon,.template-icon { width:39px; height:39px; display:grid; place-items:center; border-radius:12px; background:var(--primary-100); color:var(--primary); font-size:18px; }
.segment-card h3,.template-card h3 { font-size:14px; margin:0 0 5px; }
.segment-card p,.template-card p { color:var(--muted); font-size:11px; line-height:1.45; min-height:32px; }
.segment-count { font-size:24px; font-weight:800; letter-spacing:-.6px; }
.segment-count small { font-size:10px; color:var(--muted); font-weight:600; }
.segment-actions,.template-actions { display:flex; gap:7px; margin-top:14px; }

.dedup-controls { display:flex; align-items:center; gap:14px; padding:18px; border-bottom:1px solid var(--line); }
.dedup-controls .range-wrap { max-width:380px; flex:1; }
.duplicate-list { display:grid; gap:12px; padding:18px; }
.duplicate-group { border:1px solid var(--line); border-radius:15px; overflow:hidden; }
.duplicate-head { display:flex; justify-content:space-between; align-items:center; padding:12px 14px; background:#fafbfc; border-bottom:1px solid var(--line); }
.duplicate-records { display:grid; grid-template-columns:1fr 1fr; }
.duplicate-record { padding:14px; border-right:1px solid var(--line); }
.duplicate-record:last-child { border:0; }
.duplicate-record strong { display:block; font-size:12px; }
.duplicate-record span { display:block; color:var(--muted); font-size:10px; margin-top:4px; }

.analytics-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:15px; padding:18px; }
.analytics-card { border:1px solid var(--line); border-radius:16px; padding:16px; }
.analytics-card h3 { font-size:13px; margin-bottom:18px; }
.horizontal-bars { display:grid; gap:13px; }
.hbar-row { display:grid; grid-template-columns:86px 1fr 38px; align-items:center; gap:10px; font-size:10px; }
.hbar-track { height:8px; background:#eef0f5; border-radius:999px; overflow:hidden; }
.hbar-fill { height:100%; border-radius:inherit; background:linear-gradient(90deg,#6557e8,#998ef4); }

/* email */
.campaign-layout { display:grid; grid-template-columns:330px minmax(0,1fr); gap:0; }
.campaign-form { padding:18px; border-right:1px solid var(--line); background:#fbfbfd; }
.campaign-form h3 { font-size:14px; margin-bottom:16px; }
.code-input { min-height:90px; font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:10px; background:#171a27; color:#d7dbec; }
.campaign-list-wrap { min-width:0; }
.progress-inline { display:flex; align-items:center; gap:8px; min-width:120px; }
.progress-inline .progress-track { flex:1; height:6px; }
.progress-inline small { color:var(--muted); min-width:31px; }
.campaign-name strong { display:block; font-size:11px; }
.campaign-name small { color:var(--muted); }
.email-editor-layout { display:grid; grid-template-columns:1fr 1fr; min-height:420px; }
.editor-pane { padding:18px; border-right:1px solid var(--line); }
.preview-pane { padding:18px; background:#f4f5f9; }
.email-frame { max-width:550px; margin:auto; background:#fff; border-radius:12px; overflow:hidden; box-shadow:var(--shadow-sm); }
.email-frame-header { height:110px; display:grid; place-items:center; background:linear-gradient(135deg,#6557e8,#917ef6); color:#fff; text-align:center; padding:20px; }
.email-frame-body { padding:25px; font-size:12px; line-height:1.6; }
.email-frame-body .fake-cta { display:inline-block; padding:10px 16px; border-radius:8px; background:#6557e8; color:#fff; font-weight:750; margin:8px 0; }
.event-icon { width:26px; height:26px; display:grid; place-items:center; border-radius:8px; }
.event-icon.open { color:#6557e8; background:var(--primary-100); }
.event-icon.click { color:#2672df; background:var(--blue-100); }
.event-icon.bounce { color:#c54459; background:var(--red-100); }
.event-icon.sent { color:#19835c; background:var(--green-100); }
.settings-grid { display:grid; grid-template-columns:1fr 1fr; gap:18px; padding:18px; }
.settings-section { border:1px solid var(--line); border-radius:15px; padding:16px; }
.settings-section h3 { font-size:13px; margin-bottom:15px; }
.password-wrap { position:relative; }
.password-wrap .input { padding-right:42px; }
.password-toggle { position:absolute; top:6px; right:7px; width:32px; height:30px; border:0; background:transparent; color:var(--muted); }

.toast { position:fixed; left:50%; bottom:25px; transform:translate(-50%,20px); padding:11px 15px; border-radius:11px; color:#fff; background:#222536; box-shadow:var(--shadow-md); z-index:100; opacity:0; pointer-events:none; transition:.25s ease; font-weight:650; }
.toast.show { opacity:1; transform:translate(-50%,0); }
.modal-backdrop { position:fixed; inset:0; background:rgba(19,21,34,.5); z-index:80; display:grid; place-items:center; padding:20px; backdrop-filter:blur(5px); }
.modal { width:min(760px,100%); max-height:88vh; overflow:auto; background:#fff; border-radius:20px; box-shadow:0 24px 70px rgba(14,16,31,.25); animation:modalIn .22s ease; }
@keyframes modalIn { from{opacity:0;transform:translateY(10px) scale(.98)} to{opacity:1;transform:none} }
.modal-head { display:flex; justify-content:space-between; align-items:center; padding:17px 19px; border-bottom:1px solid var(--line); }
.modal-head h3 { margin:0; font-size:15px; }
.modal-close { border:0; background:#eef0f5; width:31px; height:31px; border-radius:9px; }
.modal-body { padding:20px; }

@media (max-width: 1180px) {
  .global-nav { padding:0 18px; gap:14px; }
  .brand { min-width:auto; }
  .brand-copy { display:none; }
  .nav-actions .system-status,.user-copy { display:none; }
  .kpi-grid { grid-template-columns:repeat(3,1fr); }
  .kpi-grid.five { grid-template-columns:repeat(3,1fr); }
  .hero-panel { grid-template-columns:1fr; }
  .pipeline-mini { justify-content:start; max-width:620px; }
  .split-layout { grid-template-columns:310px minmax(0,1fr); }
  .tool-grid,.segment-grid,.template-grid { grid-template-columns:repeat(2,1fr); }
  .campaign-layout { grid-template-columns:300px minmax(0,1fr); }
}
@media (max-width: 860px) {
  .global-nav { height:64px; }
  :root { --nav-h:64px; }
  .nav-links { position:fixed; top:64px; left:0; right:0; padding:10px; background:#fff; border-bottom:1px solid var(--line); box-shadow:var(--shadow-sm); display:none; }
  .nav-links.open { display:grid; grid-template-columns:repeat(4,1fr); }
  .nav-link { justify-content:center; }
  .nav-actions { margin-left:auto; }
  .mobile-nav-toggle { display:block; }
  .page { padding:22px 16px 44px; }
  .page-header { flex-direction:column; }
  .header-actions { width:100%; overflow:auto; }
  .kpi-grid,.kpi-grid.five,.kpi-grid.four { grid-template-columns:repeat(2,1fr); }
  .tool-grid,.activity-grid,.split-layout,.import-layout,.campaign-layout,.settings-grid,.email-editor-layout,.analytics-grid { grid-template-columns:1fr; }
  .sidebar-stack { position:static; }
  .campaign-form,.editor-pane { border-right:0; border-bottom:1px solid var(--line); }
  .detail-layout.open { grid-template-columns:1fr; }
  .detail-panel { border-left:0; border-top:1px solid var(--line); }
  .detail-panel-inner { width:auto; position:static; }
}
@media (max-width: 560px) {
  .global-nav { padding:0 12px; }
  .nav-actions .icon-button,.nav-actions .user-menu { display:none; }
  .nav-links.open { grid-template-columns:1fr 1fr; }
  .nav-link { justify-content:flex-start; }
  .page-title-wrap { align-items:flex-start; }
  h1 { font-size:22px; }
  .kpi-grid,.kpi-grid.five,.kpi-grid.four,.tool-grid,.segment-grid,.template-grid { grid-template-columns:1fr; }
  .hero-panel { padding:21px; }
  .hero-copy h2 { font-size:22px; }
  .pipeline-mini { display:grid; grid-template-columns:1fr; }
  .pipeline-arrow { transform:rotate(90deg); text-align:center; }
  .form-row { grid-template-columns:1fr; }
  .toolbar .button span.label-hide { display:none; }
  .duplicate-records { grid-template-columns:1fr; }
  .duplicate-record { border-right:0; border-bottom:1px solid var(--line); }
  .duplicate-record:last-child { border:0; }
  .filter-row { flex-wrap:wrap; }
  .filter-select { min-width:100px; }
}

/* ═══ Restored Features CSS ═══ */

/* Filter Row */
.filter-row {
  display:flex; gap:8px; align-items:center;
  padding:12px 16px; margin-bottom:0;
  background:var(--surface-2); border-radius:var(--radius) var(--radius) 0 0;
  border:1px solid var(--line); border-bottom:0;
  flex-wrap:wrap;
}
.filter-select {
  min-width:120px; max-width:180px;
  font-size:12px; padding:7px 10px;
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--radius-sm); color:var(--text);
  cursor:pointer; transition:border-color .15s;
}
.filter-select:focus { border-color:var(--primary); outline:none; }

/* Bulk Action Bar */
.bulk-bar {
  display:flex; align-items:center; gap:10px;
  padding:10px 16px; background:var(--primary-100);
  border:1px solid var(--primary); border-top:0;
  border-radius:0;
  font-size:13px; color:var(--primary-600);
  animation:slideDown .2s ease-out;
}
@keyframes slideDown {
  from { opacity:0; transform:translateY(-8px); }
  to   { opacity:1; transform:translateY(0); }
}

/* Pagination Bar */
.pagination-bar {
  padding:12px 16px; display:flex; justify-content:center;
  border-top:1px solid var(--line);
}
.page-nav {
  display:flex; align-items:center; gap:4px;
}
.page-nav .button.small {
  min-width:34px; text-align:center; font-size:12px;
  padding:6px 10px;
}
.page-nav .button.small.active {
  background:var(--primary); color:white;
  border-color:var(--primary);
}

/* Sortable Headers */
.sortable-header {
  cursor:pointer; user-select:none;
  transition:color .15s;
}
.sortable-header:hover { color:var(--primary); }

/* Row selection */
tr.selected { background:var(--primary-100) !important; }
tr.selected:hover { background:var(--primary-100) !important; }
.row-check { cursor:pointer; accent-color:var(--primary); }

/* Toolbar enhancements */
.toolbar-left {
  display:flex; align-items:center; gap:10px;
}

/* Dedup Groups */
.dedup-group {
  margin-bottom:16px; border:1px solid var(--line);
  border-radius:var(--radius); overflow:hidden;
}
.dedup-group-head {
  display:flex; justify-content:space-between; align-items:center;
  padding:12px 16px; background:var(--surface-2);
  border-bottom:1px solid var(--line);
  font-size:13px;
}
.dedup-group .table-wrap { margin:0; border:0; border-radius:0; }

/* Segment form */
#segFormWrap .form-row {
  display:grid; grid-template-columns:repeat(auto-fit, minmax(140px, 1fr)); gap:10px;
}
#segFormWrap .form-label { font-size:11px; }
#segFormWrap label { font-size:13px; cursor:pointer; }
#segFormWrap input[type="checkbox"] { accent-color:var(--primary); margin-right:4px; }

/* Export dropdown */
.export-dropdown { position:relative; }
.export-menu {
  animation:fadeIn .15s ease-out;
}
@keyframes fadeIn {
  from { opacity:0; transform:translateY(-6px); }
  to   { opacity:1; transform:translateY(0); }
}

/* Scraper running animation */
@keyframes pulse {
  0%, 100% { opacity:1; }
  50% { opacity:0.5; }
}
.job-item.active {
  background:var(--primary-100);
  border-left:3px solid var(--primary);
}
