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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  background: #f5f5f5;
  color: #1a1a1a;
}

nav {
  background: #1a1a2e;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: 52px;
}
.nav-brand { font-weight: 700; font-size: 1.1rem; letter-spacing: 0.02em; }
.nav-links { display: flex; align-items: center; gap: 1rem; }
.nav-links a { color: #ccc; text-decoration: none; }
.nav-links a:hover { color: #fff; }

.btn-trigger {
  background: #e94560;
  color: #fff;
  border: none;
  padding: 0.4rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}
.btn-trigger:hover { background: #c73652; }

main { max-width: 1400px; margin: 0 auto; padding: 1.5rem; }

.page-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.page-header h1 { font-size: 1.4rem; font-weight: 700; }

.status-tabs { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.tab {
  padding: 0.3rem 0.9rem;
  border-radius: 20px;
  background: #e0e0e0;
  color: #333;
  text-decoration: none;
  font-size: 13px;
}
.tab.active { background: #1a1a2e; color: #fff; }
.badge {
  display: inline-block;
  background: #e94560;
  color: #fff;
  border-radius: 10px;
  padding: 0 5px;
  font-size: 11px;
  margin-left: 4px;
}

.flash-container { padding: 0.75rem 1.5rem; }
.flash { padding: 0.6rem 1rem; border-radius: 4px; margin-bottom: 0.5rem; }
.flash-success { background: #d4edda; color: #155724; }
.flash-error   { background: #f8d7da; color: #721c24; }
.flash-warning { background: #fff3cd; color: #856404; }
.flash-info    { background: #d1ecf1; color: #0c5460; }

.draft-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.draft-table th {
  background: #1a1a2e;
  color: #fff;
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
}
.draft-table td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid #eee;
  vertical-align: top;
}
.draft-table tr:last-child td { border-bottom: none; }
.draft-table tr:hover td { background: #f9f9f9; }
.row-review td { background: #fffbf0; }

.score { font-weight: 700; color: #1a1a2e; white-space: nowrap; }
.job-title a { color: #1a1a2e; font-weight: 600; text-decoration: none; }
.job-title a:hover { text-decoration: underline; }
.email { color: #666; }
.linkedin a { color: #0a66c2; }
.no-email { color: #999; font-style: italic; }
.error-count { color: #e94560; font-weight: 700; }
.empty { color: #999; padding: 2rem 0; }

/* Draft detail */
.draft-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 900px) { .draft-layout { grid-template-columns: 1fr; } }

.card {
  background: #fff;
  border-radius: 6px;
  padding: 1.25rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  margin-bottom: 1rem;
}
.card h2 { font-size: 1rem; font-weight: 700; margin-bottom: 0.75rem; color: #1a1a2e; }

dl { display: grid; grid-template-columns: 110px 1fr; gap: 0.4rem 0.75rem; }
dt { font-weight: 600; color: #555; }
dd { color: #1a1a2e; }

.input-full {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  font-size: 14px;
  margin-bottom: 0.75rem;
  font-family: inherit;
}
textarea.input-full { resize: vertical; font-family: 'Courier New', monospace; }
.input-full:focus { outline: none; border-color: #1a1a2e; }

label { display: block; font-weight: 600; margin-bottom: 0.3rem; color: #555; font-size: 13px; }

.action-row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; margin-top: 0.5rem; }

.btn {
  display: inline-block;
  padding: 0.4rem 1rem;
  border-radius: 4px;
  border: 1px solid #ccc;
  background: #f5f5f5;
  color: #333;
  cursor: pointer;
  font-size: 13px;
  text-decoration: none;
}
.btn:hover { background: #e8e8e8; }
.btn-send { background: #1a6e3c; color: #fff; border-color: #1a6e3c; }
.btn-send:hover { background: #145930; }
.btn-reject { background: #e94560; color: #fff; border-color: #e94560; }
.btn-reject:hover { background: #c73652; }
.btn-view { background: #1a1a2e; color: #fff; border-color: #1a1a2e; }
.btn-view:hover { background: #2a2a4e; }

.email-preview { background: #f9f9f9; padding: 1rem; border-radius: 4px; }
.email-preview pre { white-space: pre-wrap; font-family: inherit; font-size: 14px; }

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 13px;
}
.status-pending     { background: #fff3cd; color: #856404; }
.status-needs_review { background: #ffe4b5; color: #7a4d00; }
.status-sent        { background: #d4edda; color: #155724; }
.status-rejected    { background: #f8d7da; color: #721c24; }
.status-approved    { background: #d1ecf1; color: #0c5460; }

.card-action-needed { border: 2px solid #e94560; }
.needs-action { background: #e94560; color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 3px; margin-left: 8px; vertical-align: middle; }
.dm-hint { color: #666; font-size: 13px; margin-bottom: 0.75rem; }
.btn-linkedin { background: #0a66c2; color: #fff; border-color: #0a66c2; display: inline-block; margin-top: 0.25rem; }
.btn-linkedin:hover { background: #084e96; }
.find-dm { color: #0a66c2; font-size: 12px; font-weight: 600; text-decoration: none; }
.find-dm:hover { text-decoration: underline; }

/* Login */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: #1a1a2e; }
.login-box { background: #fff; border-radius: 8px; padding: 2.5rem; width: 100%; max-width: 360px; box-shadow: 0 4px 24px rgba(0,0,0,0.3); }
.login-brand { font-size: 1.4rem; font-weight: 700; color: #1a1a2e; margin-bottom: 0.25rem; }
.login-sub { color: #999; font-size: 13px; margin-bottom: 1.5rem; }
.login-box label { margin-top: 0.75rem; }
.nav-logout { color: #aaa; font-size: 13px; }

/* Pipeline live log panel */
#pipeline-panel {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 260px;
  background: #0d1117;
  border-top: 2px solid #e94560;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}
#pipeline-header {
  padding: 0.4rem 1rem;
  background: #161b22;
  font-size: 13px;
  font-weight: 600;
  color: #e94560;
  flex-shrink: 0;
}
#pipeline-log {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 1rem;
  margin: 0;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.6;
  color: #c9d1d9;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Pipeline status pill in nav */
.pipeline-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: background 0.3s;
}
.pipeline-idle  { background: #2a2a3e; color: #888; }
.pipeline-idle:hover { background: #333355; }
.pipeline-running { background: #1a3a1a; color: #4caf50; }
.pill-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.pipeline-running .pill-dot {
  animation: pulse 1.2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}
