:root {
  --bg:#0b0b0c; --card:#151517; --text:#f4f4f5; --muted:#9ca3af;
  --accent:#22c55e; --skip:#ef4444; --neutral:#3f3f46;
  --border:#26262a; --link:#93c5fd;
}
* { box-sizing: border-box; font-family: -apple-system, Inter, system-ui, sans-serif; }
body {
  background: var(--bg); color: var(--text); margin: 0; padding: 24px;
  line-height: 1.5;
}
header {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--border);
}
h1 { font-weight: 600; letter-spacing: -0.02em; margin: 0 0 4px; font-size: 26px; }
.sub { color: var(--muted); font-size: 14px; }
.counters { display: flex; gap: 16px; font-size: 13px; color: var(--muted); align-items: flex-end; }
.counters strong { color: var(--text); font-size: 18px; display: block; }
.counters .logout {
  color: var(--muted); text-decoration: none; padding: 6px 12px;
  border: 1px solid var(--border); border-radius: 6px; font-size: 13px;
  margin-left: 8px;
}
.counters .logout:hover { color: var(--text); border-color: var(--muted); }

.lead {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 18px 20px; margin-bottom: 16px; transition: opacity 0.2s;
}
.lead.skipped { opacity: 0.35; }
.lead-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 12px;
}
.lead-header h2 { margin: 0 0 2px; font-size: 17px; font-weight: 600; }
.lead-header .company { color: #e5e7eb; font-size: 14px; }
.lead-header .details {
  color: var(--muted); font-size: 12px; line-height: 1.5; margin-top: 6px;
}
.lead-header a { color: var(--link); text-decoration: none; }
.lead-header a:hover { text-decoration: underline; }
.actions-row { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

.messages { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.msg {
  background: #0f0f11; border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; display: flex; flex-direction: column;
}
.msg h3 {
  margin: 0 0 6px; font-size: 11px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em;
  display: flex; align-items: center; gap: 8px;
}
.msg pre {
  margin: 0 0 10px; white-space: pre-wrap;
  font-family: -apple-system, Inter, system-ui;
  font-size: 12.5px; line-height: 1.5; color: #d1d5db; flex: 1;
}
.msg-actions { display: flex; gap: 6px; }

button {
  border: 0; border-radius: 6px; padding: 7px 12px;
  font-weight: 600; cursor: pointer; font-size: 12px;
  transition: filter 0.15s;
}
button:hover { filter: brightness(1.1); }
.btn-approve { background: var(--accent); color: #0b0b0c; flex: 1; }
.btn-approve-all { background: var(--accent); color: #0b0b0c; padding: 9px 16px; font-size: 13px; }
.btn-skip { background: var(--skip); color: white; padding: 9px 16px; font-size: 13px; }
.btn-secondary { background: var(--neutral); color: white; }

.status-tag {
  padding: 3px 8px; border-radius: 4px; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em; display: inline-block;
}
.status-tag.sent { background: var(--accent); color: #0b0b0c; }
.status-tag.skipped { background: var(--skip); color: white; }

.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: #22c55e; color: #0b0b0c;
  padding: 12px 18px; border-radius: 8px; font-weight: 600; font-size: 13px;
  opacity: 0; transform: translateY(10px);
  transition: all 0.2s; z-index: 10; max-width: 360px;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #ef4444; color: white; }

.toolbar {
  display: flex; gap: 8px; margin-bottom: 16px; padding: 12px;
  background: var(--card); border: 1px solid var(--border); border-radius: 8px;
}
.toolbar-info { color: var(--muted); font-size: 13px; flex: 1; align-self: center; }

.empty-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 40px; text-align: center;
}
.empty-card h2 { margin: 0 0 8px; font-weight: 600; }
.empty-card p { color: var(--muted); margin: 0; }
.empty-card code {
  background: #0f0f11; padding: 2px 8px; border-radius: 4px;
  font-family: "SF Mono", Menlo, monospace; font-size: 13px;
}

/* --- Login page --- */
.login-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 24px;
}
.login-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 32px; width: 100%; max-width: 380px;
  display: flex; flex-direction: column; gap: 14px;
}
.login-card h1 { margin: 0; font-size: 22px; }
.login-card .sub { margin: 0 0 8px; }
.login-card label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 13px; color: var(--muted);
}
.login-card input {
  background: #0f0f11; border: 1px solid var(--border); color: var(--text);
  padding: 10px 12px; border-radius: 6px; font-size: 14px;
}
.login-card input:focus { outline: 0; border-color: var(--accent); }
.login-card button {
  background: var(--accent); color: #0b0b0c;
  padding: 10px; font-size: 14px; margin-top: 4px;
}
.login-card .error {
  background: rgba(239, 68, 68, 0.15); border: 1px solid var(--skip);
  color: var(--skip); padding: 8px 12px; border-radius: 6px; font-size: 13px;
}

@media (max-width: 900px) {
  .messages { grid-template-columns: 1fr; }
  header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .lead-header { flex-direction: column; gap: 12px; }
  .actions-row { width: 100%; }
  .actions-row button { flex: 1; }
}
