:root {
  --bg: #0c1424;
  --panel: #121d33;
  --panel2: #0f192c;
  --line: #1f2d49;
  --txt: #e6edf7;
  --muted: #8aa0c2;
  --accent: #1e9e5a;      /* verde Daycoval */
  --accent2: #36c576;
  --amber: #f0a836;
  --err: #ff6b6b;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--txt);
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
}
.hidden { display: none !important; }

/* login */
.login { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--bg); z-index: 10; }
.login-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 32px; width: 320px; text-align: center; }
.login-card h1 { margin: 0 0 4px; color: var(--accent2); letter-spacing: 1px; }
.login-card p { color: var(--muted); margin: 0 0 18px; }
.login-card input { width: 100%; }
.login-card button { width: 100%; margin-top: 12px; }
.err { color: var(--err); margin-top: 10px; min-height: 18px; }

/* header */
header { display: flex; align-items: center; justify-content: space-between; padding: 14px 22px; border-bottom: 1px solid var(--line); background: var(--panel2); }
.brand { display: flex; align-items: baseline; gap: 12px; }
.logo { font-weight: 800; letter-spacing: 2px; color: var(--accent2); font-size: 20px; }
.sub { color: var(--muted); font-size: 12px; }
.env { color: var(--muted); font-size: 12px; font-family: monospace; }

/* tabs */
nav { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 22px; border-bottom: 1px solid var(--line); }
nav button { background: var(--panel); color: var(--muted); border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; cursor: pointer; font-size: 13px; }
nav button:hover { color: var(--txt); }
nav button.active { background: var(--accent); color: #fff; border-color: var(--accent); }

main { padding: 22px; max-width: 980px; margin: 0 auto; }
.panel h2 { margin: 0 0 6px; font-size: 18px; }
.panel h2 small { color: var(--muted); font-weight: 400; font-size: 12px; font-family: monospace; margin-left: 8px; }
.hint { color: var(--muted); margin: 4px 0 14px; line-height: 1.5; }
.hint code { background: var(--panel); padding: 1px 5px; border-radius: 4px; color: var(--amber); }

.row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 12px; }
label { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 12px; }
input, textarea {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 8px;
  color: var(--txt); padding: 9px 11px; font-size: 14px; min-width: 240px;
}
textarea { width: 100%; min-height: 260px; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; line-height: 1.5; resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); }

button { background: var(--accent); color: #fff; border: none; border-radius: 8px; padding: 10px 18px; font-size: 14px; font-weight: 600; cursor: pointer; }
button:hover { background: var(--accent2); }
button.ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); }
button.go { margin-top: 12px; }

/* cards / formulário bonito */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; margin-bottom: 16px; }
.card-title { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--accent2); }
details.card > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; user-select: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::before { content: "▸"; color: var(--muted); transition: transform .15s ease; }
details.card[open] > summary::before { transform: rotate(90deg); }
details.card > .form-grid { margin-top: 16px; }
.muted-inline { color: var(--muted); font-weight: 400; font-size: 12px; text-transform: none; letter-spacing: 0; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px 16px; }
.fld { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 600; }
.fld input { width: 100%; min-width: 0; font-weight: 400; }
.fld input::placeholder { color: #5a6e8e; }
.req { color: var(--amber); }

.json-preview { margin: 2px 0 16px; }
.json-preview > summary { cursor: pointer; color: var(--muted); font-size: 12px; padding: 6px 0; user-select: none; }
.json-preview pre { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 12px; font-size: 12px; line-height: 1.5; overflow: auto; margin: 8px 0 0; color: var(--muted); }

/* resultado */
.result { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 18px; }
.result-head { display: flex; align-items: center; gap: 12px; }
.result-head h3 { margin: 0; }
#status-badge { font-family: monospace; font-size: 12px; padding: 2px 9px; border-radius: 6px; }
#status-badge.ok { background: rgba(30,158,90,.2); color: var(--accent2); border: 1px solid var(--accent); }
#status-badge.bad { background: rgba(255,107,107,.15); color: var(--err); border: 1px solid var(--err); }
#output { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 16px; overflow: auto; max-height: 460px; white-space: pre-wrap; word-break: break-word; font-size: 13px; line-height: 1.5; }
