:root {
  --paper: #f3eee4;
  --paper-2: #fbf7f0;
  --ink: #1c2421;
  --muted: #5c675f;
  --line: #e2d5c4;
  --sidebar: #1a2621;
  --sidebar-text: #e7efe9;
  --sidebar-muted: #b7c4bb;
  --copper: #8d3f22;
  --copper-deep: #6f3018;
  --moss: #1f6b45;
  --amber: #f3d48a;
  --amber-ink: #3d2c08;
  --danger: #8c2f2f;
  --serif: "Fraunces", "Iowan Old Style", Palatino, Georgia, serif;
  --sans: "Source Sans 3", "Segoe UI", sans-serif;
  --shadow: 0 1px 0 rgba(28, 36, 33, 0.04);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.5;
}
a { color: var(--copper-deep); }
a:hover { color: var(--copper); }
h1, h2, h3, .hero-name, .brand strong, .stat b {
  font-family: var(--serif);
  font-weight: 560;
  letter-spacing: -0.02em;
}
h1 { font-size: 1.7rem; margin: 0; }
h2 { font-size: 1.25rem; margin: 0 0 0.4rem; }
h3 { font-size: 1.05rem; margin: 0; }
p { margin: 0 0 0.8rem; }

.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--sidebar);
  color: var(--sidebar-text);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.brand { display: flex; gap: 10px; align-items: center; color: inherit; text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center;
  background: #24352d; color: #f4efe6;
  font-family: var(--serif); font-size: 1rem;
}
.brand strong { display: block; font-size: 1.15rem; }
.brand small { color: var(--sidebar-muted); }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a {
  color: var(--sidebar-text); text-decoration: none;
  padding: 8px 10px; border-radius: 10px;
  display: flex; justify-content: space-between; align-items: center;
}
.nav a.active, .nav a:hover { background: #24352d; }
.count {
  background: var(--amber); color: var(--amber-ink);
  border-radius: 999px; min-width: 1.4rem; text-align: center;
  font-size: 0.78rem; font-weight: 700; padding: 0 6px;
}
.sidebar-foot { margin-top: auto; color: var(--sidebar-muted); font-size: 0.92rem; }
.linkish, button.linkish {
  background: none; border: 0; color: var(--sidebar-text);
  padding: 0; cursor: pointer; font: inherit; text-decoration: underline;
}
.main { min-width: 0; }
.top {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 28px 0;
}
.nav-toggle { display: none; }
.content { padding: 8px 28px 48px; }
.banner {
  margin: 12px 28px 0;
  background: var(--amber); color: var(--amber-ink);
  border-radius: 12px; padding: 10px 14px; font-weight: 600;
}
.banner.quiet { background: #efe2cc; font-weight: 500; }
.lede { font-size: 1.05rem; max-width: 68ch; }
.fine, .meta { color: var(--muted); font-size: 0.92rem; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.75rem; font-weight: 700; color: var(--muted); margin: 0 0 6px; }

.card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.card-head, .page-actions, .actions, .queue-head, .lead-hero {
  display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap;
}
.stats, .split, .bucket-grid, .grid-2, .lead-grid {
  display: grid; gap: 14px; margin: 14px 0;
}
.stats, .bucket-grid { grid-template-columns: repeat(4, 1fr); }
.split, .lead-grid, .grid-2 { grid-template-columns: 1.3fr 0.9fr; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.lead-grid { align-items: start; grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.8fr); }
.stat { text-decoration: none; color: inherit; }
.stat span { color: var(--muted); font-size: 0.9rem; }
.stat b { display: block; font-size: 2.6rem; line-height: 1; margin-top: 6px; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
  gap: 8px; align-items: baseline;
  padding: 8px 0; border-top: 1px solid var(--line);
}
.rows li:first-child { border-top: 0; }
.rows.compact li { grid-template-columns: 1fr auto; }
.metrics { list-style: none; padding: 0; margin: 0; }
.metrics li { padding: 4px 0; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack > * { margin: 0; }

label { display: flex; flex-direction: column; gap: 6px; font-size: 0.92rem; font-weight: 700; }
input, textarea, select {
  width: 100%; font: inherit; color: inherit; font-weight: 400;
  background: white; border: 1px solid #d9ccba; border-radius: 10px; padding: 10px 12px;
}
textarea { resize: vertical; min-height: 96px; }
.check { flex-direction: row; align-items: center; font-weight: 600; }
.check input { width: auto; }
.inline { display: flex; gap: 8px; align-items: center; }
.inline input, .inline select { width: auto; flex: 1; }
.btn {
  appearance: none; border: 0; cursor: pointer;
  background: var(--copper); color: white; text-decoration: none;
  border-radius: 999px; padding: 10px 16px; font: inherit; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn:hover { background: var(--copper-deep); }
.btn.secondary { background: transparent; color: var(--ink); border: 1px solid #cbbba6; }
.btn.secondary:hover { background: #f3eadc; }
.btn.danger { background: var(--danger); }
.flash { padding: 10px 12px; border-radius: 12px; background: #e5f2ea; }
.flash.error { background: #f8e4e1; }
.chip {
  display: inline-flex; align-items: center; border-radius: 999px;
  padding: 2px 8px; font-size: 0.78rem; font-weight: 700; background: #efe6d8;
}
.status-new { background: #d9e4f2; color: #1d3a5f; }
.status-talking { background: #d9efe4; color: #145c3a; }
.status-cold, .temp-cold { background: #e7e2dc; color: #5c534c; }
.status-re_engaged, .temp-warm { background: #f3e0c8; color: #6a3d12; }
.status-client { background: #dcecc8; color: #2d5016; }
.status-not_now { background: #ece7f6; color: #3d2f6b; }
.status-closed { background: #e6e6e6; color: #333; }
.status-opted_out { background: #f3d6d2; color: #7a2e24; }
.temp-new { background: #efe6d8; }
.temp-warmer { background: #f0c7ae; color: #6a2e12; }
.example-flag {
  display: inline-block;
  background: repeating-linear-gradient(-45deg, #f4e3b2, #f4e3b2 8px, #fbf3dc 8px, #fbf3dc 16px);
  color: #5c4810; font-size: 0.78rem; font-weight: 800;
  padding: 4px 8px; border-radius: 8px;
}
.lead-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.lead-name { font-family: var(--serif); font-size: 1.25rem; text-decoration: none; color: inherit; }
.hero-name { font-size: 2.2rem; margin: 0; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; flex: 1; }
.filters input, .filters select { width: auto; }
.empty, .empty-block { color: var(--muted); }
.callout { background: #f7f1e4; border: 1px dashed #cbbba6; border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 14px 1fr; gap: 12px; padding-bottom: 16px; }
.dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 7px; background: var(--copper); }
.dot.email_sent, .dot.sms_sent, .dot.social_done { background: var(--moss); }
.dot.opt_out, .dot.blocked, .dot.failed { background: var(--danger); }
.dot.email_reply, .dot.sms_reply { background: #1d4e89; }
.event-title { font-weight: 700; }
.event-body { white-space: pre-wrap; color: var(--ink); margin-top: 4px; }
.queue-card textarea { min-height: 180px; }
.form-card, .panel { max-width: 860px; }
.panel.narrow { max-width: 460px; }
.bare { background: linear-gradient(180deg, #efe6d6, var(--paper) 240px); }
.bare-wrap { max-width: 720px; margin: 0 auto; padding: 48px 20px 64px; }
.wordmark { font-family: var(--serif); font-size: 1.4rem; color: inherit; text-decoration: none; display: inline-block; margin-bottom: 18px; }
details.card summary { cursor: pointer; font-weight: 700; }
:focus-visible { outline: 2px solid var(--copper); outline-offset: 2px; }

@media (max-width: 980px) {
  .stats, .bucket-grid, .split, .lead-grid, .grid-2 { grid-template-columns: 1fr; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  body.nav-open .sidebar {
    display: flex; position: fixed; z-index: 20; inset: 0 auto 0 0;
    width: min(280px, 86vw); overflow: auto;
  }
  .nav-toggle {
    display: inline-flex; border: 1px solid var(--line); background: var(--paper-2);
    border-radius: 999px; padding: 6px 12px; font: inherit; cursor: pointer;
  }
  .content, .top { padding-left: 16px; padding-right: 16px; }
  .banner { margin-left: 16px; margin-right: 16px; }
  .rows li { grid-template-columns: 1fr; }
}
