:root {
  color-scheme: light;
  --bg: #f5f7f6;
  --surface: #ffffff;
  --surface-soft: #eef3ef;
  --ink: #17211d;
  --muted: #60706a;
  --line: #d8e0dc;
  --green: #16845b;
  --amber: #b57a16;
  --coral: #c45543;
  --indigo: #4c63b6;
  --shadow: 0 12px 28px rgba(20, 31, 27, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

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

button {
  cursor: pointer;
}

.landing-page {
  background: #f7faf8;
}

.landing-nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(18px, 4vw, 52px);
  color: #ffffff;
}

.landing-brand,
.landing-actions {
  display: flex;
  align-items: center;
}

.landing-brand {
  gap: 10px;
  font-weight: 800;
}

.landing-login,
.landing-primary,
.landing-secondary {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-weight: 800;
}

.landing-login {
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.54);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
}

.landing-hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  color: #ffffff;
}

.landing-hero-media,
.landing-hero-overlay {
  position: absolute;
  inset: 0;
}

.landing-hero-media {
  background:
    linear-gradient(90deg, rgba(13, 34, 26, 0.92), rgba(13, 34, 26, 0.55) 48%, rgba(13, 34, 26, 0.2)),
    url("./assets/sendypo-hero-mail.png") center / cover no-repeat;
}

.landing-hero-overlay {
  background:
    radial-gradient(circle at 78% 30%, rgba(238, 164, 75, 0.28), transparent 32%),
    linear-gradient(180deg, rgba(13, 34, 26, 0.28), rgba(13, 34, 26, 0.84));
}

.landing-hero-content {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100% - 36px));
  margin-left: clamp(18px, 7vw, 96px);
  padding-top: 58px;
}

.landing-hero-content h1 {
  max-width: 720px;
  font-size: clamp(52px, 8vw, 118px);
  line-height: 0.92;
}

.landing-hero-content p:not(.eyebrow) {
  max-width: 650px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 20px;
  line-height: 1.55;
}

.landing-actions {
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.landing-primary,
.landing-secondary {
  padding: 0 18px;
}

.landing-primary {
  color: #ffffff;
  background: var(--green);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

.landing-secondary {
  border: 1px solid rgba(255, 255, 255, 0.48);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

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

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 14px;
  border-right: 1px solid var(--line);
  background: #fbfcfb;
}

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

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: var(--green);
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  color: var(--muted);
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 4px;
}

.nav-item {
  min-height: 38px;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  text-align: left;
}

.nav-item:hover,
.nav-item.is-active {
  color: var(--ink);
  background: var(--surface-soft);
}

.sidebar-note {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface);
  font-size: 13px;
}

.workspace {
  min-width: 0;
  padding: 22px;
}

.topbar,
.panel-heading,
.state-strip,
.top-actions,
.form-row {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

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

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

h1 {
  font-size: 28px;
}

h2 {
  font-size: 18px;
}

.top-actions {
  gap: 8px;
}

.icon-button,
.primary-action,
.secondary-action {
  min-height: 38px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.icon-button {
  width: 38px;
  color: var(--muted);
}

.primary-action {
  padding: 0 14px;
  border-color: var(--green);
  color: #ffffff;
  background: var(--green);
  font-weight: 700;
}

.secondary-action {
  padding: 0 14px;
  color: var(--green);
}

.state-strip {
  gap: 12px;
  margin-bottom: 18px;
  overflow-x: auto;
}

.state-item {
  min-width: 230px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.state-item strong,
.state-item span {
  display: block;
}

.state-item span {
  color: var(--muted);
  font-size: 13px;
}

.status-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--muted);
}

.status-dot.ok {
  background: var(--green);
}

.status-dot.wait {
  background: var(--amber);
}

.status-dot.neutral {
  background: var(--indigo);
}

.view {
  display: none;
}

.view.is-visible {
  display: block;
}

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

.metric-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 14px;
}

.metric-card strong,
.metric-card span {
  display: block;
}

.metric-card strong {
  margin: 4px 0;
  font-size: 26px;
}

.metric-label,
.metric-card span:last-child {
  color: var(--muted);
  font-size: 13px;
}

.layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.9fr);
  gap: 16px;
  margin-bottom: 16px;
}

.layout-grid.lower {
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
}

.panel {
  padding: 18px;
}

.full-panel {
  min-height: 420px;
}

.panel-heading {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.segmented-control {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.segmented-control button {
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
}

.segmented-control .is-selected {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(20, 31, 27, 0.12);
}

.campaign-form {
  display: grid;
  gap: 12px;
}

.campaign-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.campaign-form input,
.campaign-form textarea,
.campaign-form select {
  width: 100%;
  min-height: 38px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #ffffff;
}

.campaign-form textarea {
  resize: vertical;
}

.form-row {
  flex-wrap: wrap;
  gap: 12px;
}

.toggle-line,
.rule-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 600;
}

.badge,
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.badge {
  color: var(--green);
  background: #e7f5ee;
}

.pill.ok {
  color: var(--green);
  background: #e7f5ee;
}

.pill.wait {
  color: var(--amber);
  background: #fff4dd;
}

.checklist {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
}

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

.checklist .done {
  color: var(--ink);
  font-weight: 700;
}

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

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

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.event-list,
.rule-list {
  display: grid;
  gap: 12px;
}

.event-list div {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.kanban {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 12px;
}

.kanban article {
  display: grid;
  gap: 10px;
  min-height: 190px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.kanban span {
  padding: 10px;
  border-radius: 6px;
  background: var(--surface);
}

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

.bars span {
  position: relative;
  min-height: 38px;
  display: flex;
  align-items: center;
  padding-left: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #ffffff;
  font-weight: 700;
}

.bars span::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--value) * 1%);
  background: rgba(22, 132, 91, 0.14);
}

.empty-copy {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.6;
}

.sparkline {
  height: 280px;
  display: flex;
  align-items: end;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.sparkline span {
  flex: 1;
  min-width: 20px;
  border-radius: 6px 6px 0 0;
  background: var(--indigo);
}

@media (max-width: 980px) {
  .landing-hero {
    min-height: 100vh;
    min-height: 100svh;
  }

  .landing-hero-content {
    margin-right: 18px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .sidebar-note {
    display: none;
  }

  .metrics-grid,
  .layout-grid,
  .layout-grid.lower {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .landing-nav {
    padding: 12px 14px;
  }

  .landing-login {
    min-width: 92px;
  }

  .landing-hero {
    align-items: end;
    min-height: 100vh;
    min-height: 100svh;
  }

  .landing-hero-media {
    background:
      linear-gradient(180deg, rgba(13, 34, 26, 0.18), rgba(13, 34, 26, 0.9)),
      url("./assets/sendypo-hero-mail.png") center / cover no-repeat;
  }

  .landing-hero-content {
    width: calc(100% - 28px);
    margin: 0 14px;
    padding: 86px 0 34px;
  }

  .landing-hero-content h1 {
    font-size: 54px;
  }

  .landing-hero-content p:not(.eyebrow) {
    font-size: 17px;
  }

  .landing-primary,
  .landing-secondary {
    width: 100%;
  }

  .workspace {
    padding: 14px;
  }

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

  .top-actions {
    width: 100%;
  }

  .primary-action,
  .secondary-action {
    flex: 1;
  }

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

  .metrics-grid,
  .kanban {
    grid-template-columns: 1fr;
  }

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