:root {
  --bg: #f3efe6;
  --ink: #1c1916;
  --muted: #6f675e;
  --line: #e3dbd0;
  --card: #fffdf8;
  --sidebar: #171512;
  --sidebar-ink: #f6f1e8;
  --accent: #c4511a;
  --accent-ink: #fff8f3;
  --green: #1f6b45;
  --green-bg: #e7f4ec;
  --amber: #8a5a10;
  --amber-bg: #fbf3df;
  --rose: #9f1239;
  --rose-bg: #fde8ee;
  --shadow: 0 18px 50px rgba(48, 32, 16, 0.08);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Outfit", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 10% -10%, rgba(196, 81, 26, 0.08), transparent 60%),
    var(--bg);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { font-family: "Fraunces", serif; font-weight: 560; letter-spacing: -0.03em; margin: 0; }

.page-loader {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 14px;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", sans-serif;
}
.page-loader p { margin: 0; font-size: 15px; }
.spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

#app { min-height: 100vh; display: grid; grid-template-columns: 300px 1fr; }
.sidebar {
  background:
    linear-gradient(180deg, rgba(196, 81, 26, 0.16), transparent 180px),
    var(--sidebar);
  color: var(--sidebar-ink);
  padding: 28px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100vh;
  position: sticky;
  top: 0;
}
.brand { padding: 0 8px; }
.brand small { display: block; color: #b7aa9b; letter-spacing: 0.14em; text-transform: uppercase; font-size: 11px; }
.brand strong { font-family: "Fraunces", serif; font-size: 28px; font-weight: 650; }
.connection {
  margin: 0 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #2a2622;
  color: #d9d0c4;
  font-size: 13px;
  line-height: 1.4;
}
.connection.ok { background: #1d3a2b; color: #d7f5e4; }
.connection.bad { background: #3a2424; color: #ffd7df; }
.advertiser-pick { display: grid; gap: 6px; margin: 0 8px; color: #b7aa9b; font-size: 12px; }
.advertiser-pick select {
  width: 100%;
  background: #2a2622;
  color: #f6f1e8;
  border: 1px solid #3c362f;
  border-radius: 10px;
  padding: 10px 12px;
}
.new-btn, .primary, .ghost, .danger {
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}
.new-btn, .primary { background: var(--accent); color: var(--accent-ink); }
.new-btn { width: calc(100% - 16px); margin: 0 8px; font-weight: 560; }
.primary:hover, .new-btn:hover { background: #a84314; }
.ghost { background: #fff; border: 1px solid #d9d0c4; }
.ghost:hover { border-color: #1c1916; }
.danger { background: var(--rose-bg); color: var(--rose); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
.search-hit { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.search-hit button { text-align: left; background: white; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.list-label {
  margin: 6px 8px 0;
  color: #8d8276;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.campaign-list { display: flex; flex-direction: column; gap: 4px; overflow: auto; min-height: 0; padding-right: 4px; }
.campaign-item {
  text-align: left;
  background: transparent;
  color: inherit;
  border: 0;
  border-radius: 14px;
  padding: 10px 12px;
}
.campaign-item.active, .campaign-item:hover { background: rgba(255, 255, 255, 0.06); }
.campaign-item.active { box-shadow: inset 3px 0 0 var(--accent); }
.campaign-item b { display: block; font-weight: 560; line-height: 1.3; }
.campaign-item span { display: flex; gap: 8px; align-items: center; color: #b7aa9b; font-size: 12px; margin-top: 4px; }
.status {
  font-style: normal;
  border-radius: 999px;
  padding: 2px 7px;
  background: #3a342e;
  color: #f6f1e8;
  text-transform: capitalize;
}
.status.active { background: #1f6b45; color: #e7f4ec; }
.status.paused { background: #8a5a10; color: #fff6e4; }
.status.draft { background: #3c4a66; color: #e7eefc; }
.status.error { background: #9f1239; color: #ffe4ea; }
.main { padding: 36px 48px 72px; max-width: 1120px; }
.eyebrow { margin: 0 0 8px; color: var(--accent); letter-spacing: 0.14em; text-transform: uppercase; font-size: 12px; font-weight: 560; }
.welcome { padding: 40px; }
.steps { display: flex; gap: 8px; flex-wrap: wrap; margin: 22px 0 28px; }
.step-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 7px 12px 7px 7px;
  border-radius: 999px;
}
.step-pill i {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #efe8dc;
  color: var(--ink);
  font-style: normal;
  font-size: 12px;
}
.step-pill.on { background: var(--ink); color: white; }
.step-pill.on i { background: var(--accent); color: white; }
.step-pill.done { color: var(--ink); }
.step-pill.done i { background: var(--green); color: white; }
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow);
}
.lede { color: var(--muted); margin: 8px 0 0; max-width: 62ch; line-height: 1.5; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: 1fr 1fr; }
.grid.three { grid-template-columns: repeat(3, 1fr); }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
label.field span { color: var(--muted); }
input[type="text"], input[type="number"], input[type="date"], input[type="url"], select, textarea {
  background: #fff;
  border: 1px solid #ddd4c8;
  border-radius: 12px;
  padding: 12px 12px;
  outline: none;
}
textarea { min-height: 140px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #c4511a; box-shadow: 0 0 0 3px rgba(196, 81, 26, 0.15); }
.choices { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.choice {
  flex: 1;
  min-width: 180px;
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 16px;
  padding: 16px;
}
.choice.on { border-color: var(--accent); background: #fff4ec; }
.choice b { display: block; font-family: "Fraunces", serif; font-size: 22px; margin-bottom: 4px; }
.choice small { color: var(--muted); }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check {
  display: flex;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: #fff;
}
.section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.section h3 { font-size: 22px; margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f6f0e6;
  border-radius: 999px;
  padding: 6px 10px;
}
.chip button { border: 0; background: transparent; color: var(--muted); padding: 0 2px; }
.row-actions, .footer { display: flex; gap: 10px; align-items: center; }
.footer { justify-content: space-between; margin-top: 26px; }
.creative-list { display: grid; gap: 12px; margin-bottom: 18px; }
.creative-card {
  display: grid;
  grid-template-columns: 92px 1fr auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: #fff;
}
.thumb {
  width: 92px;
  height: 68px;
  border-radius: 10px;
  background: #f3ece3 center/cover no-repeat;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
}
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; }
.meta { color: var(--muted); font-size: 13px; line-height: 1.45; }
.badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  background: var(--green-bg);
  color: var(--green);
}
.badge.warn { background: var(--amber-bg); color: var(--amber); }
.badge.local { background: #eeeaf8; color: #5b4b8a; }
.support { display: grid; gap: 8px; }
.support article {
  display: grid;
  grid-template-columns: 220px 88px 1fr;
  gap: 12px;
  align-items: start;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.notice, .error-box {
  border-radius: 14px;
  padding: 12px 14px;
  margin: 0 0 16px;
  line-height: 1.45;
}
.notice { background: var(--amber-bg); color: #6d4a0d; }
.error-box { background: var(--rose-bg); color: var(--rose); }
.log { margin: 8px 0 0; padding-left: 18px; }
.empty {
  padding: 48px 8px;
  color: var(--muted);
}
.campaign-list .empty { padding: 12px 8px; color: #b7aa9b; }
.point-row { display: grid; grid-template-columns: 1fr 1fr 120px auto; gap: 8px; margin-top: 8px; }
@media (max-width: 980px) {
  #app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; min-height: auto; }
  .campaign-list { max-height: 280px; }
  .main { padding: 20px 16px 48px; }
  .grid.two, .grid.three, .support article, .creative-card, .point-row { grid-template-columns: 1fr; }
}
