:root {
  --bg: #f6f8fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e5edf7;
  --primary: #2563eb;
  --primary-soft: #eff6ff;
  --green: #059669;
  --orange: #d97706;
  --red: #e11d48;
  --shadow: 0 14px 40px rgba(15, 23, 42, .07);
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

a {
  color: var(--primary);
  text-decoration: none;
}

.topbar {
  padding: 24px 28px;
  background: linear-gradient(135deg, #ffffff, #eff6ff);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}

.eyebrow {
  font-size: 12px;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.topbar h1 {
  margin: 6px 0 6px;
  font-size: 28px;
  line-height: 1.15;
}

.topbar p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.top-actions,
.action-buttons,
.table-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.page {
  padding: 22px 28px 40px;
  display: grid;
  gap: 18px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.summary-card,
.action-panel,
.filter-panel,
.table-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.summary-card {
  padding: 18px;
}

.summary-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.summary-card strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
  line-height: 1;
}

.action-panel {
  padding: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.action-panel h2,
.table-head h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.action-panel p,
.table-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.filter-panel {
  padding: 14px;
  display: grid;
  grid-template-columns: 2fr repeat(5, minmax(120px, 1fr));
  gap: 10px;
}

.input {
  height: 38px;
  border: 1px solid #dbe5f1;
  border-radius: 12px;
  padding: 0 12px;
  background: #fff;
  color: var(--text);
  font-weight: 800;
  outline: none;
}

.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

button,
.ghost-btn,
.primary-btn,
.soft-btn,
.mini-btn,
.icon-btn {
  border: 0;
  cursor: pointer;
  font-weight: 900;
  border-radius: 12px;
  transition: .18s ease;
}

.primary-btn {
  background: var(--primary);
  color: #fff;
  padding: 10px 14px;
}

.soft-btn {
  background: var(--primary-soft);
  color: #1d4ed8;
  padding: 10px 14px;
}

.ghost-btn {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 14px;
}

.mini-btn {
  background: #f8fafc;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 10px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  background: #f8fafc;
  border: 1px solid var(--border);
  font-size: 22px;
}

button:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.table-card {
  overflow: hidden;
}

.table-head {
  padding: 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.table-wrap {
  overflow: auto;
}

.lead-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1180px;
}

.lead-table th {
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.lead-table td {
  padding: 12px;
  border-bottom: 1px solid #edf2f7;
  vertical-align: top;
  font-size: 13px;
}

.lead-main-cell strong {
  display: block;
  font-size: 14px;
  margin-bottom: 5px;
}

.lead-main-cell p {
  margin: 0;
  color: #475569;
  line-height: 1.5;
  max-width: 360px;
}

.score-badge {
  display: inline-grid;
  place-items: center;
  min-width: 38px;
  height: 30px;
  border-radius: 999px;
  font-weight: 950;
  background: #f1f5f9;
  color: #334155;
}

.score-badge.hot {
  background: #fee2e2;
  color: #be123c;
}

.score-badge.mid {
  background: #dcfce7;
  color: #047857;
}

.score-badge.low {
  background: #f1f5f9;
  color: #475569;
}

.tag,
.priority,
.status {
  display: inline-flex;
  max-width: 180px;
  border-radius: 999px;
  padding: 5px 8px;
  background: #f8fafc;
  border: 1px solid var(--border);
  color: #334155;
  font-size: 12px;
  font-weight: 850;
}

.status.ok {
  background: #ecfdf5;
  color: #047857;
  border-color: #bbf7d0;
}

.contact-cell {
  color: #94a3b8;
  font-weight: 800;
}

.contact-cell.has {
  color: var(--green);
  font-weight: 950;
}

.empty-cell {
  text-align: center;
  color: var(--muted);
  padding: 42px !important;
  font-weight: 850;
}

.drawer-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .25);
  opacity: 0;
  pointer-events: none;
  transition: .18s ease;
  z-index: 50;
}

.drawer-mask.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(620px, 94vw);
  height: 100vh;
  background: #fff;
  box-shadow: -18px 0 50px rgba(15, 23, 42, .18);
  transform: translateX(105%);
  transition: .22s ease;
  z-index: 60;
  display: flex;
  flex-direction: column;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-head {
  padding: 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.drawer-head h2 {
  margin: 6px 0 0;
}

.drawer-body {
  padding: 18px;
  overflow: auto;
  display: grid;
  gap: 14px;
}

.drawer-section {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  background: #fff;
}

.drawer-section.highlight {
  background: #f5f3ff;
  border-color: #ddd6fe;
}

.drawer-section h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.drawer-section p {
  margin: 8px 0;
  line-height: 1.65;
  color: #334155;
  font-weight: 750;
}

.big-text {
  font-size: 18px;
  color: var(--text) !important;
  font-weight: 950 !important;
}

.drawer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.drawer-grid div {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f8fafc;
}

.drawer-grid label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 6px;
}

.drawer-grid strong {
  font-size: 15px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  background: #0f172a;
  color: #fff;
  padding: 11px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
  transition: .18s ease;
  z-index: 100;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 1100px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .action-panel,
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .page,
  .topbar {
    padding-left: 14px;
    padding-right: 14px;
  }

  .summary-grid,
  .filter-panel,
  .drawer-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Workbench Status + Pager v3003 ===== */

.pager {
  margin-top: 14px;
  padding: 14px 18px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.pager #pageInfo {
  color: #475569;
  font-size: 13px;
  font-weight: 900;
}

.pager .input {
  width: 120px;
}

.table-actions {
  max-width: 780px;
}

.table-actions .ghost-btn {
  padding: 8px 10px;
  font-size: 12px;
}

@media (max-width: 900px) {
  .pager {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

/* ===== Follow User Binding v3004 ===== */

.user-id-line {
  margin-top: 4px;
  color: #64748b;
  font-size: 11px;
  font-weight: 850;
}

.status.follow {
  background: #f5f3ff;
  border-color: #ddd6fe;
  color: #6d28d9;
}
