:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --line: #e5e9f0;
  --text: #172033;
  --muted: #687386;
  --green: #22a06b;
  --green-soft: #e8f7f0;
  --blue: #2662d9;
  --violet: #6d5bd0;
  --amber: #b7791f;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
}

.shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 28px 22px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  color: white;
  font-weight: 800;
  background: linear-gradient(135deg, var(--green), var(--blue));
}

.brand strong,
.brand span {
  display: block;
}

.brand span,
.subtitle,
.metric p,
.chat-item p,
dt {
  color: var(--muted);
}

.nav {
  display: grid;
  gap: 8px;
}

.nav a {
  padding: 12px 14px;
  border-radius: 8px;
  color: #4c586b;
  text-decoration: none;
  font-weight: 650;
}

.nav a.active,
.nav a:hover {
  color: #0f5138;
  background: var(--green-soft);
}

.content {
  min-width: 0;
  padding: 34px;
}

.topbar {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
}

h2 {
  margin-bottom: 0;
  font-size: 1rem;
}

.subtitle {
  max-width: 760px;
  margin-bottom: 0;
  font-size: 1.05rem;
}

.status-pill {
  flex: 0 0 auto;
  padding: 10px 14px;
  border: 1px solid #bfe8d7;
  border-radius: 999px;
  color: #0f6b49;
  background: var(--green-soft);
  font-weight: 800;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 16px 45px rgba(22, 32, 51, 0.06);
}

.metric {
  padding: 18px;
}

.metric span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.55rem;
}

.metric p {
  margin-bottom: 0;
}

.workspace {
  display: grid;
  grid-template-columns: 320px minmax(340px, 1fr) 280px;
  gap: 14px;
  align-items: stretch;
}

.panel {
  min-width: 0;
  padding: 16px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

button {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  color: white;
  background: var(--green);
  font-weight: 800;
}

.chat-list {
  display: grid;
  gap: 10px;
}

.chat-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 8px;
}

.chat-item.selected {
  border-color: #bfe8d7;
  background: #f3fbf7;
}

.chat-item p {
  overflow: hidden;
  margin: 2px 0 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-item small {
  color: var(--violet);
  font-weight: 800;
}

.avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--green);
  font-weight: 800;
}

.transcript {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 420px;
  background: #f1eee8;
}

.message {
  max-width: 72%;
  padding: 12px 14px;
  border-radius: 8px;
  line-height: 1.45;
}

.message.inbound {
  align-self: flex-start;
  background: #ffffff;
}

.message.outbound {
  align-self: flex-end;
  background: #dff7d4;
}

.lead-card dl {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}

.lead-card div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

dt,
dd {
  margin: 0;
}

dd {
  font-weight: 800;
  text-align: right;
}

.progress {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: #e8edf4;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--amber);
}

@media (max-width: 1120px) {
  .shell {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .workspace {
    grid-template-columns: minmax(280px, 0.8fr) minmax(360px, 1.2fr);
  }

  .lead-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 2;
    gap: 16px;
    padding: 16px;
  }

  .nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .nav a {
    text-align: center;
  }

  .content {
    padding: 20px;
  }

  .topbar,
  .grid,
  .workspace {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }
}

