/* ══════════════════════════════════════════════════════════════
   RECRUITING DATABASE + OUTREACH PIPELINE (Light Mode)
   ══════════════════════════════════════════════════════════════ */

.db-wrap { padding: 16px 12px 100px; }

/* ── Header ──────────────────────────────────────────────── */
.db-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 16px; flex-wrap: wrap; gap: 8px;
}
.db-title { font-size: 20px; font-weight: 700; color: var(--text); }
.db-stats { font-size: 12px; color: var(--text3); margin-top: 4px; }
.db-header-actions { display: flex; gap: 4px; }
.db-view-btn {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text2); padding: 6px 14px; font-size: 12px;
  cursor: pointer; font-family: inherit; transition: all .15s;
}
.db-view-btn.active { background: rgba(224,32,32,.06); color: #e02020; border-color: rgba(224,32,32,.2); }

/* ── Filters ─────────────────────────────────────────────── */
.db-filters {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 16px; padding: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px;
}
.db-input, .db-select {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); padding: 8px 12px; font-size: 13px;
  font-family: inherit; outline: none; transition: border-color .15s;
}
.db-input:focus, .db-select:focus { border-color: #e02020; }
.db-input { flex: 1; min-width: 160px; }
.db-select { min-width: 110px; }
.db-select option { background: var(--surface); color: var(--text); }

/* ── Table ───────────────────────────────────────────────── */
.db-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 12px; border: 1px solid var(--border); }
.db-table { width: 100%; border-collapse: collapse; }
.db-table thead { background: var(--surface); }
.db-table th {
  text-align: left; padding: 10px 12px; font-size: 11px; font-weight: 600;
  color: var(--text2); text-transform: uppercase; letter-spacing: .5px;
  border-bottom: 2px solid var(--border);
}
.db-table td {
  padding: 10px 12px; font-size: 13px; color: var(--text);
  border-bottom: 1px solid var(--border); vertical-align: middle;
}
.db-table tbody tr { cursor: pointer; transition: background .1s; }
.db-table tbody tr:hover { background: var(--bg); }
.db-name-cell { display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 200px; overflow: hidden; }
.db-name-cell div { display: flex; align-items: center; gap: 6px; }
.db-has-contact { font-size: 11px; opacity: .6; }
.db-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--bg); }
.db-avatar-empty { display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: var(--text3); width: 32px; height: 32px; border-radius: 50%; background: var(--bg); }
.db-empty { text-align: center; padding: 40px; color: var(--text3); font-size: 14px; }

/* Stars */
.db-stars { letter-spacing: 1px; font-size: 13px; }
.db-star-on { color: #eab308; }
.db-star-off { color: var(--border); }

/* Stage pill in table */
.db-stage-pill {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 10px; font-weight: 600; white-space: nowrap;
}
.db-stage-none { color: var(--text3); }

/* Badges */
.db-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.db-badge-committed { background: rgba(16,185,129,.08); color: #10b981; }
.db-badge-uncommitted { background: var(--bg); color: var(--text3); }
.db-badge-signed { background: rgba(59,130,246,.08); color: #3b82f6; }
.db-source-badge { display: inline-block; padding: 1px 6px; border-radius: 4px; font-size: 10px; font-weight: 600; text-transform: uppercase; background: var(--bg); color: var(--text2); margin-right: 4px; }

/* Pagination */
.db-pagination { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 16px; }
.db-btn { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; color: var(--text); padding: 8px 16px; font-size: 13px; cursor: pointer; transition: background .15s; font-family: inherit; }
.db-btn:hover { background: var(--bg); }
.db-page-info { font-size: 12px; color: var(--text2); }

/* ── KANBAN / PIPELINE VIEW ──────────────────────────────── */
.db-kanban { display: flex; gap: 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 20px; min-height: 200px; }
.db-kanban-col { min-width: 240px; max-width: 280px; flex-shrink: 0; }
@media(max-width:480px){ .db-kanban-col { min-width: 180px; } }
.db-kanban-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; font-size: 13px; font-weight: 600; color: var(--text);
  border-bottom: 3px solid; border-radius: 8px 8px 0 0;
  background: var(--surface); margin-bottom: 8px;
}
.db-kanban-count { font-size: 11px; color: var(--text2); background: var(--bg); padding: 2px 8px; border-radius: 10px; }
.db-kanban-cards { display: flex; flex-direction: column; gap: 8px; }
.db-kanban-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px; cursor: pointer; transition: all .15s;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.db-kanban-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.08); border-color: var(--text3); }
.db-kanban-card-top { display: flex; align-items: center; gap: 10px; }
.db-kanban-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--bg); }
.db-kanban-meta { font-size: 11px; color: var(--text2); margin-top: 2px; }
.db-kanban-socials { display: flex; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.db-kanban-socials a { font-size: 12px; color: #3b82f6; text-decoration: none; padding: 2px 8px; border-radius: 6px; background: rgba(59,130,246,.06); }
.db-kanban-socials a:hover { background: rgba(59,130,246,.12); }
.db-kanban-empty { text-align: center; padding: 20px; color: var(--text3); font-size: 12px; }

/* ── DETAIL PANEL ────────────────────────────────────────── */
.db-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 999; opacity: 0; pointer-events: none; transition: opacity .2s; }
.db-overlay.open { opacity: 1; pointer-events: auto; }
.db-detail { position: fixed; top: 0; right: 0; width: 460px; max-width: 92vw; height: 100vh; background: var(--surface); border-left: 1px solid var(--border); z-index: 1000; overflow-y: auto; padding: 24px; transform: translateX(100%); transition: transform .25s ease; box-shadow: -4px 0 20px rgba(0,0,0,.06); }
.db-detail.open { transform: translateX(0); }
.db-detail-close { position: absolute; top: 14px; right: 14px; background: none; border: none; color: var(--text2); font-size: 20px; cursor: pointer; }
.db-detail-close:hover { color: #e02020; }
.db-detail-header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.db-detail-img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--bg); flex-shrink: 0; }
.db-detail h2 { font-size: 20px; font-weight: 700; color: var(--text); margin: 0 0 2px; }
.db-detail-meta { font-size: 13px; color: var(--text2); }
.db-detail-section { margin-bottom: 20px; }
.db-detail-section h3 { font-size: 11px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; padding-bottom: 4px; border-bottom: 1px solid var(--border); }
.db-detail-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; font-size: 13px; color: var(--text); border-bottom: 1px solid var(--border); }
.db-detail-row span:first-child { color: var(--text2); font-size: 12px; text-transform: uppercase; }

/* Contacts */
.db-contact-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; font-size: 13px; color: var(--text); border-bottom: 1px solid var(--border); }
.db-contact-type { font-size: 11px; text-transform: uppercase; color: var(--text3); min-width: 70px; }
.db-contact-row a { color: #3b82f6; text-decoration: none; }
.db-contact-row a:hover { text-decoration: underline; }

/* ── OUTREACH ACTION BUTTONS ─────────────────────────────── */
.db-action-row { display: flex; flex-wrap: wrap; gap: 8px; }
.db-action-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 16px; border-radius: 10px; font-size: 13px; font-weight: 600;
  text-decoration: none; transition: all .15s; cursor: pointer;
  border: 1px solid var(--border);
}
.db-action-twitter { background: rgba(29,155,240,.06); color: #1d9bf0; }
.db-action-twitter:hover { background: rgba(29,155,240,.15); }
.db-action-ig { background: rgba(225,48,108,.06); color: #e1306c; }
.db-action-ig:hover { background: rgba(225,48,108,.15); }
.db-action-tk { background: rgba(255,0,80,.06); color: #ff0050; }
.db-action-tk:hover { background: rgba(255,0,80,.15); }
.db-action-email { background: rgba(59,130,246,.06); color: #3b82f6; }
.db-action-email:hover { background: rgba(59,130,246,.15); }
.db-action-eval { background: rgba(210,153,34,.06); color: #d29922; width: 100%; justify-content: center; }
.db-action-eval:hover { background: rgba(210,153,34,.15); }

/* Pipeline select in detail */
.db-pipeline-select { width: 100%; padding: 10px 12px; font-size: 14px; }

/* Notes */
.db-notes {
  width: 100%; min-height: 80px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); padding: 10px; font-size: 13px; font-family: inherit;
  resize: vertical; outline: none; transition: border-color .2s;
}
.db-notes:focus { border-color: #e02020; }
.db-save-note { margin-top: 8px; width: 100%; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 640px) {
  .db-filters { flex-direction: column; }
  .db-input, .db-select { width: 100%; }
  .db-table th:nth-child(n+6), .db-table td:nth-child(n+6) { display: none; }
  .db-detail { width: 100vw; }
  .db-kanban-col { min-width: 200px; }
}

/* ── Mobile deep optimizations ───────────────────────────── */
@media (max-width: 768px) {
  /* iOS input zoom prevention */
  .db-input, .db-select, .db-notes, .db-pipeline-select { font-size: 16px !important; }

  /* Touch targets */
  .db-btn { min-height: 44px; padding: 10px 16px; }
  .db-action-btn { min-height: 44px; }
  .db-view-btn { min-height: 40px; }

  /* Table horizontal scroll */
  .db-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .db-table { min-width: 480px; }

  /* Kanban full-width columns on small screens */
  .db-kanban { flex-direction: column; overflow-x: visible; }
  .db-kanban-col { min-width: 100%; max-width: 100%; }

  /* Detail panel full-width */
  .db-detail { width: 100vw; max-width: 100vw; padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }

  /* Wrap header actions on mobile */
  .db-header { flex-direction: column; align-items: flex-start; }
  .db-header-actions { flex-wrap: wrap; }

  /* Remove tap highlight */
  .db-table tbody tr, .db-kanban-card, .db-btn, .db-action-btn {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
}
