/* Pipeline — spartan internal tool. Works at 380px. */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  color: #1a1a1a;
  background: #f5f5f2;
}
.hidden { display: none !important; }
.muted { color: #777; }
button { cursor: pointer; font: inherit; }
input, select, textarea, button {
  font: inherit;
  padding: 6px 8px;
  border: 1px solid #bbb;
  border-radius: 4px;
  background: #fff;
  max-width: 100%;
}
button.primary, .auth-box button {
  background: #1a5c3a;
  color: #fff;
  border-color: #1a5c3a;
}
button.linkish {
  background: none; border: none; color: #1a5c3a; text-decoration: underline; padding: 4px;
}

/* Auth */
.auth-box {
  max-width: 340px; margin: 15vh auto; padding: 24px;
  background: #fff; border: 1px solid #ddd; border-radius: 8px;
}
.auth-box form { display: flex; flex-direction: column; gap: 8px; }

/* Nav */
nav {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 10px 14px; background: #1a5c3a; color: #fff;
}
nav .brand { font-weight: 700; margin-right: 6px; }
nav a { color: #d9ead9; text-decoration: none; padding: 2px 4px; }
nav a.active { color: #fff; border-bottom: 2px solid #fff; }
nav #signout { margin-left: auto; color: #d9ead9; }

main { padding: 14px; max-width: 1200px; margin: 0 auto; }
h2 { margin: 6px 0 12px; font-size: 19px; }
h3 { margin: 16px 0 8px; font-size: 15px; }

/* Cards / lists */
.card {
  background: #fff; border: 1px solid #ddd; border-radius: 6px;
  padding: 10px 12px; margin-bottom: 8px;
}
.card a.lead-name { font-weight: 600; color: #1a5c3a; text-decoration: none; }
.card .meta { font-size: 13px; color: #666; margin-top: 2px; }
.card.overdue { border-left: 4px solid #c0392b; }
.card.due-today { border-left: 4px solid #e67e22; }
.tag {
  display: inline-block; font-size: 11px; background: #eee; color: #555;
  border-radius: 3px; padding: 1px 5px; margin-right: 3px;
}

/* Pipeline board: horizontal scroll on all widths */
.board { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 10px; }
.board .col { min-width: 230px; width: 230px; flex-shrink: 0; }
.board .col h3 {
  margin: 0 0 6px; font-size: 13px; text-transform: uppercase;
  letter-spacing: .04em; color: #555;
}
.board .card { margin-bottom: 6px; }
.board select { width: 100%; margin-top: 6px; font-size: 13px; }

/* Lead detail */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 640px; }
.detail-grid label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: #555; }
.detail-grid input, .detail-grid select { width: 100%; }
.detail-grid .full { grid-column: 1 / -1; }
.actions-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.activity {
  border-left: 3px solid #ccc; padding: 4px 10px; margin-bottom: 8px; font-size: 14px;
}
.activity .when { font-size: 12px; color: #888; }
.quick-note { display: flex; gap: 6px; margin: 10px 0; max-width: 640px; }
.quick-note input { flex: 1; }

/* Clients */
table.clients { width: 100%; border-collapse: collapse; background: #fff; }
table.clients th, table.clients td {
  text-align: left; padding: 8px; border-bottom: 1px solid #e5e5e5;
  font-size: 14px; vertical-align: top;
}
.helpblock {
  background: #fff8e6; border: 1px solid #e8d9a0; border-radius: 6px;
  padding: 12px 14px; margin-top: 18px; font-size: 14px; max-width: 700px;
}
.helpblock ol { margin: 8px 0 0 18px; padding: 0; }

/* Import */
.import-box { max-width: 560px; }
.import-report { margin-top: 12px; }

/* Toast */
#toast {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
  background: #333; color: #fff; padding: 8px 16px; border-radius: 6px;
  font-size: 14px; z-index: 10; max-width: 90vw;
}

/* Mobile (Today view is the target — must work at 380px) */
@media (max-width: 480px) {
  main { padding: 10px; }
  .detail-grid { grid-template-columns: 1fr; }
  nav { gap: 10px; font-size: 14px; }
  table.clients { display: block; overflow-x: auto; }
}

/* Nudges (Today) */
.nudge {
  border-radius: 6px; padding: 10px 14px; margin-bottom: 12px;
  font-size: 14px; border: 1px solid;
}
.nudge div { margin-top: 4px; }
.nudge-due  { background: #fff8e6; border-color: #e8d9a0; }
.nudge-stop { background: #f2f2f2; border-color: #d5d5d5; }

/* Scores */
.score {
  display: inline-block; min-width: 30px; text-align: center;
  padding: 1px 6px; border-radius: 10px; font-size: 13px; font-weight: 600;
}
.score-hot  { background: #fde2e0; color: #8c2016; }
.score-warm { background: #fdf0d5; color: #8a6212; }
.score-cool { background: #e6eef7; color: #2b4a6f; }
.score-none { background: #eee; color: #888; font-weight: 400; }

/* Status pills */
.pill {
  display: inline-block; padding: 1px 8px; border-radius: 10px;
  font-size: 12px; text-transform: uppercase; letter-spacing: .03em;
}
.pill-queued   { background: #e6eef7; color: #2b4a6f; }
.pill-running  { background: #fdf0d5; color: #8a6212; }
.pill-done     { background: #e3f2e5; color: #1f5c2b; }
.pill-failed   { background: #fde2e0; color: #8c2016; }
.pill-canceled { background: #eee;    color: #777; }
.pill-pending_review { background: #fdf0d5; color: #8a6212; }
.pill-approved { background: #e3f2e5; color: #1f5c2b; }
.pill-rejected { background: #fde2e0; color: #8c2016; }

/* Runs */
.banner {
  border-radius: 6px; padding: 10px 14px; margin-bottom: 14px;
  font-size: 14px; border: 1px solid;
}
.banner-on  { background: #e3f2e5; border-color: #b6ddbd; }
.banner-off { background: #fde2e0; border-color: #eeb3ad; }
.scan-form {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px; max-width: 700px; background: #fff;
  border: 1px solid #e0e0e0; border-radius: 6px; padding: 14px; margin-bottom: 20px;
}
.scan-form label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: #555; }
.scan-form input[type=text], .scan-form input:not([type=checkbox]) { width: 100%; }
.scan-form label.check { flex-direction: row; align-items: center; gap: 6px; }
.scan-form button { grid-column: 1 / -1; justify-self: start; }
.run-card { border-left: 3px solid #ccc; }
.run-done     { border-left-color: #4c9a5c; }
.run-failed   { border-left-color: #c0392b; }
.run-running  { border-left-color: #d8a63c; }
.run-canceled { border-left-color: #bbb; }
.run-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.run-summary { margin-top: 8px; }
.run-stats { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; }
.cli-output {
  background: #1e1e1e; color: #eaeaea; padding: 10px 12px; border-radius: 5px;
  font-size: 12px; line-height: 1.45; overflow-x: auto; white-space: pre-wrap;
  margin: 8px 0 0; max-height: 320px;
}

@media (max-width: 480px) {
  .scan-form { grid-template-columns: 1fr; }
}

/* Review */
.review-bar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin: 14px 0; padding: 10px 12px; background: #fff;
  border: 1px solid #e0e0e0; border-radius: 6px;
}
.review-bar .grow { flex: 1; }
.inline-filter { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #555; }
table.review { width: 100%; border-collapse: collapse; background: #fff; }
table.review th, table.review td {
  text-align: left; padding: 7px 8px; border-bottom: 1px solid #eee;
  font-size: 14px; vertical-align: top;
}
table.review th { font-size: 12px; text-transform: uppercase; color: #777; letter-spacing: .03em; }
table.review td.num, table.review th:nth-child(2) { text-align: right; white-space: nowrap; }
table.review tr.hidden { display: none; }
table.review tr.row-blocked { opacity: .55; }
.tag-warn { background: #fdf0d5; color: #8a6212; }
.tag-ok   { background: #e3f2e5; color: #1f5c2b; text-decoration: none; }

/* Audits */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 4px; }
.tab {
  background: #eee; border: 1px solid #ddd; border-radius: 14px;
  padding: 3px 12px; font-size: 13px; cursor: pointer;
}
.tab.active { background: #2b4a6f; border-color: #2b4a6f; color: #fff; }
.audit-card .actions-row { margin: 10px 0 0; }
.reject-note { color: #8c2016; }
.pdf-frame {
  width: 100%; height: 70vh; border: 1px solid #ddd; border-radius: 4px;
  margin-top: 10px; background: #fff;
}

@media (max-width: 480px) {
  table.review { display: block; overflow-x: auto; }
  .pdf-frame { height: 55vh; }
}

/* Detail-page subhead, used outside .card by the lead and client screens */
main > .meta { font-size: 13px; color: #666; margin: -6px 0 12px; }
main > .meta a { color: #1a5c3a; }

/* Outreach console */
.outreach {
  background: #fff; border: 1px solid #ddd; border-radius: 6px;
  padding: 12px 14px; margin-top: 6px; max-width: 700px;
}
.outreach-controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.outreach-controls .grow { flex: 1; min-width: 180px; }
.cadence { font-size: 13px; color: #555; margin: 8px 0 0; }
.cadence-due  { color: #a35400; }
.cadence-stop { color: #8c2016; font-weight: 600; }
.cadence-row  { font-size: 12px; color: #888; margin-top: 2px; }
.tpl-body {
  white-space: pre-wrap; font-size: 14px; line-height: 1.45;
  background: #fafaf7; border: 1px solid #e5e5e5; border-radius: 4px;
  padding: 10px 12px; margin: 10px 0;
}
.merge-missing { background: #ffe9a8; color: #7a5300; border-radius: 3px; padding: 0 2px; }
.banner-warn {
  background: #fff8e6; border: 1px solid #e8d9a0; border-radius: 4px;
  padding: 6px 10px; font-size: 13px; margin-bottom: 8px;
}
/* Logged outreach shows the exact text that went out, so keep its line breaks */
.activity-body { white-space: pre-wrap; margin: 4px 0 0; }

/* Client workspace */
.health {
  font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  border-radius: 3px; padding: 2px 7px; vertical-align: middle;
}
.health-green  { background: #e3f2e5; color: #1f5c2b; }
.health-yellow { background: #fff3d4; color: #7a5300; }
.health-red    { background: #fde8e6; color: #8c2016; }

table.workspace { width: 100%; border-collapse: collapse; background: #fff; }
table.workspace th, table.workspace td {
  text-align: left; padding: 6px 8px; border-bottom: 1px solid #e5e5e5;
  font-size: 14px; vertical-align: middle;
}
table.workspace th { font-size: 12px; color: #666; font-weight: 600; }
table.workspace input[type="text"], table.workspace input:not([type]),
table.workspace input[type="date"], table.workspace select { width: 100%; }
table.workspace td.num { text-align: right; white-space: nowrap; width: 1%; }
table.workspace tr.deliv-done td input, table.workspace tr.deliv-done td select { opacity: .6; }
table.workspace tr.deliv-blocked { background: #fdf1f0; }
.add-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 4px; }
.add-row input { flex: 1; min-width: 120px; }

@media (max-width: 480px) {
  table.workspace { display: block; overflow-x: auto; }
  .outreach-controls .grow { min-width: 100%; }
}

/* Copy and Copy-&-log wrap together, never split across two rows */
.btn-group { display: inline-flex; gap: 6px; }
