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

:root {
  --primary: #ff0066;
  --primary-hover: #e6005c;
  --purple: #c261ff;
  --blue: #4a98ff;
  --green: #00cc8b;
  --dark: #474747;
  --gray: #858585;
  --gray-light: #ececec;
  --bg: #f4f6f9;
  --white: #fff;
  --border: #e3e6ef;
  --sidebar: #ffffff;
  --shadow: 0 2px 8px rgba(21, 21, 21, 0.06);
  --radius: 8px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: Roboto, system-ui, sans-serif;
  background: var(--bg);
  color: var(--dark);
  font-size: 14px;
}

.app { display: flex; min-height: 100vh; }

/* Left icon sidebar */
.icon-nav {
  width: 72px;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0;
  flex-shrink: 0;
}
.logo-mark {
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: #fff; font-weight: 700; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 24px;
}
.nav-item {
  width: 44px; height: 44px; border-radius: 10px; border: none;
  background: transparent; color: var(--gray); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 8px; font-size: 18px;
}
.nav-item.active, .nav-item:hover { background: #ffe8f1; color: var(--primary); }

/* Filter panel */
.filters-panel {
  width: 320px;
  background: var(--white);
  border-right: 1px solid var(--border);
  padding: 20px 18px;
  overflow-y: auto;
  flex-shrink: 0;
}
.filters-panel h2 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 500;
}
.filters-panel .sub {
  color: var(--gray);
  font-size: 13px;
  margin-bottom: 18px;
}

.platform-row {
  display: flex; gap: 8px; margin-bottom: 20px;
}
.platform-btn {
  flex: 1; border: 1px solid var(--border); background: var(--white);
  border-radius: var(--radius); padding: 10px 6px; cursor: pointer;
  text-align: center; font-size: 12px; font-weight: 500; color: var(--dark);
}
.platform-btn.active {
  border-color: var(--primary);
  background: #fff5f9;
  color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}
.platform-btn .ico { display: block; font-size: 18px; margin-bottom: 4px; }

.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: 12px; font-weight: 500;
  color: var(--gray); margin-bottom: 6px; text-transform: capitalize;
}
.field input, .field select {
  width: 100%; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 12px; font: inherit; background: var(--white);
}
.field input:focus, .field select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 0, 102, 0.12);
}
.range-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.btn-search {
  width: 100%; margin-top: 8px; padding: 12px;
  background: var(--primary); color: #fff; border: none;
  border-radius: var(--radius); font-size: 15px; font-weight: 500;
  cursor: pointer;
}
.btn-search:hover { background: var(--primary-hover); }
.btn-search:disabled { opacity: 0.6; cursor: not-allowed; }

.filter-note {
  margin-top: 14px; padding: 10px; background: #f8f9fc;
  border-radius: var(--radius); font-size: 11px; color: var(--gray); line-height: 1.45;
}

/* Main content */
.main {
  flex: 1; display: flex; flex-direction: column; min-width: 0;
}
.topbar {
  background: var(--white); border-bottom: 1px solid var(--border);
  padding: 14px 24px; display: flex; align-items: center; justify-content: space-between;
}
.topbar h1 { margin: 0; font-size: 18px; font-weight: 500; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }
.btn-outline {
  border: 1px solid var(--border); background: var(--white);
  border-radius: var(--radius); padding: 8px 14px; cursor: pointer;
  font: inherit; color: var(--dark);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary-sm {
  border: none; background: var(--primary); color: #fff;
  border-radius: var(--radius); padding: 8px 14px; cursor: pointer; font: inherit;
}

.results-wrap { padding: 20px 24px; flex: 1; overflow-y: auto; }
.results-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.results-meta .count { font-size: 15px; color: var(--gray); }
.results-meta .count strong { color: var(--dark); font-weight: 500; }
.status-msg { font-size: 13px; color: var(--gray); }
.status-msg.error { color: #a31414; }

.creator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.creator-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px; box-shadow: var(--shadow);
  position: relative; transition: box-shadow .15s;
}
.creator-card:hover { box-shadow: 0 4px 16px rgba(21,21,21,.1); }
.creator-card.selected { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(255,0,102,.15); }
.card-check {
  position: absolute; top: 12px; right: 12px;
  width: 18px; height: 18px; cursor: pointer;
}
.card-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.avatar {
  width: 52px; height: 52px; border-radius: 50%; object-fit: cover;
  background: var(--gray-light); flex-shrink: 0;
}
.card-name { font-weight: 500; font-size: 15px; line-height: 1.3; }
.card-handle { color: var(--primary); font-size: 13px; text-decoration: none; }
.card-handle:hover { text-decoration: underline; }

.platform-pill {
  display: inline-block; font-size: 11px; font-weight: 500;
  padding: 2px 8px; border-radius: 999px; margin-top: 4px;
}
.platform-pill.youtube { background: #ffe8e8; color: #cc0000; }
.platform-pill.tiktok { background: #eee; color: #111; }
.platform-pill.instagram { background: #fce4ec; color: #c13584; }

.stats-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin: 12px 0; padding-top: 12px; border-top: 1px solid var(--border);
}
.stat-label { font-size: 10px; color: var(--gray); text-transform: uppercase; letter-spacing: .03em; }
.stat-val { font-size: 14px; font-weight: 500; margin-top: 2px; }

.audience-row {
  display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px;
}
.tag {
  font-size: 11px; background: #f0f2f7; color: var(--dark);
  padding: 3px 8px; border-radius: 999px;
}
.email-line {
  margin-top: 10px; font-size: 12px; color: var(--gray);
}
.email-line.has { color: var(--green); font-weight: 500; }
.email-row {
  margin-top: 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.email-missing { font-size: 12px; color: var(--gray); }
.email-src {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  background: #e8f5e9; color: var(--green); padding: 2px 6px; border-radius: 4px;
}
.btn-deep-search {
  font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 6px;
  border: 1px solid var(--purple); background: #f5f0ff; color: var(--purple);
  cursor: pointer;
}
.btn-deep-search:hover:not(:disabled) { background: var(--purple); color: #fff; }
.btn-deep-search:disabled { opacity: 0.6; cursor: wait; }

.empty-state {
  text-align: center; padding: 60px 20px; color: var(--gray);
}
.empty-state h3 { color: var(--dark); font-weight: 500; }

/* Lists table view */
.lists-table-wrap { display: none; }
.lists-table-wrap.active { display: block; }
.search-view.hidden { display: none; }

table.data-table {
  width: 100%; border-collapse: collapse; background: var(--white);
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
}
table.data-table th, table.data-table td {
  padding: 12px 14px; border-bottom: 1px solid var(--border); text-align: left;
}
table.data-table th {
  font-size: 11px; text-transform: uppercase; color: var(--gray);
  background: #fafbfc; font-weight: 500;
}
table.data-table tr:last-child td { border-bottom: none; }

.loading-overlay {
  display: none; position: fixed; inset: 0; background: rgba(255,255,255,.7);
  z-index: 100; align-items: center; justify-content: center; flex-direction: column;
}
.loading-overlay.show { display: flex; }

.load-more-bar, .continue-bar {
  text-align: center; padding: 24px; margin-top: 8px;
}
.continue-bar {
  background: #fff5f9; border: 1px solid #ffcce0; border-radius: 12px;
  margin: 16px 0;
}
.continue-bar p { margin: 0 0 12px; color: var(--dark); font-size: 14px; }
.load-more-bar p { color: var(--gray); font-size: 13px; margin: 0; }
.spinner {
  width: 40px; height: 40px; border: 3px solid var(--gray-light);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1100px) {
  .filters-panel { width: 280px; }
}
@media (max-width: 900px) {
  .app { flex-direction: column; }
  .icon-nav { width: 100%; flex-direction: row; justify-content: center; height: auto; padding: 10px; }
  .filters-panel { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
}
