:root {
  color-scheme: dark;
  --bg: #05070b;
  --bg-2: #0b1018;
  --panel: rgba(16, 21, 32, 0.88);
  --panel-2: rgba(22, 29, 44, 0.94);
  --border: rgba(117, 138, 171, 0.2);
  --border-strong: rgba(132, 167, 255, 0.34);
  --text: #eef3ff;
  --muted: #8e9bb3;
  --accent: #7cb4ff;
  --accent-2: #64f0d3;
  --good: #57df93;
  --warn: #ffb454;
  --bad: #ff758f;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  font-family: "IBM Plex Sans", "Avenir Next", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(124, 180, 255, 0.14), transparent 30%),
    radial-gradient(circle at top right, rgba(100, 240, 211, 0.1), transparent 24%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

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

.sidebar {
  padding: 32px 24px;
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(4, 7, 11, 0.92), rgba(10, 14, 21, 0.88));
  backdrop-filter: blur(16px);
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #071017;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.brand h1,
.topbar h2,
.panel-title,
.table-card h3 {
  margin: 0;
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  letter-spacing: -0.03em;
}

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

.nav {
  display: grid;
  gap: 8px;
  margin-bottom: 28px;
}

.nav a {
  padding: 12px 14px;
  border-radius: 14px;
  color: var(--muted);
  border: 1px solid transparent;
  transition: 160ms ease;
}

.nav a.active,
.nav a:hover {
  color: var(--text);
  background: rgba(124, 180, 255, 0.08);
  border-color: var(--border-strong);
}

.sidebar-note {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(18, 24, 35, 0.66);
  line-height: 1.5;
}

.muted {
  color: var(--muted);
}

.main {
  padding: 28px;
}

.topbar,
.action-strip,
.section-grid,
.stack,
.table-grid {
  display: grid;
  gap: 16px;
}

.topbar {
  grid-template-columns: 1fr auto;
  align-items: center;
  margin-bottom: 18px;
}

.topbar-actions {
  display: flex;
  gap: 12px;
}

.action-strip {
  grid-template-columns: repeat(3, max-content) 1fr;
  align-items: center;
  margin-bottom: 24px;
}

button {
  cursor: pointer;
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  transition: 160ms ease;
}

button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), #9fbcff);
  color: #09111b;
  font-weight: 700;
}

.secondary-button,
.ghost-button {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: 1px solid var(--border);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

.status-chip {
  justify-self: end;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.page.hidden {
  display: none;
}

.hero-card,
.metric-card,
.panel,
.table-card {
  border: 1px solid var(--border);
  border-radius: 24px;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 24px;
  margin-bottom: 18px;
}

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

.hero-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.hero-meta .meta-box {
  border-radius: 18px;
  padding: 16px;
  background: rgba(7, 10, 16, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.metric-card {
  padding: 18px;
}

.metric-label,
.metric-note,
.panel-subtitle,
.table-meta,
th {
  color: var(--muted);
}

.metric-label,
.metric-note,
.table-meta {
  margin: 0;
  font-size: 13px;
}

.metric-value {
  margin: 12px 0 8px;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.section-grid {
  grid-template-columns: 1.2fr 0.8fr;
  margin-bottom: 18px;
}

.stack {
  align-content: start;
}

.panel,
.table-card {
  padding: 20px;
}

.panel-header,
.table-card-header,
.leads-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
}

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

.panel-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.panel-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.badge,
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
}

.badge.good,
.pill.good {
  color: var(--good);
}

.badge.warn,
.pill.warn {
  color: var(--warn);
}

.badge.bad,
.pill.bad {
  color: var(--bad);
}

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

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

th,
td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 14px;
  vertical-align: top;
}

td {
  color: #dce5f8;
}

.cell-stack {
  display: grid;
  gap: 4px;
}

.empty-state {
  padding: 24px;
  text-align: center;
  color: var(--muted);
}

.leads-toolbar {
  margin-bottom: 18px;
}

.search-input {
  width: min(360px, 100%);
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.table-card.full-width table {
  min-width: 920px;
}

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

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .action-strip,
  .topbar,
  .section-grid,
  .table-grid,
  .hero-meta {
    grid-template-columns: 1fr;
  }

  .status-chip {
    justify-self: start;
  }
}
