/* ============ BB Marketing Portal — "Marketing Studio" editorial look ============ */
:root {
  --paper: #f7f2e9;
  --paper-2: #efe7d8;
  --ink: #1d1a16;
  --ink-soft: #5c554a;
  --tangerine: #ff5a1f;
  --cobalt: #2743ff;
  --lemon: #ffd23f;
  --pink: #ff7ab6;
  --mint: #2fbf8f;
  --card: #fffdf8;
  --line: #e3daC8;
  --shadow: 0 2px 0 rgba(29,26,22,.9);
  --radius: 14px;
  --display: "Fraunces", Georgia, serif;
  --body: "Space Grotesk", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--body);
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
}
/* paper grain */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 9999;
  opacity: .05; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2, h3, .display { font-family: var(--display); letter-spacing: -.01em; }
button { font-family: var(--body); cursor: pointer; }
input, select, textarea {
  font-family: var(--body); font-size: 14px; color: var(--ink);
  background: #fff; border: 2px solid var(--ink); border-radius: 8px;
  padding: 8px 10px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--cobalt); }
textarea { resize: vertical; min-height: 70px; }
a { color: var(--cobalt); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--ink); color: var(--paper); border: 2px solid var(--ink);
  border-radius: 999px; padding: 9px 18px; font-weight: 700; font-size: 14px;
  transition: transform .08s ease, background .15s;
}
.btn:hover { transform: translate(-1px,-1px); }
.btn:active { transform: translate(1px,1px); }
.btn.primary { background: var(--tangerine); border-color: var(--ink); color: #fff; }
.btn.cobalt { background: var(--cobalt); color: #fff; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.small { padding: 5px 12px; font-size: 12.5px; }
.btn.lemon { background: var(--lemon); color: var(--ink); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }

/* ---------- login ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.login-blob { position: absolute; border-radius: 50%; filter: blur(0px); opacity: .9; }
.login-card {
  position: relative; z-index: 2; background: var(--card);
  border: 3px solid var(--ink); border-radius: 22px; padding: 46px 52px;
  box-shadow: 8px 8px 0 var(--ink); max-width: 460px; text-align: center;
  transform: rotate(-.6deg);
}
.login-kicker {
  display: inline-block; background: var(--lemon); border: 2px solid var(--ink);
  padding: 4px 14px; border-radius: 999px; font-weight: 700; font-size: 12px;
  letter-spacing: 2.5px; transform: rotate(1.5deg); margin-bottom: 18px;
}
.login-card h1 { font-size: 44px; font-weight: 900; margin: 0 0 6px; line-height: 1.02; }
.login-card h1 em { color: var(--tangerine); font-style: normal; }
.login-sub { color: var(--ink-soft); margin-bottom: 28px; }
.ms-btn {
  width: 100%; justify-content: center; font-size: 15px; padding: 13px 20px;
}
.login-note { margin-top: 16px; font-size: 12px; color: var(--ink-soft); }
.login-err { margin-top: 14px; color: #b02a2a; font-weight: 600; font-size: 13px; }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; }
.side {
  width: 232px; flex-shrink: 0; border-right: 3px solid var(--ink);
  background: var(--paper-2); padding: 22px 16px; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { font-family: var(--display); font-weight: 900; font-size: 21px; line-height: 1.05; margin-bottom: 4px; }
.brand .tag {
  display: inline-block; background: var(--tangerine); color: #fff; font-family: var(--body);
  font-size: 10px; letter-spacing: 2px; padding: 2px 8px; border-radius: 4px;
  transform: rotate(-2deg); margin-top: 6px; font-weight: 700;
}
.nav { margin-top: 26px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.nav button {
  display: flex; align-items: center; gap: 10px; text-align: left;
  background: transparent; border: 2px solid transparent; border-radius: 10px;
  padding: 9px 12px; font-size: 14px; font-weight: 500; color: var(--ink);
}
.nav button:hover { background: #fff; }
.nav button.active {
  background: var(--ink); color: var(--paper); font-weight: 700;
  box-shadow: 3px 3px 0 var(--tangerine);
}
.nav .soon { opacity: .4; cursor: default; }
.nav .soon:hover { background: transparent; }
.nav .soon .pill { font-size: 9px; background: var(--line); border-radius: 4px; padding: 1px 5px; margin-left: auto; }
.side-user { border-top: 2px dashed var(--ink-soft); padding-top: 14px; font-size: 12.5px; }
.side-user .who { font-weight: 700; }
.side-user .role-chip {
  display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 1px;
  background: var(--cobalt); color: #fff; border-radius: 4px; padding: 1px 7px; margin-left: 5px;
}
.side-user a { cursor: pointer; text-decoration: underline; }

.main { flex: 1; padding: 34px 42px 80px; max-width: 1160px; }

/* ---------- page headers ---------- */
.page-head { margin-bottom: 26px; }
.page-head h2 { font-size: 40px; font-weight: 900; margin: 0; line-height: 1; }
.page-head h2 .accent { color: var(--tangerine); }
.page-head .sub { color: var(--ink-soft); margin-top: 8px; max-width: 640px; }

/* ---------- home tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.tile {
  position: relative; background: var(--card); border: 3px solid var(--ink);
  border-radius: var(--radius); padding: 24px 22px 20px; min-height: 168px;
  box-shadow: 6px 6px 0 var(--ink); cursor: pointer;
  transition: transform .1s ease, box-shadow .1s ease;
  display: flex; flex-direction: column;
}
.tile:hover { transform: translate(-2px,-2px); box-shadow: 8px 8px 0 var(--ink); }
.tile .t-icon { font-size: 34px; }
.tile h3 { margin: 10px 0 4px; font-size: 22px; font-weight: 900; }
.tile p { margin: 0; color: var(--ink-soft); font-size: 13px; flex: 1; }
.tile .sticker {
  position: absolute; top: -12px; right: 14px; background: var(--lemon);
  border: 2px solid var(--ink); border-radius: 999px; font-size: 11px; font-weight: 700;
  padding: 3px 11px; transform: rotate(4deg); letter-spacing: 1px;
}
.tile.soon { opacity: .55; cursor: default; background: repeating-linear-gradient(45deg, var(--card), var(--card) 12px, #f4eee1 12px, #f4eee1 24px); }
.tile.soon:hover { transform: none; box-shadow: 6px 6px 0 var(--ink); }
.tile.oh { background: linear-gradient(135deg, #fff8ec, #ffeede); }

/* ---------- cards / layout helpers ---------- */
.card {
  background: var(--card); border: 2.5px solid var(--ink); border-radius: var(--radius);
  padding: 20px; box-shadow: 5px 5px 0 rgba(29,26,22,.85); margin-bottom: 18px;
}
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.muted { color: var(--ink-soft); font-size: 13px; }
.spacer { flex: 1; }
.mt { margin-top: 14px; }

/* ---------- chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700;
  border: 2px solid var(--ink); border-radius: 999px; padding: 3px 11px; background: #fff;
}
.chip.todo { background: #fff; }
.chip.doing { background: var(--lemon); }
.chip.done { background: var(--mint); color: #fff; }
.chip.sent { background: var(--cobalt); color: #fff; }
.chip.reply { background: var(--pink); color: #fff; }
.chip.clickable { cursor: pointer; }
.chip.ghost { border-style: dashed; background: transparent; font-weight: 500; }

/* ---------- open house timeline ---------- */
.oh-card { display: flex; gap: 18px; align-items: flex-start; }
.oh-date {
  flex-shrink: 0; width: 74px; text-align: center; border: 2.5px solid var(--ink);
  border-radius: 12px; background: var(--lemon); padding: 8px 4px; font-weight: 700;
  transform: rotate(-2deg); box-shadow: 3px 3px 0 var(--ink);
}
.oh-date .d { font-family: var(--display); font-size: 25px; font-weight: 900; line-height: 1; }
.oh-date .m { font-size: 11px; letter-spacing: 2px; }
.oh-body { flex: 1; }
.oh-body h3 { margin: 0 0 4px; font-size: 21px; font-weight: 900; cursor: pointer; }
.oh-body h3:hover { color: var(--tangerine); }
.progress {
  height: 12px; background: #fff; border: 2px solid var(--ink); border-radius: 999px;
  overflow: hidden; margin-top: 10px;
}
.progress > div { height: 100%; background: var(--tangerine); }
.status-tag { font-size: 11px; font-weight: 700; letter-spacing: 1.5px; padding: 2px 9px; border: 2px solid var(--ink); border-radius: 5px; }
.status-tag.planning { background: var(--lemon); }
.status-tag.live { background: var(--tangerine); color: #fff; }
.status-tag.done { background: var(--mint); color: #fff; }

/* ---------- effort board ---------- */
.cat-section { margin-bottom: 8px; }
.cat-head {
  display: flex; align-items: center; gap: 10px; padding: 10px 4px 6px;
  border-bottom: 2px dashed var(--line); margin-bottom: 8px;
}
.cat-head .c-icon { font-size: 20px; }
.cat-head h4 { margin: 0; font-size: 16px; font-weight: 700; font-family: var(--body); }
.cat-head .count { font-size: 12px; color: var(--ink-soft); }
.effort {
  display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border-radius: 10px;
  border: 2px solid transparent; margin-bottom: 4px; background: transparent;
}
.effort:hover { background: #fff; border-color: var(--line); }
.effort .e-check {
  width: 22px; height: 22px; border: 2.5px solid var(--ink); border-radius: 7px;
  background: #fff; cursor: pointer; flex-shrink: 0; margin-top: 1px;
  display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 900;
}
.effort.done .e-check { background: var(--mint); color: #fff; }
.effort.done .e-title { text-decoration: line-through; opacity: .6; }
.effort .e-title { font-weight: 600; cursor: pointer; }
.effort .e-meta { font-size: 12px; color: var(--ink-soft); }
.effort .e-note-tag { background: var(--pink); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 4px; }

/* ---------- wizard ---------- */
.modal-bg {
  position: fixed; inset: 0; background: rgba(29,26,22,.55); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  background: var(--paper); border: 3px solid var(--ink); border-radius: 18px;
  box-shadow: 10px 10px 0 var(--ink); width: 640px; max-width: 100%;
  max-height: 88vh; overflow-y: auto; padding: 28px 30px;
}
.modal h3 { font-size: 26px; font-weight: 900; margin: 0 0 4px; }
.wiz-steps { display: flex; gap: 6px; margin: 14px 0 20px; }
.wiz-steps .ws {
  flex: 1; height: 8px; border: 2px solid var(--ink); border-radius: 999px; background: #fff;
}
.wiz-steps .ws.on { background: var(--tangerine); }
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 12px; font-weight: 700; letter-spacing: 1px; margin-bottom: 4px; text-transform: uppercase; }
.field input, .field select, .field textarea { width: 100%; }
.cat-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cat-pick .cp {
  display: flex; gap: 8px; align-items: center; border: 2px solid var(--ink);
  border-radius: 10px; padding: 8px 10px; cursor: pointer; background: #fff; font-size: 13px;
}
.cat-pick .cp.on { background: var(--lemon); box-shadow: 3px 3px 0 var(--ink); font-weight: 700; }

/* ---------- chat ---------- */
.chat-wrap { display: flex; flex-direction: column; height: calc(100vh - 260px); min-height: 420px; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 8px 4px; }
.bubble { max-width: 78%; padding: 12px 16px; border: 2.5px solid var(--ink); border-radius: 16px; margin-bottom: 12px; white-space: pre-wrap; word-break: break-word; }
.bubble.user { margin-left: auto; background: var(--cobalt); color: #fff; border-bottom-right-radius: 4px; }
.bubble.ai { background: var(--card); border-bottom-left-radius: 4px; box-shadow: 4px 4px 0 rgba(29,26,22,.15); }
.bubble.ai .thinking { display: inline-block; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.chat-input { display: flex; gap: 10px; padding-top: 12px; }
.chat-input input { flex: 1; padding: 12px 14px; border-radius: 999px; }
.place-card {
  border: 2px solid var(--ink); border-radius: 12px; background: #fff;
  padding: 10px 14px; margin-top: 8px; display: flex; gap: 12px; align-items: center;
}
.place-card .p-info { flex: 1; min-width: 0; }
.place-card.known { background: #f2fbf6; border-color: var(--mint); }
.scan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: 8px; }
@media (max-width: 900px) { .scan-grid { grid-template-columns: 1fr; } }
.place-card .p-name { font-weight: 700; }
.place-card .p-meta { font-size: 12px; color: var(--ink-soft); }

/* ---------- tables ---------- */
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; border-bottom: 3px solid var(--ink); padding: 8px 10px; font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; }
.tbl td { border-bottom: 1px solid var(--line); padding: 9px 10px; vertical-align: top; }
.tbl tr:hover td { background: #fff; }

/* ---------- grades ---------- */
.grade { display: inline-flex; width: 38px; height: 38px; border-radius: 50%; border: 2.5px solid var(--ink); align-items: center; justify-content: center; font-weight: 900; font-size: 15px; color: #fff; font-family: var(--display); }

/* ---------- leaderboard podium ---------- */
.podium { display: flex; gap: 16px; align-items: flex-end; margin: 10px 0 26px; }
.podium .pod {
  flex: 1; text-align: center; border: 3px solid var(--ink); border-radius: 14px 14px 0 0;
  background: var(--card); padding: 16px 10px 12px; box-shadow: 5px 5px 0 var(--ink);
}
.podium .pod .medal { font-size: 30px; }
.podium .pod .name { font-weight: 900; font-family: var(--display); font-size: 17px; }
.podium .pod .score { color: var(--ink-soft); font-size: 13px; }

/* ---------- toast ---------- */
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--paper); border-radius: 999px; padding: 11px 24px;
  font-weight: 700; z-index: 999; box-shadow: 4px 4px 0 var(--tangerine);
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
#toast.show { opacity: 1; }

/* ---------- plan cards ---------- */
.plan-move { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.plan-move .pm-icon { font-size: 20px; }
.plan-move .pm-title { font-weight: 700; }
.plan-move .pm-desc { font-size: 13px; color: var(--ink-soft); }

.searchbar { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.searchbar input[type=text] { flex: 1; min-width: 220px; border-radius: 999px; padding: 10px 16px; }

@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .side { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; gap: 10px; overflow-x: auto; }
  .nav { flex-direction: row; margin-top: 0; }
  .main { padding: 20px 16px 60px; }
  .grid2 { grid-template-columns: 1fr; }
}
