:root {
  --bg: #081120;
  --bg-alt: #0e1730;
  --panel: rgba(10, 18, 35, 0.84);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text: #eff4ff;
  --muted: #a8b2c7;
  --muted-strong: #c7d0e1;
  --primary: #6ea8fe;
  --primary-strong: #4f87ff;
  --accent: #7df0d6;
  --warning: #ffcf5a;
  --success: #2fdf84;
  --danger: #ff7a8b;
  --shadow: 0 24px 60px rgba(2, 6, 23, 0.45);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  font-family: "Manrope", system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(111, 168, 254, 0.23), transparent 30%),
    radial-gradient(circle at top right, rgba(125, 240, 214, 0.15), transparent 26%),
    linear-gradient(160deg, #050913 0%, var(--bg) 44%, #060b17 100%);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 56px 56px;
  pointer-events: none;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent 95%);
}

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

button {
  cursor: pointer;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
  position: relative;
  z-index: 1;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.9fr);
  gap: 24px;
  align-items: stretch;
  margin-bottom: 24px;
}

.hero__copy,
.hero__stats,
.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero__copy {
  padding: 28px;
  border-radius: var(--radius-xl);
}

.hero__copy h1 {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2.25rem, 4vw, 4.5rem);
  line-height: 0.98;
  margin: 10px 0 16px;
  max-width: 12ch;
}

.hero__text {
  color: var(--muted);
  max-width: 62ch;
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.7;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
}

.hero__stats {
  border-radius: var(--radius-xl);
  padding: 22px;
  display: grid;
  gap: 14px;
}

.stat-card {
  border-radius: var(--radius-lg);
  padding: 18px 18px 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.stat-card__label {
  color: var(--muted);
  font-size: 0.88rem;
}

.stat-card__value {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  font-size: 2rem;
  line-height: 1.1;
  margin-top: 8px;
}

.workspace {
  display: grid;
  gap: 24px;
}

.layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.8fr);
  gap: 24px;
  align-items: start;
}

.panel {
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.panel--controls,
.panel--list,
.panel--form {
  padding: 22px;
}

.panel__header {
  margin-bottom: 18px;
}

.panel__header--split {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.panel__header h2,
.modal__header h2 {
  font-family: "Space Grotesk", sans-serif;
  margin: 0;
  font-size: 1.45rem;
}

.panel__header p,
.panel__count {
  color: var(--muted);
  margin: 6px 0 0;
}

.panel__count {
  white-space: nowrap;
  font-weight: 700;
}

.controls-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) repeat(2, minmax(0, 0.7fr));
  gap: 14px;
}

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

.field span {
  color: var(--muted-strong);
  font-size: 0.88rem;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(8, 15, 31, 0.92);
  color: var(--text);
  border-radius: var(--radius-md);
  padding: 13px 14px;
  outline: none;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.field textarea {
  resize: vertical;
  min-height: 112px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(110, 168, 254, 0.85);
  box-shadow: 0 0 0 4px rgba(110, 168, 254, 0.12);
}

.table-wrap {
  overflow: auto;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.lead-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

.lead-table th,
.lead-table td {
  padding: 16px 18px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.lead-table th {
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted-strong);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lead-row {
  transition: background 0.18s ease, transform 0.18s ease;
}

.lead-row:hover {
  background: rgba(255, 255, 255, 0.035);
}

.lead-row--selected {
  background: rgba(110, 168, 254, 0.08);
}

.lead-name {
  font-weight: 800;
}

.lead-email,
.lead-muted {
  color: var(--muted);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.84rem;
  letter-spacing: 0.01em;
}

.status-pill::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
}

.status-pill--new {
  color: #a9c7ff;
  background: rgba(110, 168, 254, 0.12);
}

.status-pill--contacted {
  color: #ffd66f;
  background: rgba(255, 207, 90, 0.12);
}

.status-pill--converted {
  color: #83efae;
  background: rgba(47, 223, 132, 0.12);
}

.status-select {
  width: 100%;
  min-width: 140px;
}

.row-button {
  background: none;
  color: inherit;
  border: 0;
  padding: 0;
  text-align: left;
  font-weight: 700;
}

.btn {
  border: 0;
  border-radius: var(--radius-md);
  padding: 13px 16px;
  font-weight: 800;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn:hover,
.icon-btn:hover {
  transform: translateY(-1px);
}

.btn--primary {
  color: #081120;
  background: linear-gradient(135deg, var(--accent), #b8ffea);
  box-shadow: 0 16px 34px rgba(125, 240, 214, 0.18);
}

.btn--primary:hover {
  box-shadow: 0 20px 40px rgba(125, 240, 214, 0.24);
}

.form-feedback {
  min-height: 1.4em;
  margin: 10px 0 0;
  color: var(--muted);
}

.form-feedback--error {
  color: #ff9aa9;
}

.form-feedback--success {
  color: #8ef2bd;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  padding: 20px;
  background: rgba(3, 7, 18, 0.7);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.modal-backdrop.is-open {
  display: flex;
}

.modal {
  width: min(760px, 100%);
  max-height: min(90vh, 900px);
  overflow: auto;
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(16, 24, 45, 0.98), rgba(8, 12, 25, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  padding: 22px;
}

.modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 1.6rem;
  line-height: 1;
}

.modal__content {
  display: grid;
  gap: 18px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.detail-card,
.activity-card {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  padding: 16px;
}

.detail-card__label,
.section-label {
  color: var(--muted);
  font-size: 0.86rem;
  margin: 0 0 6px;
}

.detail-card__value,
.detail-card__value a {
  color: var(--text);
  font-weight: 800;
  word-break: break-word;
}

.section-label {
  display: inline-block;
  margin-bottom: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.activity-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.activity-item {
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.activity-item__time {
  color: var(--muted);
  font-size: 0.8rem;
}

.activity-item__text {
  color: var(--text);
  font-weight: 600;
}

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

.hidden {
  display: none !important;
}

@media (max-width: 1080px) {
  .hero,
  .layout-grid,
  .controls-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .hero__copy h1 {
    max-width: 14ch;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 18px, 1180px);
    padding: 18px 0 32px;
  }

  .hero__copy,
  .hero__stats,
  .panel--controls,
  .panel--list,
  .panel--form,
  .modal {
    border-radius: 22px;
  }

  .lead-table {
    min-width: 740px;
  }

  .panel__header--split {
    align-items: start;
    flex-direction: column;
  }

  .modal-backdrop {
    padding: 10px;
  }
}
