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

:root {
  --bg: #f8f9fb;
  --surface: #ffffff;
  --border: #e5e7eb;
  --border-light: #f0f1f3;
  --text: #111827;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --accent: #2563eb;
  --accent-light: #eff6ff;
  --accent-hover: #1d4ed8;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10), 0 2px 6px rgba(0,0,0,0.06);
}

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

/* ── NAV ── */
.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 24px;
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 var(--border);
}

.nav-logo {
  font-weight: 700;
  font-size: 15px;
  color: var(--accent);
  letter-spacing: -0.3px;
  margin-right: 16px;
}

.nav-links {
  display: flex;
  gap: 2px;
  flex: 1;
}

.nav-links a {
  padding: 6px 14px;
  border-radius: 7px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.15s;
}

.nav-links a:hover { background: var(--bg); color: var(--text); }
.nav-links a.active { background: var(--accent-light); color: var(--accent); font-weight: 600; }

.btn-outline {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 7px 14px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
}
.btn-outline:hover { border-color: #d1d5db; color: var(--text); background: var(--bg); }

/* ── PAGE ── */
.page { padding: 28px 32px; max-width: 1440px; margin: 0 auto; }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-title { font-size: 20px; font-weight: 700; color: var(--text); }
.page-sub { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

/* ── STATS BAR ── */
.stats-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 120px;
  box-shadow: var(--shadow);
}

.stat-card .stat-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.stat-card .stat-val { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1.2; }
.stat-card .stat-sub { font-size: 11px; color: var(--text-muted); }
.stat-card.accent { border-color: var(--accent); background: var(--accent-light); }
.stat-card.accent .stat-val { color: var(--accent); }
.stat-card.warn .stat-val { color: #d97706; }
.stat-card.success .stat-val { color: #059669; }

/* ── FILTERS ── */
.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.search-wrap svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-wrap input {
  width: 100%;
  padding: 9px 14px 9px 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 13.5px;
  color: var(--text);
  outline: none;
  transition: border 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow);
}

.search-wrap input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.search-wrap input::placeholder { color: var(--text-muted); }

.filter-select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 12px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  outline: none;
  box-shadow: var(--shadow);
  transition: border 0.15s;
}
.filter-select:focus { border-color: var(--accent); }

.total-label { font-size: 13px; color: var(--text-muted); white-space: nowrap; margin-left: 4px; }

.show-empty-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
.show-empty-toggle input { cursor: pointer; accent-color: var(--accent); }

/* ── TABLE ── */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

table { width: 100%; border-collapse: collapse; }

thead th {
  padding: 11px 16px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background 0.1s;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f9fafb; }

td { padding: 13px 16px; vertical-align: middle; }

.cell-company { font-weight: 600; font-size: 13.5px; color: var(--text); }
.cell-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── BADGES ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-t1 { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.badge-t2 { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
.badge-t3 { background: #f9fafb; color: #6b7280; border: 1px solid #e5e7eb; }

.badge-new       { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
.badge-messaged  { background: #f5f3ff; color: #7c3aed; border: 1px solid #ddd6fe; }
.badge-replied   { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.badge-hot       { background: #fff7ed; color: #ea580c; border: 1px solid #fed7aa; }
.badge-converted { background: #ecfdf5; color: #047857; border: 1px solid #6ee7b7; }
.badge-dead      { background: #f9fafb; color: #9ca3af; border: 1px solid #e5e7eb; }
.badge-default   { background: #f3f4f6; color: #6b7280; border: 1px solid #e5e7eb; }

.score-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  border: 2px solid;
}
.score-high { color: #059669; border-color: #a7f3d0; background: #ecfdf5; }
.score-mid  { color: #d97706; border-color: #fde68a; background: #fffbeb; }
.score-low  { color: #9ca3af; border-color: #e5e7eb; background: #f9fafb; }

/* ── PAGINATION ── */
.pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 20px 0 4px;
  align-items: center;
}

.pagination button {
  height: 34px;
  min-width: 34px;
  padding: 0 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.pagination button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.pagination button.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.pagination button:disabled { opacity: 0.35; cursor: default; }
.pagination .pg-dots { color: var(--text-muted); padding: 0 4px; font-size: 13px; }

/* ── MODAL ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.45);
  z-index: 200;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 20px;
  overflow-y: auto;
  backdrop-filter: blur(2px);
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
  max-width: 740px;
  box-shadow: var(--shadow-md);
  position: relative;
  animation: slideUp 0.2s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.modal-header {
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.modal-badges { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

.modal-close {
  position: absolute;
  top: 18px;
  right: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 30px;
  height: 30px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.modal-close:hover { background: #f3f4f6; color: var(--text); }

.modal-body { padding: 24px 28px; }

/* ── INFO GRID ── */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.info-item label {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.info-item .val {
  font-size: 13.5px;
  color: var(--text);
  font-weight: 500;
}

.info-item .val a { color: var(--accent); text-decoration: none; }
.info-item .val a:hover { text-decoration: underline; }

/* ── SECTION ── */
.section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin: 22px 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

/* ── FORM ELEMENTS ── */
.field-input, .field-textarea, .field-select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13.5px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  font-family: inherit;
  transition: border 0.15s, box-shadow 0.15s;
}
.field-input:focus, .field-textarea:focus, .field-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.field-textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
.field-select { cursor: pointer; }

/* ── MESSAGE CARDS ── */
.msg-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
  background: var(--bg);
  transition: border-color 0.15s;
}
.msg-card:hover { border-color: #d1d5db; }
.msg-card.approved { border-color: #6ee7b7; background: #f0fdf4; }

.msg-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.msg-type-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
}

.msg-subject {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 6px;
}

.msg-body {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: pre-wrap;
  max-height: 180px;
  overflow-y: auto;
  line-height: 1.6;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 10px 12px;
}

.msg-actions { display: flex; gap: 8px; margin-top: 10px; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 6px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-success { background: #059669; color: #fff; }
.btn-success:hover { background: #047857; }
.btn-ghost { background: var(--surface); color: var(--text-secondary); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }

/* ── PITCH PANEL ── */
.pitch-panel {
  background: var(--accent-light);
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 4px;
}
.pitch-panel .pitch-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 4px;
}
.pitch-panel .pitch-text { font-size: 13px; color: #1e40af; font-weight: 500; }
.pitch-panel .pitch-desc { font-size: 12px; color: #3b82f6; margin-top: 3px; }

/* ── DASHBOARD ── */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.dash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.dash-card .dc-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 6px; }
.dash-card .dc-value { font-size: 30px; font-weight: 800; color: var(--text); line-height: 1.1; }
.dash-card .dc-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.dash-card.dc-accent { border-color: var(--accent); }
.dash-card.dc-accent .dc-value { color: var(--accent); }
.dash-card.dc-warn .dc-value { color: #d97706; }
.dash-card.dc-success .dc-value { color: #059669; }

.progress-wrap { margin-bottom: 28px; }
.progress-header { display: flex; justify-content: space-between; margin-bottom: 8px; }
.progress-header .prog-label { font-size: 13px; font-weight: 600; color: var(--text); }
.progress-header .prog-pct { font-size: 13px; font-weight: 700; color: var(--accent); }
.progress-track { height: 10px; background: #e5e7eb; border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent) 0%, #818cf8 100%); border-radius: 99px; transition: width 0.6s ease; }

.lists-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}
.lists-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.list-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.list-card h4 {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--border-light);
}
.list-row:last-child { border-bottom: none; }
.list-row .lk { font-size: 13px; color: var(--text-secondary); }
.list-row .lv { font-size: 13px; font-weight: 700; color: var(--text); }

/* ── LOGIN ── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  width: 380px;
  box-shadow: var(--shadow-md);
}
.login-logo { font-size: 22px; font-weight: 800; color: var(--accent); margin-bottom: 4px; }
.login-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 32px; }
.login-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.login-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  margin-bottom: 14px;
  transition: border 0.15s, box-shadow 0.15s;
}
.login-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.login-btn {
  width: 100%;
  padding: 11px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.login-btn:hover { background: var(--accent-hover); }
.login-error { color: #dc2626; font-size: 13px; margin-top: 10px; text-align: center; display: none; }

/* ── EMPTY STATE ── */
.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 36px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }
