:root {
  --yellow: #FFCE2E;
  --yellow-light: #FFDE47;
  --bg-dark: #242424;
  --bg-darker: #121212;
  --text-on-dark: rgba(255,255,255,.8);
  --text-faint: rgba(255,255,255,.45);
  --link-on-dark: #409CFF;
  --radius: 16px;
  --font-display: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-text: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  font-family: var(--font-text);
  background: var(--bg-darker);
  color: var(--text-on-dark);
  margin: 0;
}

a { color: var(--link-on-dark); }

/* topo */
header.topbar {
  background: var(--bg-dark);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand { display: flex; align-items: center; gap: 0.9rem; }
.brand img { height: 26px; }
.brand .separador { width: 1px; height: 22px; background: rgba(255,255,255,.2); }
header.topbar h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1rem;
  margin: 0;
  color: #fff;
}
header.topbar button {
  background: transparent;
  border: 1px solid rgba(255,255,255,.2);
  color: var(--text-on-dark);
  padding: 0.4rem 0.9rem;
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--font-text);
  font-size: 0.85rem;
}
header.topbar button:hover { border-color: var(--yellow); color: var(--yellow); }

/* layout com menu lateral (admin) */
.admin-shell { display: flex; max-width: 1300px; margin: 0 auto; align-items: flex-start; }
.sidebar { width: 200px; flex-shrink: 0; padding: 1.5rem 1rem; }
.sidebar a {
  display: block;
  padding: 0.6rem 0.9rem;
  margin-bottom: 0.3rem;
  border-radius: 10px;
  color: var(--text-on-dark);
  text-decoration: none;
  font-size: 0.9rem;
}
.sidebar a:hover { background: var(--bg-dark); }
.sidebar a.active { background: var(--bg-dark); color: var(--yellow); font-weight: 600; }
.admin-content { flex: 1; min-width: 0; padding: 1.5rem 1.5rem 3rem; max-width: 900px; }

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

.box {
  background: var(--bg-dark);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.box h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1rem;
  margin: 0 0 1rem;
  color: var(--yellow);
}
.hint { color: var(--text-faint); font-size: 0.85rem; margin-top: 0.5rem; }

label { display: block; font-size: 0.85rem; margin-bottom: 0.3rem; color: var(--text-faint); }
input, textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.15);
  background: var(--bg-darker);
  color: #fff;
  font-family: var(--font-text);
  font-size: 0.9rem;
}
input:focus, textarea:focus { outline: none; border-color: var(--yellow); }

.btn-primary {
  padding: 0.65rem 1.3rem;
  border: none;
  border-radius: var(--radius);
  background: var(--yellow);
  color: #121212;
  font-family: var(--font-display);
  font-weight: 700;
  cursor: pointer;
  font-size: 0.9rem;
}
.btn-primary:hover { background: var(--yellow-light); }

.btn-secundario {
  padding: 0.65rem 1.3rem;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-on-dark);
  font-family: var(--font-text);
  cursor: pointer;
  font-size: 0.9rem;
}
.btn-secundario:hover { border-color: var(--yellow); color: var(--yellow); }

.linha-form { display: flex; gap: 0.6rem; margin-top: 0.8rem; flex-wrap: wrap; }

.apikey, .mono { font-family: monospace; font-size: 0.85rem; }
.apikey {
  background: var(--bg-darker);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
  word-break: break-all;
  user-select: all;
}

.endpoint { border-bottom: 1px solid rgba(255,255,255,.06); padding: 1rem 0; }
.endpoint:last-child { border-bottom: none; padding-bottom: 0; }
.metodo {
  display: inline-block;
  background: var(--link-on-dark);
  color: #0b1220;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  margin-right: 0.5rem;
  vertical-align: middle;
}
.caminho { font-family: monospace; font-size: 0.95rem; }
.campos { margin: 0.6rem 0 0; font-size: 0.85rem; color: rgba(255,255,255,.7); }
.campos b { color: var(--yellow); }
.campos .opc { color: var(--text-faint); }

form.teste { margin-top: 1rem; }
form.teste .linha { display: flex; gap: 0.6rem; margin-bottom: 0.6rem; flex-wrap: wrap; }
form.teste input, form.teste textarea { flex: 1; min-width: 140px; }
form.teste textarea { min-height: 50px; font-family: monospace; }

pre.resultado {
  background: var(--bg-darker);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  padding: 1rem;
  margin-top: 1rem;
  overflow-x: auto;
  font-size: 0.8rem;
  max-height: 400px;
}
.status-ok { color: #4ade80; }
.status-erro { color: #f87171; }

.cartoes { display: flex; gap: 1rem; flex-wrap: wrap; }
.cartao {
  background: var(--bg-darker);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  padding: 1rem 1.3rem;
  flex: 1;
  min-width: 160px;
}
.cartao .valor { font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; color: var(--yellow); }
.cartao .valor.alerta { color: #f87171; }
.cartao .rotulo { font-size: 0.8rem; color: var(--text-faint); margin-top: 0.3rem; }

table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th, td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid rgba(255,255,255,.06); vertical-align: top; }
th { color: var(--text-faint); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; }
tr:last-child td { border-bottom: none; }
.tag { font-size: 0.7rem; padding: 0.1rem 0.4rem; border-radius: 4px; font-weight: 700; }
.tag.ok { background: #14532d; color: #4ade80; }
.tag.erro { background: #450a0a; color: #f87171; }
.params { max-width: 320px; overflow-x: auto; white-space: pre; }
.vazio { color: rgba(255,255,255,.35); font-size: 0.85rem; padding: 0.5rem 0; }

.aviso-ok {
  background: #14532d;
  color: #4ade80;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}
.aviso-erro {
  background: #450a0a;
  color: #fca5a5;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  margin-top: 0.8rem;
  font-size: 0.85rem;
}

/* login */
.login-page {
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.login-page .logo { height: 40px; margin-bottom: 2rem; }
.card {
  background: var(--bg-dark);
  padding: 2.5rem;
  border-radius: var(--radius);
  width: 100%;
  max-width: 360px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
.card h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.3rem;
  margin: 0 0 1.5rem;
  text-align: center;
  color: #fff;
}
.card input { margin-bottom: 1rem; }
.card .btn-primary { width: 100%; padding: 0.75rem; }
.erro {
  background: #450a0a;
  color: #fca5a5;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}
