:root {
  --bg: #07111f;
  --bg-soft: #0d1828;
  --panel: rgba(13, 24, 40, 0.88);
  --panel-strong: #101d31;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f5f7fb;
  --muted: #93a2bd;
  --green: #38e39f;
  --amber: #ffbe4d;
  --blue: #5ca4ff;
  --red: #ff6a7a;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 30px 60px rgba(0, 0, 0, 0.35);
  font-family: "Manrope", sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(92, 164, 255, 0.16), transparent 30%),
    radial-gradient(circle at top right, rgba(56, 227, 159, 0.14), transparent 28%),
    linear-gradient(180deg, #08111d 0%, #091523 100%);
  color: var(--text);
}

body {
  min-height: 100vh;
}

button, input, select, textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  padding: 24px;
  border-right: 1px solid var(--line);
  background: rgba(8, 15, 26, 0.72);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 0;
  height: 100vh;
}

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

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-family: "Space Grotesk", sans-serif;
  background: linear-gradient(135deg, var(--green), var(--blue));
  color: #06111d;
}

.brand h1,
.topbar h2,
.hero-copy h3,
.panel-head h3,
.section-head h3,
.detail-block h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.nav-item {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  text-align: left;
}

.nav-item small {
  color: var(--muted);
}

.nav-item.active {
  background: rgba(56, 227, 159, 0.08);
  border-color: rgba(56, 227, 159, 0.18);
}

.sidebar-card,
.glass-panel,
.hero-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.sidebar-card {
  padding: 18px;
}

.sidebar-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.sidebar-card.compact {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.main {
  padding: 24px;
}

.topbar,
.section-head,
.panel-head,
.hero-grid,
.overview-grid,
.leads-layout,
.assistant-layout,
.automation-grid,
.hero-actions,
.topbar-actions,
.filters,
.field-grid,
.modal-actions {
  display: flex;
  gap: 16px;
}

.topbar,
.section-head,
.panel-head {
  justify-content: space-between;
  align-items: center;
}

.topbar {
  margin-bottom: 24px;
}

.search input,
select,
input,
textarea {
  width: 100%;
  background: rgba(5, 11, 20, 0.75);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  outline: none;
}

textarea {
  resize: vertical;
}

.search {
  width: min(320px, 100%);
}

.primary-btn,
.ghost-btn,
.icon-btn {
  border-radius: 14px;
  border: 1px solid transparent;
  padding: 13px 18px;
  color: var(--text);
  background: transparent;
}

.primary-btn {
  background: linear-gradient(135deg, var(--green), #76f2bf);
  color: #07111f;
  font-weight: 800;
}

.ghost-btn,
.icon-btn {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.icon-btn {
  padding: 10px 12px;
  line-height: 1;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.hero-grid {
  align-items: stretch;
  margin-bottom: 18px;
}

.hero-grid > *:first-child {
  flex: 1.3;
}

.hero-grid > *:last-child {
  flex: 0.9;
}

.hero-panel {
  padding: 28px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 18px;
  background:
    linear-gradient(135deg, rgba(56, 227, 159, 0.12), rgba(92, 164, 255, 0.08)),
    var(--panel);
}

.hero-copy h3 {
  font-size: clamp(2rem, 3vw, 3.4rem);
  line-height: 1.05;
  margin-bottom: 16px;
}

.hero-copy p:last-of-type {
  margin: 0 0 24px;
  color: var(--muted);
  max-width: 55ch;
}

.hero-metrics {
  display: grid;
  gap: 14px;
}

.stat-card,
.priority-item,
.lead-card,
.snippet-card,
.automation-card,
.funnel-row,
.feed-item,
.board-column {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.stat-card {
  padding: 18px;
}

.stat-card strong {
  font-size: 1.9rem;
  display: block;
  margin: 8px 0 4px;
}

.stat-card p,
.priority-item p,
.feed-item p,
.lead-meta,
.muted {
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge.live {
  background: rgba(56, 227, 159, 0.12);
  color: var(--green);
}

.badge.subtle {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.stack-list,
.feed-list,
.lead-list,
.snippet-list {
  display: grid;
  gap: 12px;
}

.glass-panel {
  padding: 20px;
}

.overview-grid {
  align-items: start;
}

.overview-grid > * {
  flex: 1;
}

.bars {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  align-items: end;
  min-height: 230px;
}

.bar {
  display: flex;
  flex-direction: column;
  justify-content: end;
  gap: 8px;
  min-height: 220px;
}

.bar-fill {
  border-radius: 12px 12px 4px 4px;
  background: linear-gradient(180deg, var(--blue), #2f5b9f);
  min-height: 10px;
}

.bar-label {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.funnel-list {
  display: grid;
  gap: 12px;
}

.funnel-row {
  padding: 14px;
}

.funnel-track {
  height: 10px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 10px;
}

.funnel-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--blue));
}

.priority-item,
.feed-item,
.lead-card,
.snippet-card,
.automation-card {
  padding: 16px;
}

.priority-item strong,
.lead-card strong,
.snippet-card strong,
.automation-card strong {
  display: block;
  margin-bottom: 6px;
}

.leads-layout {
  align-items: start;
}

.leads-layout > *:first-child {
  flex: 1.1;
}

.leads-layout > *:last-child {
  flex: 0.9;
}

.lead-card {
  text-align: left;
}

.lead-card.active {
  border-color: rgba(92, 164, 255, 0.4);
  background: rgba(92, 164, 255, 0.08);
}

.lead-top,
.detail-row,
.snippet-card,
.automation-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.lead-meta {
  margin-top: 10px;
  font-size: 14px;
}

.detail-panel {
  min-height: 540px;
}

.detail-grid {
  display: grid;
  gap: 14px;
}

.detail-block {
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}

.detail-block p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.board-column {
  padding: 16px;
}

.board-column h4 {
  margin: 0 0 14px;
  font-family: "Space Grotesk", sans-serif;
}

.board-stack {
  display: grid;
  gap: 12px;
}

.assistant-layout > * {
  flex: 1;
}

.assistant-bottom {
  margin-top: 18px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  margin-bottom: 16px;
}

label span {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.snippet-card p {
  margin: 0;
  color: var(--muted);
  max-width: 48ch;
}

.snippet-card {
  align-items: center;
}

.chat-box {
  min-height: 320px;
  max-height: 420px;
  overflow: auto;
  display: grid;
  gap: 12px;
  padding: 6px 0 18px;
}

.chat-controls {
  display: grid;
  gap: 12px;
}

.chat-bubble {
  max-width: 88%;
  padding: 14px 16px;
  border-radius: 16px;
  line-height: 1.6;
}

.chat-bubble.user {
  justify-self: end;
  background: linear-gradient(135deg, var(--green), #76f2bf);
  color: #08111d;
}

.chat-bubble.bot {
  justify-self: start;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
}

.automation-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.automation-card p {
  color: var(--muted);
  line-height: 1.6;
}

.modal {
  border: 0;
  padding: 0;
  background: transparent;
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(12px);
}

.modal-card {
  width: min(680px, calc(100vw - 24px));
  background: var(--panel-strong);
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  padding: 24px;
}

.modal-actions {
  justify-content: end;
  padding: 0;
  margin: 0;
}

@media (max-width: 1180px) {
  .shell,
  .hero-panel,
  .hero-grid,
  .overview-grid,
  .leads-layout,
  .assistant-layout {
    grid-template-columns: 1fr;
    display: grid;
  }

  .board,
  .automation-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

  .sidebar {
    position: static;
    height: auto;
  }

  .topbar,
  .section-head,
  .topbar-actions,
  .filters,
  .field-grid,
  .board,
  .automation-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .search {
    width: 100%;
  }
}
