:root {
  --yellow: #ffd400;
  --black: #0a0a0a;
  --panel: #171717;
  --line: #363636;
  --text: #f7f7f7;
  --muted: #aaa;
  --green: #5ed48b;
  --red: #ff6b6b;
}

* { box-sizing: border-box; }

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 0 5vw;
  border-bottom: 1px solid var(--line);
  background: #000;
}

.brand {
  color: var(--yellow);
  font-weight: 900;
  letter-spacing: .08em;
}

.area {
  margin-left: 14px;
  color: var(--muted);
  font-size: .9rem;
}

main {
  width: min(900px, 92vw);
  margin: 0 auto;
  padding: 56px 0 80px;
}

.intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

h1 { margin: 3px 0 0; font-size: clamp(2rem, 6vw, 3.7rem); }
h2 { margin: 3px 0 0; font-size: clamp(1.4rem, 4vw, 2rem); }
p { line-height: 1.55; }
.eyebrow { margin: 0; color: var(--yellow); font-weight: 800; text-transform: uppercase; letter-spacing: .1em; font-size: .76rem; }
.muted, .admin-email { color: var(--muted); }
.admin-email { margin: 0 0 8px; }

.card {
  padding: clamp(22px, 5vw, 38px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 22px 60px rgba(0, 0, 0, .3);
}

.compact { width: min(480px, 100%); margin: 8vh auto 0; }
.hidden { display: none !important; }
.editor-card { margin-bottom: 22px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; }
#active-count { color: var(--yellow); }

form { margin-top: 26px; }
label { display: block; margin: 0 0 8px; font-size: .85rem; font-weight: 700; }

input {
  width: 100%;
  min-height: 48px;
  padding: 10px 13px;
  border: 1px solid #4b4b4b;
  border-radius: 9px;
  background: #0e0e0e;
  color: var(--text);
  font: inherit;
}

input:focus { outline: 2px solid var(--yellow); outline-offset: 1px; }

button {
  min-height: 46px;
  padding: 10px 18px;
  border: 1px solid var(--yellow);
  border-radius: 9px;
  background: var(--yellow);
  color: #000;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

button:disabled { cursor: wait; opacity: .55; }
.secondary { background: transparent; color: var(--yellow); }
.small { min-height: 38px; padding: 7px 13px; font-size: .85rem; }
.danger { border-color: #743939; background: transparent; color: var(--red); }
.link-button { min-height: auto; padding: 7px 0; border: 0; background: transparent; color: var(--muted); }

.search-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 24px; }
.actions { display: flex; gap: 12px; margin-top: 28px; }

.status-box {
  margin-top: 24px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #101010;
}

.status-box.active { border-color: #2f6b45; color: var(--green); }
.status-box.inactive { border-color: #704141; color: var(--red); }
.status-box.empty { color: var(--muted); }
.status-title { display: block; margin-bottom: 5px; font-weight: 850; }
.status-detail { color: var(--muted); font-size: .9rem; }
.message { min-height: 24px; margin: 18px 0 0; color: var(--muted); }
.message.error { color: var(--red); }
.message.success { color: var(--green); }

.table-wrap { margin-top: 18px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 10px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
td { font-size: .92rem; }
td:last-child, th:last-child { text-align: right; }
.source-pill { display: inline-block; padding: 4px 7px; border-radius: 999px; background: #2b2b2b; color: var(--muted); font-size: .75rem; white-space: nowrap; }
.edit-customer { min-height: 34px; padding: 5px 10px; }
.legacy-id { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

@media (max-width: 650px) {
  main { padding-top: 34px; }
  .intro { display: block; }
  .admin-email { margin-top: 12px; }
  .grid { grid-template-columns: 1fr; }
  .actions { align-items: stretch; flex-direction: column; }
  .search-row { grid-template-columns: 1fr; }
  .area { display: none; }
  .section-heading { align-items: stretch; flex-direction: column; }
}
