:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #eef2f6;
  --text: #1d2430;
  --muted: #667085;
  --line: #d9e0e8;
  --blue: #2563eb;
  --green: #0f8b5f;
  --amber: #b7791f;
  --red: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, Segoe UI, Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

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

.sidebar {
  background: #111827;
  color: #f9fafb;
  padding: 22px 18px;
}

.brand {
  font-size: 22px;
  font-weight: 750;
  margin-bottom: 4px;
}

.brand-sub {
  color: #aeb7c4;
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 24px;
}

.nav-button {
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #dbe3ef;
  padding: 11px 12px;
  margin-bottom: 6px;
  text-align: left;
  cursor: pointer;
}

.nav-button.active,
.nav-button:hover {
  background: #233044;
  color: #ffffff;
}

.main {
  padding: 26px 32px 48px;
}

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

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

h1 {
  font-size: 28px;
  line-height: 1.2;
}

h2 {
  font-size: 20px;
  margin-bottom: 14px;
}

h3 {
  font-size: 16px;
  margin-bottom: 10px;
}

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

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

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

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

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

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.card.soft {
  background: #f8fafc;
}

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

.insight-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  padding: 16px;
  display: grid;
  gap: 7px;
  min-height: 104px;
}

.insight-card strong {
  line-height: 1.35;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.section-heading p {
  margin: 0;
  max-width: 760px;
}

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

.analysis-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  display: grid;
  gap: 10px;
  background: #fbfdff;
}

.analysis-card h3,
.analysis-card p {
  margin: 0;
}

.warning-card {
  border-color: #f3d08a;
  background: #fffaf0;
}

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

.campaign-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbfdff;
  display: grid;
  gap: 14px;
}

.campaign-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.campaign-card h3,
.campaign-card h4,
.campaign-card p {
  margin: 0;
}

.campaign-card h4 {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.campaign-columns {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 14px;
}

.compact-list {
  margin: 0;
  padding-left: 17px;
}

.compact-list li {
  margin: 4px 0;
}

.ad-preview-list {
  display: grid;
  gap: 8px;
}

.mini-ad {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface);
  font-size: 14px;
  line-height: 1.4;
}

.next-action-card {
  border-color: #b8c8ee;
}

.flow-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.flow-step {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 62px;
}

.flow-step strong {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-soft);
  color: var(--muted);
  flex: 0 0 auto;
}

.flow-step.done {
  border-color: #b7ebc6;
  background: #f0fdf4;
}

.flow-step.done strong {
  background: #dcfce7;
  color: var(--green);
}

.flow-step.current {
  border-color: #9bb7f5;
  background: #eff6ff;
}

.flow-step.current strong {
  background: #dbeafe;
  color: var(--blue);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.action-row .button.secondary {
  margin-left: 0;
}

.project-card {
  cursor: pointer;
}

.project-card:hover {
  border-color: #9bb7f5;
}

.plan-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 14px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.plan-hero p {
  max-width: 760px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.5;
}

.plan-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: 220px;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 9px;
  background: var(--surface-soft);
  color: #344054;
  font-size: 12px;
}

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

.badge.amber {
  background: #fef3c7;
  color: var(--amber);
}

.badge.blue {
  background: #dbeafe;
  color: var(--blue);
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.tab {
  border: 0;
  background: transparent;
  padding: 11px 12px;
  cursor: pointer;
  color: var(--muted);
  border-bottom: 2px solid transparent;
}

.tab.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

.table {
  width: 100%;
  border-collapse: collapse;
}

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

.table th {
  color: var(--muted);
  font-weight: 650;
  font-size: 13px;
}

.list {
  margin: 0;
  padding-left: 18px;
}

.list li {
  margin: 5px 0;
}

.metric {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
}

.metric:last-child {
  border-bottom: 0;
}

.ad-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-top: 10px;
}

.ad-title {
  color: #1a0dab;
  font-size: 17px;
  line-height: 1.25;
  margin-bottom: 5px;
}

.ad-url {
  color: var(--green);
  font-size: 13px;
  margin-bottom: 5px;
}

.status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}

.button {
  border: 0;
  background: var(--blue);
  color: white;
  border-radius: 8px;
  padding: 10px 13px;
  cursor: pointer;
}

.button.secondary {
  background: #344054;
  margin-left: 8px;
}

.button:disabled {
  background: #98a2b3;
  cursor: not-allowed;
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .grid.two,
  .grid.three,
  .grid.four,
  .insight-strip,
  .analysis-grid,
  .campaign-grid,
  .campaign-columns,
  .flow-steps {
    grid-template-columns: 1fr;
  }

  .plan-hero {
    display: block;
  }

  .plan-status {
    justify-content: flex-start;
    margin-top: 14px;
  }

  .main {
    padding: 20px 16px 36px;
  }
}
