:root {
  --ink: #17222d;
  --muted: #667382;
  --line: #dbe3ea;
  --soft: #f5f7fa;
  --panel: #ffffff;
  --green: #0c6b58;
  --green-dark: #084c40;
  --orange: #d86035;
  --yellow: #f1c84b;
  --red: #b83b34;
  --shadow: 0 18px 46px rgba(23, 34, 45, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  color: var(--ink);
  background: #edf2f5;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
  color: #fff;
  background: #14212b;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
}

.brand span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--green);
  font-weight: 950;
}

.brand strong {
  font-size: 1.05rem;
}

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

.tab,
.export-link {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.76);
  background: transparent;
  text-align: left;
  text-decoration: none;
  font-weight: 850;
  cursor: pointer;
}

.tab.active,
.tab:hover,
.export-link:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
}

.export-link {
  margin-top: auto;
  background: var(--green);
}

.app {
  min-width: 0;
  padding: 28px;
}

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

.eyebrow {
  margin: 0 0 7px;
  color: var(--green-dark);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2rem, 5vw, 4.6rem);
  line-height: 0.94;
}

h2 {
  font-size: 1.2rem;
}

.top-actions,
.button-row,
.filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.button,
.icon-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-weight: 850;
  cursor: pointer;
  text-decoration: none;
}

.button.primary {
  color: #fff;
  border-color: var(--green);
  background: var(--green);
}

.button.danger {
  color: #fff;
  border-color: var(--orange);
  background: var(--orange);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

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

.grid.two {
  grid-template-columns: minmax(320px, 0.95fr) minmax(380px, 1.05fr);
}

.panel {
  padding: 18px;
  border: 1px solid rgba(219, 227, 234, 0.9);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

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

.panel-head span,
.badge {
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--green-dark);
  background: rgba(12, 107, 88, 0.1);
  font-size: 0.78rem;
  font-weight: 950;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  min-height: 118px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 18px;
  border-radius: 8px;
  color: #fff;
  background: var(--ink);
  box-shadow: var(--shadow);
}

.stat-card:nth-child(2n) {
  background: var(--green);
}

.stat-card:nth-child(3n) {
  color: var(--ink);
  background: var(--yellow);
}

.stat-card strong {
  font-size: 2.35rem;
  line-height: 0.9;
}

.stat-card span {
  font-weight: 850;
}

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

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

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

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

label.check {
  display: flex;
  align-items: center;
  gap: 8px;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 10px 11px;
}

textarea {
  resize: vertical;
}

.notice {
  margin: 12px 0;
  padding: 11px 12px;
  border-radius: 8px;
  color: #5c4a13;
  background: #fff6d8;
  line-height: 1.45;
  font-weight: 750;
}

.notice.strong {
  color: #74351e;
  background: #fff0e9;
}

.table-wrap {
  width: 100%;
  overflow: auto;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
}

td {
  font-size: 0.9rem;
}

tr:last-child td {
  border-bottom: 0;
}

.business-cell {
  display: grid;
  gap: 3px;
}

.business-cell strong {
  font-size: 0.94rem;
}

.business-cell span {
  color: var(--muted);
  font-size: 0.78rem;
}

.status {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  color: #fff;
  background: #73808c;
  font-size: 0.75rem;
  font-weight: 950;
}

.status.Interested,
.status.Replied {
  background: var(--green);
}

.status.Sent,
.status.Queued {
  background: #d6a542;
}

.status.Bounced,
.status.Unsubscribed {
  background: var(--red);
}

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

.list-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.list-item p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.list-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.timeline {
  display: grid;
  gap: 10px;
  max-height: 520px;
  overflow: auto;
}

.event {
  padding: 11px;
  border-left: 4px solid var(--green);
  border-radius: 8px;
  background: var(--soft);
}

.event strong {
  display: block;
}

.event span {
  color: var(--muted);
  font-size: 0.8rem;
}

dialog {
  width: min(900px, calc(100vw - 24px));
  border: 0;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
}

dialog::backdrop {
  background: rgba(20, 33, 43, 0.5);
}

.modal {
  display: grid;
  gap: 12px;
}

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

.detail-grid div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.detail-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 950;
  text-transform: uppercase;
}

.small-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.small-actions .button {
  min-height: 32px;
  padding: 0 9px;
  font-size: 0.78rem;
}

@media (max-width: 980px) {
  body {
    grid-template-columns: 1fr;
  }

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

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

  .grid.two,
  .stats-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

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