:root {
  --ink: #102033;
  --ink-soft: #3a4d63;
  --paper: #f3eee4;
  --paper-2: #fffaf2;
  --line: #d9d0c0;
  --teal: #0f6e63;
  --teal-deep: #0b4f48;
  --amber: #d3922a;
  --rose: #b44a3c;
  --good: #2b7a4b;
  --shadow: 0 18px 40px rgba(16, 32, 51, 0.08);
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Figtree", "Source Sans 3", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, #e7f3ef 0%, transparent 55%),
    radial-gradient(900px 400px at 110% 0%, #f7e6c6 0%, transparent 50%),
    var(--paper);
}

a { color: var(--teal-deep); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 250, 242, 0.8);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { display: flex; gap: 0.8rem; align-items: center; }
.mark {
  width: 2.4rem; height: 2.4rem; border-radius: 0.7rem;
  background: linear-gradient(145deg, var(--teal), var(--teal-deep));
  color: white; display: grid; place-items: center;
  font-family: var(--serif); font-weight: 600;
}
.brand h1 { font-size: 1.05rem; margin: 0; font-family: var(--serif); font-weight: 600; }
.brand p { margin: 0; font-size: 0.78rem; color: var(--ink-soft); }

.userbox { display: flex; gap: 0.6rem; align-items: center; font-size: 0.88rem; }
.btn {
  border: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--ink);
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
}
.btn.primary {
  background: var(--teal);
  border-color: var(--teal-deep);
  color: white;
}
.btn.ghost { background: transparent; }
.btn.warn { background: var(--rose); border-color: var(--rose); color: white; }

main { max-width: 1120px; margin: 0 auto; padding: 1.5rem; }

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.5rem;
  align-items: start;
  margin-bottom: 1.5rem;
}
.hero h2 {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.05;
  font-weight: 560;
  margin: 0 0 0.6rem;
}
.lede { color: var(--ink-soft); max-width: 42rem; }

.card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 0.7rem; font-family: var(--serif); font-size: 1.15rem; }

label { display: block; font-size: 0.78rem; color: var(--ink-soft); margin: 0.55rem 0 0.2rem; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 0.55rem;
  padding: 0.55rem 0.65rem;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.row-actions { display: flex; gap: 0.5rem; margin-top: 0.9rem; flex-wrap: wrap; }

.campaign-list { display: grid; gap: 0.7rem; }
.campaign-item {
  display: flex; justify-content: space-between; gap: 1rem; align-items: center;
  padding: 0.8rem 0; border-bottom: 1px dashed var(--line);
}
.campaign-item:last-child { border-bottom: 0; }

.toolbar {
  display: flex; justify-content: space-between; gap: 1rem; align-items: end;
  margin: 0.4rem 0 1rem; flex-wrap: wrap;
}
.filters { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
}
.chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.7rem; margin-bottom: 1rem; }
.stat { padding: 0.85rem; }
.stat b { display: block; font-family: var(--serif); font-size: 1.5rem; }

.listing {
  display: grid;
  grid-template-columns: 92px 1fr auto;
  gap: 0.9rem;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--line);
}
.score {
  width: 92px; height: 92px; border-radius: 1rem;
  display: grid; place-items: center;
  background: #e8f2ef;
  font-family: var(--serif);
  font-size: 1.6rem;
}
.score.mid { background: #f7edd8; }
.score.low { background: #f6e4e0; }
.meta { color: var(--ink-soft); font-size: 0.85rem; }
.badges { display: flex; gap: 0.35rem; flex-wrap: wrap; margin: 0.35rem 0; }
.badge {
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 0.15rem 0.45rem;
  background: #ece6da;
}
.badge.exist { background: #dcefe3; }
.badge.warn { background: #f3d7d3; }
.badge.gap { background: #dde6f5; }
.listing-actions { display: flex; flex-direction: column; gap: 0.35rem; min-width: 11rem; }
.listing-actions select, .listing-actions textarea { font-size: 0.82rem; }

.auth-panel { max-width: 28rem; margin: 3rem auto; }
.hidden { display: none !important; }
.notice {
  background: #eef6f3;
  border: 1px solid #cfe3dc;
  padding: 0.7rem 0.85rem;
  border-radius: 0.7rem;
  font-size: 0.88rem;
  margin: 0.6rem 0;
}
.error { color: var(--rose); font-size: 0.88rem; }

@media (max-width: 860px) {
  .hero, .stats, .listing, .grid-2 { grid-template-columns: 1fr; }
  .listing-actions { min-width: 0; }
}
