:root {
  --bg: #f6f3ee;
  --panel: #ffffff;
  --ink: #1f1b16;
  --muted: #6f675d;
  --line: #e7e1d8;
  --soft: #f0ebe3;
  --accent: #e8622a;
  --accent-ink: #ffffff;
  --accent-soft: #fde9df;
  --good: #2f8a5b;
  --warn: #c7841a;
  --bad: #c43d3d;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(31, 27, 22, .05), 0 4px 16px rgba(31, 27, 22, .04);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-size: 30px; line-height: 1.15; margin: 0 0 4px; letter-spacing: -.02em; }
h2 { font-size: 18px; margin: 0 0 12px; }
.sub { color: var(--muted); margin: 0 0 20px; }

/* layout */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; padding: 18px 14px; border-right: 1px solid var(--line); background: var(--bg); display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; padding: 4px 10px 18px; letter-spacing: -.01em; }
.brand .logo { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 800; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; text-decoration: none; font-weight: 600; color: var(--ink); }
.nav a:hover { background: var(--soft); }
.nav a.on { background: var(--accent-soft); color: #a13f12; }
.nav svg { width: 20px; height: 20px; flex: none; }
.nav a .soon { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--muted); }
.nav .badge { margin-left: auto; background: var(--accent); color: #fff; border-radius: 999px; font-size: 12px; padding: 1px 8px; }
.side .spacer { flex: 1; }
.hqlink { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px; border-radius: 12px; background: var(--ink); color: #fff; text-decoration: none; }
.hqlink svg { width: 20px; height: 20px; flex: none; }
.hqlink b { display: block; font-size: 14px; }
.hqlink small { display: block; font-size: 12px; color: #d8cfc5; }
.hqlink .arrow { margin-left: auto; }
.hqlink:hover { filter: brightness(1.15); }
.main { padding: 28px clamp(16px, 3vw, 40px) 100px; max-width: 1240px; width: 100%; }
.mobilebar { display: none; }

/* pieces */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.grid { display: grid; gap: 14px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat .label { color: var(--muted); font-size: 13px; font-weight: 600; }
.stat .num { font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.empty { color: var(--muted); text-align: center; padding: 28px 12px; }
.hr { height: 1px; background: var(--line); margin: 14px 0; }

.btn { border: 1px solid var(--line); background: var(--panel); padding: 9px 14px; border-radius: 10px; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.btn:hover { background: var(--soft); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(.95); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: default; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chip { border: 1px solid var(--line); background: var(--panel); padding: 7px 13px; border-radius: 999px; font-weight: 600; font-size: 14px; white-space: nowrap; cursor: pointer; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }

label.f { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13px; color: var(--muted); }
input, select, textarea { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 12px; width: 100%; font-size: 15px; color: var(--ink); }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

.list { display: flex; flex-direction: column; }
.item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: none; }
.item .grow { flex: 1; min-width: 0; }
.item .title { font-weight: 700; }
.item .meta { color: var(--muted); font-size: 13px; }
.clip { white-space: pre-line; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.pill { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 9px; background: var(--soft); color: var(--muted); white-space: nowrap; }
.pill.lead { background: #e6f2ff; color: #1d5fa8; }
.pill.text { background: #e9f6ee; color: #23744a; }
.pill.email { background: #f3ecff; color: #6a3bb5; }
.pill.call { background: #fff3df; color: #9a6210; }
.pill.late { background: #fde4e4; color: var(--bad); }

table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 10px; border-bottom: 1px solid var(--line); }
table.t td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:last-child td { border-bottom: none; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: #fbf9f5; }

/* today hero */
.hero { background: linear-gradient(135deg, #2a211a 0%, #3b2a1f 55%, #e8622a 140%); color: #fff; border-radius: 20px; padding: 28px; display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: center; margin-bottom: 16px; }
.hero h1 { font-size: 34px; }
.hero p { color: #f1e7dd; margin: 6px 0 18px; }
.hero .btn { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.2); color: #fff; }
.hero .btn.primary { background: #fff; color: var(--ink); border-color: #fff; }
.ring { display: flex; align-items: center; gap: 18px; }
.ring button { background: none; border: none; padding: 0; cursor: pointer; color: #fff; }
.ring .lbl { font-weight: 700; }
.ring .lbl small { display: block; font-weight: 500; color: #f1e7dd; }

.stagebar { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.stagebar a { text-decoration: none; background: var(--soft); border-radius: 12px; padding: 12px; }
.stagebar a b { display: block; font-size: 22px; }
.stagebar a span { font-size: 12px; font-weight: 600; color: var(--muted); }

.bars { display: flex; align-items: flex-end; gap: 6px; height: 110px; padding-top: 8px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bars .bar i { display: block; width: 100%; background: var(--accent); border-radius: 6px 6px 2px 2px; min-height: 3px; opacity: .85; }
.bars .bar.zero i { background: var(--line); }
.bars .bar span { font-size: 11px; color: var(--muted); }

/* pipeline */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; }
.col { background: var(--soft); border-radius: var(--radius); padding: 12px; min-height: 260px; }
.col.over { outline: 2px dashed var(--accent); }
.col h3 { font-size: 14px; margin: 0 0 10px; display: flex; justify-content: space-between; }
.col h3 small { color: var(--muted); font-weight: 600; }
.pcard { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 8px; cursor: grab; box-shadow: var(--shadow); }
.pcard .title { font-weight: 700; }
.pcard .meta { color: var(--muted); font-size: 13px; }
.pcard select { margin-top: 8px; padding: 6px 8px; font-size: 13px; }
.pcard.stuck { border-left: 4px solid var(--warn); }

/* contact page */
.timeline .item .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); margin-top: 6px; flex: none; }
.timeline .item.out .dot { background: var(--accent); }
.timeline .item.in .dot { background: #1d5fa8; }

/* modal + toast */
.modal-wrap { position: fixed; inset: 0; background: rgba(31,27,22,.35); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: #fff; border-radius: 18px; padding: 22px; width: min(520px, 100%); max-height: 90vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(120px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; transition: transform .25s, opacity .25s; z-index: 60; max-width: 90vw; opacity: 0; visibility: hidden; }
#toast.show { transform: translateX(-50%) translateY(0); opacity: 1; visibility: visible; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login .card { width: min(400px, 100%); padding: 28px; }

/* phone */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .main { padding: 18px 14px 96px; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g2 { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; padding: 22px; }
  .hero h1 { font-size: 28px; }
  .stagebar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  h1 { font-size: 26px; }
  .mobilebar { display: grid; grid-template-columns: repeat(6, 1fr); position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 40; }
  .mobilebar a { text-decoration: none; text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); padding: 6px 0; display: flex; flex-direction: column; align-items: center; gap: 2px; }
  .mobilebar a.on { color: var(--accent); }
  .mobilebar a.hq { color: var(--ink); }
  .mobilebar svg { width: 22px; height: 22px; }
  .hide-sm { display: none; }
}
