:root {
  --ink: #0c0b12;
  --moss: #16141f;
  --leaf: #221f2e;
  --line: #322e44;
  --mint: #8b7cff;
  --lime: #f0c75e;
  --paper: #f3efe6;
  --mute: #9a93ad;
  --danger: #e25c5c;
  --warn: #f0c75e;
  --font: "Figtree", system-ui, sans-serif;
  --display: "Syne", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  background: var(--ink);
  color: var(--paper);
  line-height: 1.45;
}
a { color: var(--mint); text-decoration: none; }
h1, h2, .word, .hero-title { font-family: var(--display); letter-spacing: -0.03em; }

.public-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
}
.public-story {
  padding: 56px 64px;
  background:
    radial-gradient(900px 400px at -10% -20%, rgba(139, 124, 255, 0.2), transparent 55%),
    linear-gradient(160deg, #161322, #0c0b12 60%);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.brand-row { display: flex; align-items: center; gap: 12px; }
.mark {
  width: 36px; height: 36px; border-radius: 11px;
  background: var(--lime); color: #1a1404;
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 800; font-size: 13px;
}
.word { font-size: 22px; }
.hero-title { font-size: clamp(2.2rem, 4vw, 3.6rem); line-height: 0.95; margin: 48px 0 16px; max-width: 16ch; }
.lede { color: var(--mute); font-size: 1.05rem; max-width: 38ch; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 28px; }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; color: var(--mute); font-size: 13px; }

.public-form {
  display: grid;
  place-items: center;
  padding: 40px 24px;
}
.card {
  width: min(420px, 100%);
  background: var(--moss);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px;
}
.card h2 { margin: 0 0 6px; font-size: 1.6rem; }
.hint { color: var(--mute); margin: 0 0 22px; }
label { display: block; font-size: 13px; color: var(--mute); margin: 12px 0 6px; }
input, textarea, select {
  width: 100%;
  background: var(--ink);
  border: 1px solid var(--line);
  color: var(--paper);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
}
textarea { min-height: 88px; resize: vertical; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 999px; padding: 12px 18px; font: 600 15px var(--font);
  cursor: pointer; background: var(--lime); color: #1a1404;
}
.btn.wide { width: 100%; margin-top: 18px; }
.btn.ghost { background: transparent; color: var(--paper); border: 1px solid var(--line); }
.btn.danger { background: var(--danger); color: #fff; }
.muted { color: var(--mute); font-size: 14px; }
.center { text-align: center; margin-top: 16px; }

.app-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sider {
  background: var(--moss);
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  display: flex; flex-direction: column; gap: 28px;
}
.sider .brand { display: flex; align-items: center; gap: 10px; color: var(--paper); }
.sider nav { display: grid; gap: 4px; }
.sider nav a {
  color: var(--mute); padding: 10px 12px; border-radius: 10px;
}
.sider nav a.on, .sider nav a:hover { background: var(--leaf); color: var(--paper); }
.sider-foot { margin-top: auto; }
.who strong { display: block; }
.who span { color: var(--mute); font-size: 12px; }
.out { display: inline-block; margin-top: 10px; color: var(--mute); font-size: 13px; }

.impersonate {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--lime); color: #1a1404; padding: 10px 28px; font-size: 13px; font-weight: 600;
}
.impersonate form { margin: 0; }
.impersonate .btn { padding: 6px 12px; font-size: 13px; }

.stage { min-width: 0; }
.stage-top {
  padding: 22px 28px 0;
  border-bottom: 1px solid transparent;
}
.stage-top h1 { margin: 0; font-size: 1.7rem; }
.stage-body { padding: 22px 28px 48px; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi {
  background: var(--moss); border: 1px solid var(--line); border-radius: 18px; padding: 18px;
}
.kpi span { color: var(--mute); font-size: 13px; }
.kpi strong { display: block; font-size: 1.8rem; margin-top: 8px; font-family: var(--display); }

.panel {
  background: var(--moss); border: 1px solid var(--line); border-radius: 18px; padding: 18px; margin-top: 16px;
}
.row { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: 14px; }
.table th { color: var(--mute); font-weight: 500; }

.empty {
  padding: 48px 20px; text-align: center; color: var(--mute);
}
.empty h3 { color: var(--paper); margin-bottom: 8px; }

.flash { border-radius: 12px; padding: 10px 14px; margin-bottom: 16px; }
.flash-ok { background: rgba(139,124,255,.14); color: #c9c2ff; }
.flash-err { background: rgba(226,92,92,.12); color: #ffb3b3; }

.inbox { display: grid; grid-template-columns: 280px 1fr; min-height: 64vh; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.thread-list { background: var(--moss); border-right: 1px solid var(--line); }
.thread-list a { display: block; padding: 14px 16px; color: var(--paper); border-bottom: 1px solid var(--line); }
.thread-list a.on { background: var(--leaf); }
.thread-list small, .msg time { color: var(--mute); }
.chat { display: flex; flex-direction: column; background: #100e18; }
.chat-log { flex: 1; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 70%; padding: 10px 12px; border-radius: 14px; }
.msg.agent { margin-left: auto; background: var(--mint); color: #f3efe6; }
.msg.customer { background: var(--leaf); }
.composer { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }

.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.col { background: var(--moss); border: 1px solid var(--line); border-radius: 16px; min-height: 420px; padding: 12px; display: flex; flex-direction: column; }
.col-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.col h3 { margin: 0; font-size: 14px; }
.col-count { font-size: 11px; color: var(--mute); background: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; }
.col-empty { flex: 1; display: grid; place-items: center; text-align: center; color: var(--mute); font-size: 13px; line-height: 1.45; border: 1px dashed var(--line); border-radius: 12px; padding: 28px 14px; }
.deal { background: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.deal b { display: block; }
.deal em { color: var(--lime); font-style: normal; font-size: 13px; }
.deal-who { display: block; color: var(--mute); font-size: 12px; margin-top: 6px; }
.pipe-lede { color: var(--mute); font-size: 14px; max-width: 62ch; margin: 0 0 4px; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.box-note {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 12px 0 18px;
  color: var(--mute);
  font-size: 13px;
}
code {
  background: var(--ink);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 12px;
  word-break: break-all;
}

@media (max-width: 900px) {
  .public-wrap, .app-shell, .inbox, .kpis, .split { grid-template-columns: 1fr; }
  .kanban { grid-auto-columns: minmax(200px, 78vw); }
  .public-story { display: none; }
  .sider { flex-direction: row; flex-wrap: wrap; }
  .sider nav { display: flex; overflow: auto; width: 100%; }
  .sider-foot { width: 100%; }
}
