:root {
  --ink: #1e1e20;
  --panel: #20282d;
  --mist: #f4f6f8;
  --muted: #9aa3ab;
  --lime: #82b440;
  --lime-dim: #6a9634;
  --blue: #0b4df5;
  --capo-green: #409098;
  /* No fundo escuro do site: tom mais claro do logo (~#58c0d0). */
  --capo-green-on-dark: #58c0d0;
  --line: rgba(244, 246, 248, 0.12);
  --glow: rgba(11, 77, 245, 0.22);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Figtree", system-ui, sans-serif;
  background: var(--ink);
  color: var(--mist);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 500px at 12% -10%, var(--glow), transparent 60%),
    radial-gradient(700px 420px at 100% 20%, rgba(130, 180, 64, 0.12), transparent 55%),
    linear-gradient(180deg, #141416 0%, #1e1e20 45%, #141416 100%);
}
a { color: var(--lime); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap {
  width: min(1120px, calc(100% - 2.5rem));
  margin-inline: auto;
}
.wrap.page {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.narrow { width: min(720px, calc(100% - 2.5rem)); }

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}
.brand-lockup:hover { text-decoration: none; }
.brand-lockup img {
  height: 36px;
  width: auto;
  display: block;
}
/* Wordmark tipográfico: Syne (sign) + Red Hat Display (Capo). */
.brand-mark {
  display: inline-flex;
  align-items: baseline;
  line-height: 0.95;
  letter-spacing: -0.045em;
  font-size: 2.15rem;
  font-weight: 800;
  color: var(--mist);
}
.brand-mark .bm-sign,
.brand-mark .bm-dot {
  font-family: "Syne", sans-serif;
  font-weight: 800;
  color: var(--mist);
}
.brand-mark .bm-capo {
  font-family: "Red Hat Display", "Syne", sans-serif;
  font-weight: 700;
  color: var(--lime);
}
.brand-lockup .product {
  font-family: "Syne", sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  color: var(--mist);
  border-left: 1px solid var(--line);
  padding-left: 0.75rem;
}
.brand-lockup .product span { color: var(--lime); }

header.site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0;
  gap: 1rem;
}
nav {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  font-size: 0.92rem;
}
nav a { color: var(--muted); }
nav a:hover { color: var(--mist); text-decoration: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1.35rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:disabled { opacity: 0.6; cursor: progress; transform: none; }
.btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(11, 77, 245, 0.35), 0 12px 40px rgba(11, 77, 245, 0.25);
}
.btn-ghost {
  background: transparent;
  color: var(--mist);
  border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: var(--muted); }

h1 {
  font-family: "Syne", sans-serif;
  font-weight: 800;
  letter-spacing: -0.04em;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.05;
  margin-bottom: 0.6rem;
}
.lead { color: var(--muted); max-width: 38rem; margin-bottom: 1.5rem; }
.kicker {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--lime-dim);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  padding: 1.35rem 1.4rem 1.5rem;
  margin-bottom: 1rem;
}
.card h2 {
  font-family: "Syne", sans-serif;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
  margin-bottom: 0.35rem;
}
.card p.hint { color: var(--muted); font-size: 0.92rem; margin-bottom: 1rem; }

form.stack, .stack { display: grid; gap: 0.85rem; }
.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}
@media (max-width: 720px) {
  .row { grid-template-columns: 1fr; }
  nav .hide-sm { display: none; }
}

label.field {
  display: grid;
  gap: 0.3rem;
  font-size: 0.88rem;
  color: var(--muted);
}
input, select {
  font: inherit;
  color: var(--mist);
  background: #141416;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  padding: 0.7rem 0.8rem;
}
.check {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  color: var(--muted);
  font-size: 0.92rem;
}
.check input { margin-top: 0.2rem; }

.status { font-size: 0.88rem; color: var(--muted); min-height: 1.2em; }
.status.err { color: #ff8f7a; }
.status.ok { color: var(--lime); }

.secret {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.85rem;
  word-break: break-all;
  background: #141416;
  border-radius: 0.65rem;
  padding: 0.75rem 0.8rem;
  border: 1px dashed rgba(130, 180, 64, 0.45);
}
.kv { display: grid; gap: 0.35rem; margin-top: 0.6rem; }
.kv div { display: flex; justify-content: space-between; gap: 1rem; }
.kv span { color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.8rem; }
.page { padding-bottom: 0; }

/* Admin */
.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 1.25rem;
  padding: 0.35rem;
  background: rgba(32, 40, 45, 0.7);
  border: 1px solid var(--line);
  border-radius: 999px;
  width: fit-content;
  max-width: 100%;
}
.admin-nav button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  cursor: pointer;
}
.admin-nav button.active {
  background: var(--blue);
  color: #fff;
}
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}
@media (max-width: 960px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .kpi-grid { grid-template-columns: 1fr; }
}
.kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1rem 1.1rem;
}
.kpi .label {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.kpi .value {
  font-family: "Syne", sans-serif;
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-top: 0.35rem;
  tabular-nums: true;
  font-variant-numeric: tabular-nums;
}
.kpi .sub { color: var(--muted); font-size: 0.85rem; margin-top: 0.2rem; }
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--panel);
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
table.data th,
table.data td {
  text-align: left;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.data th {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}
table.data tr:last-child td { border-bottom: 0; }
table.data tr.clickable { cursor: pointer; }
table.data tr.clickable:hover td { background: rgba(11, 77, 245, 0.08); }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-ok { background: rgba(130, 180, 64, 0.18); color: var(--lime); }
.badge-warn { background: rgba(255, 180, 70, 0.16); color: #ffc56d; }
.badge-err { background: rgba(255, 100, 80, 0.16); color: #ff8f7a; }
.badge-info { background: rgba(11, 77, 245, 0.16); color: #8fb0ff; }
.badge-muted { background: rgba(154, 163, 171, 0.16); color: var(--muted); }
.mono { font-family: ui-monospace, Consolas, monospace; letter-spacing: 0.04em; }
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: end;
  margin-bottom: 1rem;
}
.toolbar .field { min-width: 10rem; }
.toolbar .grow { flex: 1; min-width: 14rem; }
.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
}
.btn-danger {
  background: #a33a2c;
  color: #fff;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 12, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 40;
}
.modal {
  width: min(560px, 100%);
  max-height: min(90vh, 900px);
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  padding: 1.35rem 1.4rem 1.5rem;
}
.modal h2 { margin-bottom: 0.75rem; }
.hidden { display: none !important; }
.tabs {
  display: flex;
  gap: 0.35rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1rem;
}
.tabs button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  padding: 0.65rem 0.9rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tabs button.active {
  color: var(--mist);
  border-bottom-color: var(--lime);
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}
@media (max-width: 720px) {
  .detail-grid { grid-template-columns: 1fr; }
}
textarea {
  font: inherit;
  color: var(--mist);
  background: #141416;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  padding: 0.7rem 0.8rem;
  min-height: 5rem;
  resize: vertical;
  width: 100%;
}

footer.site {
  margin-top: auto;
  padding: 1.6rem 0 2.2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem 1.5rem;
  flex-wrap: wrap;
}
footer.site a { color: var(--mist); }
footer.site .legal { max-width: 44rem; }
footer.site .links { display: flex; gap: 1.15rem; flex-wrap: wrap; }
