:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #fbfaf7;
  --ink: #19202a;
  --muted: #69717f;
  --line: #ded8ce;
  --teal: #137c78;
  --teal-soft: #def1ee;
  --coral: #ef6f61;
  --coral-soft: #ffe1dc;
  --yellow: #f8c65b;
  --yellow-soft: #fff2cc;
  --green: #2f8f55;
  --red: #b83b3b;
  --shadow: 0 18px 42px rgba(33, 28, 21, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

.login-page {
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-shell {
  width: min(430px, 100%);
}

.login-card {
  display: grid;
  gap: 14px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

button {
  border: 0;
  cursor: pointer;
}

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

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

.brand,
.status-line,
.section-title,
.topbar,
.top-actions,
.variable-row,
.phone-header,
.event-row header,
.automation-item header {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 900;
}

h1,
h2,
p {
  margin: 0;
}

.brand h1 {
  font-size: 18px;
  line-height: 1.1;
}

.brand p,
.eyebrow,
.hero-caption span,
.stat-box p,
.post-meta,
.event-row p,
.automation-item p,
label span {
  color: var(--muted);
  font-size: 12px;
}

.account-card,
.panel,
.posts-panel,
.builder-panel,
.activity-panel,
.stat-box,
.simulator {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.account-card,
.panel,
.posts-panel,
.builder-panel,
.activity-panel {
  padding: 16px;
}

.status-line {
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 800;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(47, 143, 85, 0.14);
}

.status-dot.off {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(184, 59, 59, 0.14);
}

.hero-asset {
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-asset img {
  display: block;
  width: 100%;
  height: 168px;
  object-fit: cover;
}

.hero-caption {
  display: grid;
  gap: 4px;
  padding: 12px;
  background: var(--surface);
}

.hero-caption strong {
  font-size: 14px;
}

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

.stat-box {
  padding: 14px;
}

.stat-box span {
  display: block;
  font-size: 26px;
  font-weight: 900;
}

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

.check {
  display: flex;
  justify-content: space-between;
  min-height: 34px;
  align-items: center;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 800;
}

.check.done {
  background: var(--teal-soft);
  color: var(--teal);
}

.check.waiting {
  background: var(--yellow-soft);
  color: #755407;
}

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

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

.topbar h2 {
  font-size: 30px;
  line-height: 1.1;
}

.eyebrow {
  margin-bottom: 4px;
  text-transform: uppercase;
  font-weight: 900;
}

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

.top-actions form {
  margin: 0;
}

.primary-button,
.ghost-button {
  min-height: 40px;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 900;
}

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

.ghost-button {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
}

.wide {
  width: 100%;
}

.small {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(390px, 1.15fr) minmax(280px, 0.85fr);
  gap: 18px;
  align-items: start;
}

.section-title {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-title h2 {
  font-size: 16px;
}

.pill,
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border-radius: 8px;
  padding: 0 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.post-grid,
.automation-list,
.event-log {
  display: grid;
  gap: 10px;
}

.post-card {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  text-align: left;
  color: var(--ink);
}

.post-card.active {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(19, 124, 120, 0.13);
}

.post-thumb {
  min-height: 82px;
  border-radius: 8px;
  background-image: url("assets/deals-collage.png");
  background-size: 320px 180px;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.post-card h3 {
  margin: 0 0 6px;
  font-size: 14px;
}

.post-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.builder-panel {
  display: grid;
  gap: 14px;
}

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

label,
.stacked-field {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  outline: 0;
}

input,
select {
  min-height: 42px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  min-height: 130px;
  padding: 12px;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(19, 124, 120, 0.16);
}

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

.switch input {
  width: 18px;
  min-height: 18px;
}

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

.chip {
  color: var(--teal);
  background: var(--teal-soft);
}

.simulator {
  padding: 14px;
  background: var(--surface-2);
}

.setup-note {
  border-radius: 8px;
  padding: 11px 12px;
  background: var(--yellow-soft);
  color: #755407;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.phone-preview {
  margin-top: 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--ink);
  color: #fff;
  overflow: hidden;
}

.phone-header {
  justify-content: space-between;
  padding: 11px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
}

.phone-preview p {
  margin: 12px;
  padding: 11px 12px;
  border-radius: 8px;
  background: #2f3848;
  line-height: 1.42;
}

.automation-item,
.event-row {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.automation-item header,
.event-row header {
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.automation-item strong,
.event-row strong {
  font-size: 13px;
}

.automation-item p,
.event-row p {
  line-height: 1.35;
}

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

.badge.on,
.badge.sent {
  background: var(--teal-soft);
  color: var(--teal);
}

.badge.off,
.badge.miss {
  background: var(--coral-soft);
  color: #9e3f33;
}

.log-title {
  margin-top: 18px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 5;
  max-width: 340px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
  box-shadow: var(--shadow);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

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

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

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

@media (max-width: 760px) {
  .workspace,
  .sidebar {
    padding: 16px;
  }

  .topbar,
  .field-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .topbar h2 {
    font-size: 25px;
  }

  .top-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

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

@media (max-width: 520px) {
  .post-card {
    grid-template-columns: 1fr;
  }
}
