/* Investor Outreach — Variant A: Red + White */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --red: #DC2626;
  --red-hover: #B91C1C;
  --red-light: #FEE2E2;
  --amber: #F59E0B;
  --amber-light: #FEF3C7;
  --green: #10B981;
  --green-light: #D1FAE5;
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;
  --white: #FFFFFF;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --radius: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.5;
}

/* Top bar */
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-logo {
  font-weight: 700;
  font-size: 16px;
  color: var(--gray-900);
  letter-spacing: -0.3px;
}
.topbar-logo span { color: var(--red); }

/* Overdue banner */
.overdue-banner {
  background: var(--amber-light);
  border: 1px solid var(--amber);
  border-radius: var(--radius);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
  display: none;
  align-items: center;
  gap: 8px;
}
.overdue-banner.visible { display: flex; }
.overdue-count {
  background: var(--amber);
  color: var(--white);
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
}

/* Search + filter */
.topbar-center { display: flex; align-items: center; gap: 12px; }
.search-input {
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  padding: 6px 12px;
  font-size: 13px;
  width: 240px;
  outline: none;
  font-family: inherit;
}
.search-input:focus { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-light); }
.filter-select {
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  padding: 6px 12px;
  font-size: 13px;
  outline: none;
  font-family: inherit;
  background: var(--white);
}

.topbar-right { display: flex; align-items: center; gap: 12px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
}
.btn-primary {
  background: var(--red);
  color: var(--white);
}
.btn-primary:hover { background: var(--red-hover); }
.btn-secondary {
  background: var(--white);
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
}
.btn-secondary:hover { background: var(--gray-50); }
.btn-small { padding: 4px 10px; font-size: 12px; }
.btn-icon { padding: 6px; border-radius: 6px; }

/* Navigation tabs */
.nav-tabs {
  display: flex;
  gap: 4px;
  padding: 0 24px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
}
.nav-tab {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}
.nav-tab:hover { color: var(--gray-700); }
.nav-tab.active { color: var(--red); border-bottom-color: var(--red); }

/* Kanban board */
.kanban-container {
  display: flex;
  gap: 16px;
  padding: 20px 24px;
  overflow-x: auto;
  min-height: calc(100vh - 130px);
}
.kanban-column {
  flex: 0 0 280px;
  background: var(--gray-100);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
}
.kanban-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 4px;
}
.kanban-column-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.kanban-column-count {
  background: var(--gray-300);
  color: var(--gray-600);
  border-radius: 12px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 600;
}
.kanban-cards {
  flex: 1;
  min-height: 60px;
}

/* Kanban card */
.kanban-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
  cursor: grab;
  transition: box-shadow 0.15s;
  border: 1px solid var(--gray-200);
}
.kanban-card:hover { box-shadow: var(--shadow-md); }
.kanban-card.sortable-ghost { opacity: 0.4; }
.kanban-card.sortable-drag { box-shadow: var(--shadow-md); }
.kanban-card-firm {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 2px;
}
.kanban-card-name {
  font-size: 12px;
  color: var(--gray-500);
  margin-bottom: 8px;
}
.kanban-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}
.pill-sector {
  background: var(--gray-100);
  color: var(--gray-600);
}
.pill-overdue {
  background: var(--amber-light);
  color: #92400E;
}

/* Slide-out panel */
.panel-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.3);
  z-index: 200;
  display: none;
}
.panel-overlay.open { display: block; }
.slide-panel {
  position: fixed;
  top: 0; right: -480px; bottom: 0;
  width: 480px;
  background: var(--white);
  box-shadow: -4px 0 12px rgba(0,0,0,0.1);
  z-index: 201;
  transition: right 0.25s ease;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.slide-panel.open { right: 0; }
.panel-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.panel-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--gray-400);
  cursor: pointer;
  padding: 4px;
}
.panel-close:hover { color: var(--gray-600); }
.panel-body { padding: 20px 24px; flex: 1; }
.panel-section { margin-bottom: 24px; }
.panel-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

/* Activity timeline */
.timeline { list-style: none; }
.timeline-item {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-100);
}
.timeline-item:last-child { border-bottom: none; }
.timeline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gray-300);
  margin-top: 6px;
  flex-shrink: 0;
}
.timeline-dot.email { background: var(--red); }
.timeline-dot.stage_change { background: var(--green); }
.timeline-dot.note { background: var(--gray-400); }
.timeline-dot.follow_up_created { background: var(--amber); }
.timeline-content { flex: 1; }
.timeline-summary { font-size: 13px; color: var(--gray-700); }
.timeline-date { font-size: 11px; color: var(--gray-400); margin-top: 2px; }

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 300;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--white);
  border-radius: 12px;
  padding: 24px;
  width: 480px;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.modal-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 20px;
}

/* Forms */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 4px;
}
.form-input, .form-textarea, .form-select {
  width: 100%;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-light);
}
.form-textarea { resize: vertical; min-height: 80px; }

/* Gmail sync progress */
.sync-progress {
  background: var(--gray-100);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  display: none;
}
.sync-progress.active { display: block; }
.sync-progress-bar {
  background: var(--gray-200);
  border-radius: 4px;
  height: 6px;
  overflow: hidden;
  margin-top: 8px;
}
.sync-progress-fill {
  background: var(--red);
  height: 100%;
  width: 0%;
  transition: width 0.3s ease;
  border-radius: 4px;
}
.sync-progress-text {
  font-size: 13px;
  color: var(--gray-600);
}

/* Review queue page */
.page-container {
  padding: 20px 24px;
  max-width: 1200px;
}
.page-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 16px;
}
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
th {
  text-align: left;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
td {
  padding: 10px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
}
tr:last-child td { border-bottom: none; }

/* Import summary */
.import-summary {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.import-stat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 24px;
  font-size: 14px;
}
.import-stat-value { font-weight: 600; font-size: 20px; }
.import-stat-value.success { color: var(--green); }
.import-stat-value.error { color: var(--red); }
.import-stat-value.warning { color: var(--amber); }

/* User info */
.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--gray-600);
}
.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--red-light);
  color: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}

/* Toast notifications */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--gray-800);
  color: var(--white);
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 13px;
  box-shadow: var(--shadow-md);
  animation: toastIn 0.2s ease;
}
.toast.error { background: var(--red); }
.toast.success { background: var(--green); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Gmail banner */
.gmail-banner {
  background: var(--red-light);
  border: 1px solid var(--red);
  border-radius: var(--radius);
  padding: 8px 16px;
  font-size: 13px;
  color: var(--red);
  display: none;
  align-items: center;
  gap: 8px;
  margin: 12px 24px 0;
}
.gmail-banner.visible { display: flex; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--gray-400);
}
.empty-state-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state-text { font-size: 14px; }

/* Follow-up item */
.follow-up-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
}
.follow-up-item input[type="checkbox"] { flex-shrink: 0; }
.follow-up-desc { flex: 1; color: var(--gray-700); }
.follow-up-date { font-size: 12px; color: var(--gray-400); white-space: nowrap; }

/* ── Responsive ── */

/* Tablet */
@media (max-width: 1024px) {
  .topbar { padding: 0 16px; gap: 8px; }
  .search-input { width: 180px; }
  .kanban-container { padding: 16px; gap: 12px; }
  .kanban-column { flex: 0 0 240px; }
  .slide-panel { width: 400px; right: -400px; }
  .slide-panel.open { right: 0; }
}

/* Mobile */
@media (max-width: 768px) {
  .topbar {
    height: auto;
    flex-wrap: wrap;
    padding: 12px 16px;
    gap: 8px;
  }
  .topbar-left {
    width: 100%;
    justify-content: space-between;
  }
  .topbar-center {
    width: 100%;
    order: 3;
  }
  .search-input { flex: 1; width: auto; }
  .topbar-right {
    order: 2;
    gap: 6px;
    flex-wrap: wrap;
  }
  .topbar-right .user-info { display: none; }
  .topbar-right #btnLogout {
    display: inline-flex;
  }

  .nav-tabs { padding: 0 16px; }

  /* Kanban: horizontal scroll with smaller columns */
  .kanban-container {
    padding: 12px 16px;
    gap: 10px;
    min-height: calc(100vh - 200px);
  }
  .kanban-column { flex: 0 0 220px; padding: 10px; }

  /* Panel: full-width overlay on mobile */
  .slide-panel {
    width: 100%;
    right: -100%;
  }
  .slide-panel.open { right: 0; }
  .panel-header { padding: 16px; }
  .panel-body { padding: 16px; }

  /* Modal: nearly full-width */
  .modal {
    width: calc(100vw - 32px);
    padding: 20px;
  }

  /* Overdue banner */
  .overdue-banner {
    font-size: 12px;
    padding: 6px 12px;
  }

  /* Gmail banner */
  .gmail-banner { margin: 8px 16px 0; }

  /* Buttons */
  .btn { padding: 6px 12px; font-size: 12px; }
  .btn-small { padding: 4px 8px; font-size: 11px; }

  /* Table */
  .page-container { padding: 16px; }
  table { font-size: 12px; }
  th, td { padding: 8px 10px; }
}

/* Small mobile */
@media (max-width: 480px) {
  .topbar-right .btn-secondary { font-size: 11px; padding: 4px 6px; }
  .topbar-right #btnExport { display: none; }
  .kanban-column { flex: 0 0 200px; }
  .kanban-card { padding: 10px; }
  .kanban-card-firm { font-size: 13px; }
}
