:root {
  --bg: #f3f6fb;
  --bg-soft: #ffffff;
  --bg-strong: #020617;
  --border-subtle: #d0d7e6;
  --border-strong: #0f172a;
  --text-main: #0b1120;
  --text-soft: #6b7280;
  --brand-navy: #0b1b3a;
  --brand-teal: #0fb5a9;
  --brand-teal-soft: rgba(15, 181, 169, 0.12);
  --brand-accent: #2563eb;
  --danger: #ef4444;
  --radius-card: 18px;
  --shadow-card: 0 26px 60px rgba(15, 23, 42, 0.18);
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

body[data-theme="dark"] {
  --bg: #020617;
  --bg-soft: #020617;
  --bg-strong: #00010a;
  --border-subtle: #1f2937;
  --border-strong: #4b5563;
  --text-main: #e5e7eb;
  --text-soft: #9ca3af;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  background: radial-gradient(circle at 0 0, #e0f2fe 0, #f3f4f6 34%, #e5f5f3 70%, #f3f4f6 100%);
  color: var(--text-main);
}

body[data-theme="dark"] {
  background: radial-gradient(circle at 0 0, #020617 0, #020617 60%, #020617 100%);
}

.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 1220px;
  margin: 0 auto;
  padding: 20px 28px;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(22px);
  background: linear-gradient(90deg, rgba(248, 250, 252, 0.98), rgba(241, 245, 249, 0.98));
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

body[data-theme="dark"] .nav {
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.96));
  border-bottom-color: rgba(148, 163, 184, 0.25);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

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

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 14px;
  background: radial-gradient(circle at 0 0, #0fb5a9, #2563eb);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: #f9fafb;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 13px;
}

.brand-tag {
  font-size: 12px;
  color: var(--text-soft);
}

.nav-links {
  display: flex;
  gap: 18px;
  font-size: 14px;
}

.nav-links a {
  position: relative;
  padding: 4px 0;
  color: var(--text-soft);
  text-decoration: none;
  font-weight: 500;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-teal), var(--brand-accent));
  transition: width 0.18s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

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

.acquisition-badge {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(15, 181, 169, 0.4);
  background: linear-gradient(135deg, #0f766e, #0b1b3a);
  color: #f9fafb;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
}

.acquisition-badge:hover {
  opacity: 0.9;
  box-shadow: 0 0 0 1px rgba(15, 181, 169, 0.5);
  transform: translateY(-1px);
}

body[data-theme="dark"] .acquisition-badge {
  border-color: rgba(56, 189, 248, 0.6);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #0b1120;
  color: #f9fafb;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 15px 40px rgba(15, 23, 42, 0.28);
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-teal), var(--brand-accent));
  border-color: rgba(15, 181, 169, 0.9);
  color: #f9fafb;
}

.btn-outline {
  background: transparent;
  color: var(--brand-navy);
}

body[data-theme="dark"] .btn-outline {
  color: #e5e7eb;
  border-color: rgba(148, 163, 184, 0.5);
}

.btn-ghost {
  background: rgba(248, 250, 252, 0.9);
}

body[data-theme="dark"] .btn-ghost {
  background: rgba(15, 23, 42, 0.96);
  border-color: rgba(75, 85, 99, 0.7);
  color: #e5e7eb;
}

.hero {
  padding: 64px 28px 32px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 32px;
  align-items: center;
}

.kicker {
  display: inline-flex;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(15, 181, 169, 0.05);
  font-size: 12px;
  color: var(--brand-navy);
}

body[data-theme="dark"] .kicker {
  border-color: rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
}

h1 {
  margin: 18px 0 12px;
  font-size: 38px;
  line-height: 1.1;
  color: #020617;
}

body[data-theme="dark"] h1 {
  color: #f9fafb;
}

p {
  margin: 0 0 18px;
  font-size: 14px;
  color: var(--text-soft);
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin: 8px 0 18px;
}

.hero-metrics {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.kpi-card {
  min-width: 170px;
}

.kpi-label {
  font-size: 12px;
  color: var(--text-soft);
}

.kpi-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--brand-navy);
}

body[data-theme="dark"] .kpi-value {
  color: #e5e7eb;
}

.card {
  border-radius: var(--radius-card);
  padding: 20px 18px;
  background: radial-gradient(140% 160% at 0 0, #eff6ff 0, #ffffff 46%, #f3f4f6 100%);
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: var(--shadow-card);
}

body[data-theme="dark"] .card {
  background: radial-gradient(140% 160% at 0 0, #020617 0, #020617 60%, #020617 100%);
  border-color: rgba(55, 65, 81, 0.9);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  font-size: 11px;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.8);
}

body[data-theme="dark"] .pill {
  background: rgba(15, 23, 42, 0.9);
}

.pill-strong {
  border-color: rgba(15, 181, 169, 0.6);
  background: var(--brand-teal-soft);
  color: #064e3b;
}

body[data-theme="dark"] .pill-strong {
  color: #a7f3d0;
}

.section {
  margin-top: 26px;
}

.section-heading {
  margin-bottom: 6px;
  font-size: 18px;
}

.grid {
  display: grid;
  gap: 20px;
}

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

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

.footer {
  margin-top: auto;
  padding: 20px 0 26px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: 12px;
  color: var(--text-soft);
}

.footer-links {
  display: flex;
  gap: 12px;
}

.footer-links a {
  color: inherit;
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

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

.sidebar {
  padding: 22px 18px;
  border-right: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, #0b1b3a, #020617);
  color: #e5e7eb;
}

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

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

.sidebar-item {
  padding: 8px 9px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.sidebar-item.active {
  background: linear-gradient(90deg, rgba(15, 181, 169, 0.26), rgba(37, 99, 235, 0.26));
  color: #f9fafb;
}

.sidebar-foot {
  margin-top: 16px;
  font-size: 11px;
  color: #9ca3af;
}

.app-main {
  padding: 22px 24px 26px;
}

.app-main-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.app-views {
  position: relative;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.chart-row {
  display: flex;
  gap: 18px;
}

.chart-bar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  min-height: 140px;
}

.chart-segment {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.chart-bar-fill {
  width: 100%;
  border-radius: 10px 10px 4px 4px;
  background: linear-gradient(180deg, rgba(15, 181, 169, 0.98), rgba(37, 99, 235, 0.98));
}

.chart-label {
  font-size: 11px;
  color: var(--text-soft);
  text-align: center;
}

.chart-value {
  font-size: 11px;
}

.acq-modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.52);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 60;
}

.acq-modal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.acq-modal {
  width: 100%;
  max-width: 420px;
  border-radius: 18px;
  padding: 20px 22px 18px;
  background: var(--bg-soft);
  box-shadow: 0 26px 60px rgba(15, 23, 42, 0.35);
  transform: translateY(14px);
  transition: transform 0.2s ease;
}

body[data-theme="dark"] .acq-modal {
  background: #020617;
}

.acq-modal-overlay.is-open .acq-modal {
  transform: translateY(0);
}

.acq-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.acq-modal-title {
  font-size: 18px;
  font-weight: 600;
}

.acq-modal-close {
  border: none;
  background: transparent;
  color: var(--text-soft);
  font-size: 20px;
  cursor: pointer;
}

.acq-modal-body {
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.5;
}

.pipeline-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.pipeline-column {
  border-radius: 14px;
  padding: 10px;
  background: rgba(248, 250, 252, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.7);
}

body[data-theme="dark"] .pipeline-column {
  background: rgba(15, 23, 42, 0.92);
}

.pipeline-title {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
}

.pipeline-card {
  margin-bottom: 8px;
  padding: 8px 9px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.7);
  font-size: 12px;
  cursor: grab;
}

.pipeline-card.dragging {
  opacity: 0.6;
}

body[data-theme="dark"] .pipeline-card {
  background: #020617;
}

.pipeline-card small {
  display: block;
  color: var(--text-soft);
}

.assistant-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
}

.assistant-output {
  min-height: 180px;
  border-radius: 14px;
  padding: 14px;
  background: #020617;
  color: #e5e7eb;
  border: 1px solid rgba(148, 163, 184, 0.7);
  font-size: 13px;
  white-space: pre-line;
}

body[data-theme="dark"] .assistant-output {
  background: #020617;
}

label {
  display: block;
  font-size: 12px;
  margin-bottom: 4px;
}

input,
select,
textarea {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: #ffffff;
  font-size: 13px;
  color: var(--text-main);
}

body[data-theme="dark"] input,
body[data-theme="dark"] select,
body[data-theme="dark"] textarea {
  background: #020617;
  color: #e5e7eb;
}

textarea {
  resize: vertical;
}

.metric-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.metric-pill {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.06);
  border: 1px solid rgba(34, 197, 94, 0.3);
  font-size: 11px;
}

@media (max-width: 1040px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
  }
  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    max-width: 60%;
  }
}

@media (max-width: 768px) {
  .container {
    padding-inline: 18px;
  }
  .nav-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .nav-links {
    flex-wrap: wrap;
  }
  .nav-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }
  .assistant-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .pipeline-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
