:root {
  --primary: #2B5C3F;
  --primary-dark: #1e4a30;
  --primary-light: #3a7a55;
  --bg: #fafafa;
  --card: #ffffff;
  --border: #e5e7eb;
  --text: #1a1a1a;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

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

/* Nav */
.nav {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  height: 56px;
  gap: 8px;
}
.nav-brand {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  margin-right: 24px;
}
.nav-link {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: background 0.15s;
}
.nav-link:hover { background: #f3f4f6; text-decoration: none; color: var(--text); }
.nav-link.active { background: rgba(43,92,63,0.1); color: var(--primary); }
.nav-right { margin-left: auto; }

/* Layout */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px;
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}
.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}
.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
}
.stat-value.alert { color: var(--danger); }
.stat-label {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 2px;
}

/* Grid */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 768px) { .grid-2 { grid-template-columns: 1fr; } }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); text-decoration: none; color: white; }
.btn-secondary { background: #f3f4f6; color: var(--text); }
.btn-secondary:hover { background: #e5e7eb; text-decoration: none; }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-danger:hover { background: #fee2e2; text-decoration: none; }
.btn-ghost { background: none; color: var(--text-muted); }
.btn-ghost:hover { background: #f3f4f6; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-success { background: #ecfdf5; color: #065f46; }
.btn-success:hover { background: #d1fae5; text-decoration: none; }

/* Forms */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: white;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(43,92,63,0.12);
}
.form-textarea { resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.form-full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 8px; margin-top: 16px; }

/* Table */
.table-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: #f9fafb;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
}
th:hover { color: var(--text); }
td {
  padding: 10px 14px;
  border-bottom: 1px solid #f3f4f6;
  font-size: 13px;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f9fafb; }
.td-name { font-weight: 600; }

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
.badge-to-reach-out { background: #e0f2fe; color: #0369a1; }
.badge-reached-out { background: #fef3c7; color: #92400e; }
.badge-scheduled { background: #ede9fe; color: #5b21b6; }
.badge-talked { background: #d1fae5; color: #065f46; }
.badge-follow-up { background: #fee2e2; color: #991b1b; }
.badge-closed { background: #f3f4f6; color: #6b7280; }

.tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  background: #f0f9ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.lane-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  background: #f0fdf4;
  color: var(--primary);
}

/* Contact detail */
.contact-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.contact-name { font-size: 24px; font-weight: 700; }
.contact-subtitle { color: var(--text-muted); margin-top: 2px; }
.contact-meta { font-size: 13px; color: var(--text-light); margin-top: 4px; }

/* Timeline */
.timeline-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 8px;
}
.timeline-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.icon-note { background: #dbeafe; color: #1d4ed8; }
.icon-call { background: #d1fae5; color: #065f46; }
.icon-meeting { background: #ede9fe; color: #5b21b6; }
.icon-outreach { background: #fef3c7; color: #92400e; }
.timeline-content { flex: 1; min-width: 0; }
.timeline-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 4px;
}
.timeline-text { font-size: 13px; white-space: pre-wrap; }

/* Draft card */
.draft-card {
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 8px;
}
.draft-content { font-size: 13px; white-space: pre-wrap; margin-bottom: 8px; }
.draft-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.draft-sent { opacity: 0.6; }

/* Follow-up */
.followup-overdue {
  border-color: #fca5a5;
  background: #fef2f2;
}

/* Messages */
.alert {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
}
.alert-success { background: #d1fae5; color: #065f46; }
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-warning { background: #fef3c7; color: #92400e; }

/* List items */
.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 8px;
  transition: background 0.1s;
}
.list-item:hover { background: #f9fafb; }
.list-item-name { font-weight: 500; font-size: 13px; }
.list-item-sub { font-size: 12px; color: var(--text-light); margin-left: 8px; }

/* Empty state */
.empty { text-align: center; color: var(--text-light); padding: 40px 16px; font-size: 13px; }

/* Danger zone */
.danger-zone {
  border: 1px solid #fca5a5;
  border-radius: 12px;
  padding: 20px;
}
.danger-zone h3 { color: var(--danger); font-size: 13px; font-weight: 600; margin-bottom: 8px; }

/* Filters bar */
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.filters .form-input, .filters .form-select {
  width: auto;
  min-width: 160px;
}
.search-input { flex: 1; min-width: 200px; }

/* Login */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}
.login-title { font-size: 24px; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.login-subtitle { color: var(--text-muted); margin-bottom: 24px; }

/* Page header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.page-title { font-size: 24px; font-weight: 700; }

/* Editable field */
.editable {
  cursor: pointer;
  padding: 6px 8px;
  margin: -6px -8px;
  border-radius: 6px;
  transition: background 0.1s;
}
.editable:hover { background: #f3f4f6; }

/* Utility */
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.text-sm { font-size: 12px; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.inline-flex { display: inline-flex; align-items: center; gap: 6px; }
