* { box-sizing: border-box; }
:root {
  --navy: #2b3b4b; --navy-2: #35485a; --cyan: #17c1dc; --cyan-dark: #0fa3ba;
  --tinta: #223140; --cinza: #6a7683; --borda: #e2e6ea; --bg: #f4f4f0; --card: #fff;
}
html, body { margin: 0; height: 100%; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--tinta); background: var(--bg); }

.mark { width: 34px; height: 34px; flex: none; }
.mark-lg { width: 60px; height: 60px; }
/* logo oficial (imagem) — usado no header e no gate */
.logo-img { height: 40px; width: auto; flex: none; display: block; }
.logo-img-lg { height: 68px; width: auto; flex: none; margin: 0 auto 2px; display: block; }

/* header */
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 22px; background: var(--card); border-bottom: 1px solid var(--borda);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-name { font-size: 18px; font-weight: 800; color: var(--navy); letter-spacing: .6px; }
.brand-name em { font-style: normal; font-weight: 600; color: var(--cyan); letter-spacing: .3px; }
.brand-slogan { font-size: 12px; color: var(--cinza); margin-top: 1px; }

/* gate (tela de senha) */
.gate {
  position: fixed; inset: 0; z-index: 1000; background: var(--navy);
  display: flex; align-items: center; justify-content: center;
  background-image: radial-gradient(circle at 30% 20%, rgba(23,193,220,.18), transparent 45%);
}
.gate.hidden { display: none; }
.gate-card {
  background: var(--card); border-radius: 16px; padding: 34px 30px; width: 320px;
  box-shadow: 0 18px 50px rgba(0,0,0,.35); text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.gate-brand { font-size: 20px; font-weight: 800; color: var(--navy); letter-spacing: .5px; margin-top: 4px; }
.gate-brand em { font-style: normal; font-weight: 600; color: var(--cyan); }
.gate-sub { font-size: 12.5px; color: var(--cinza); margin-bottom: 6px; }
.gate-card input {
  width: 100%; border: 1px solid var(--borda); border-radius: 9px; padding: 11px 12px; font-size: 15px;
}
.gate-card input:focus { outline: 2px solid var(--cyan); border-color: var(--cyan); }
.gate-card button {
  width: 100%; background: var(--cyan); color: #04323a; border: none; border-radius: 9px;
  padding: 11px; font-size: 15px; font-weight: 700; cursor: pointer;
}
.gate-card button:hover { background: var(--cyan-dark); color: #fff; }
.gate-erro { color: #ffb4b4; font-size: 13px; min-height: 18px; }

/* layout */
main { display: flex; height: calc(100vh - 60px); }
.painel { width: 46%; max-width: 620px; padding: 18px; overflow-y: auto; }
.mapa-wrap { flex: 1; border-left: 1px solid var(--borda); }
#mapa { width: 100%; height: 100%; background: #e9eef1; }

#form { display: flex; gap: 8px; }
textarea {
  flex: 1; resize: vertical; padding: 10px 12px; border: 1px solid var(--borda);
  border-radius: 9px; font-size: 15px; font-family: inherit;
}
textarea:focus { outline: 2px solid var(--cyan); border-color: var(--cyan); }
button#btn {
  background: var(--navy); color: #fff; border: none; border-radius: 9px;
  padding: 0 18px; font-size: 15px; font-weight: 600; cursor: pointer;
}
button#btn:hover { background: var(--navy-2); }
button#btn:disabled { opacity: .55; cursor: default; }

.exemplos { margin: 12px 0 4px; font-size: 13px; color: var(--cinza); }
.chip {
  display: inline-block; margin: 4px 4px 0 0; padding: 6px 11px; font-size: 12.5px;
  background: #e6f7fb; color: var(--cyan-dark); border: 1px solid #c3ebf3;
  border-radius: 20px; cursor: pointer;
}
.chip:hover { background: #d4f0f6; }

.status { margin: 12px 0; font-size: 14px; color: var(--cinza); min-height: 20px; }
.status.erro { color: #b23b3b; }

.card { background: var(--card); border: 1px solid var(--borda); border-radius: 11px; padding: 14px 16px; margin-top: 12px; }
.resposta { font-size: 15px; line-height: 1.55; border-left: 3px solid var(--cyan); }
.resposta p { margin: 0 0 8px; }
.resposta p:last-child { margin-bottom: 0; }
.resposta ul { margin: 4px 0 8px; padding-left: 20px; }
.resposta li { margin: 2px 0; }
.resposta strong { color: var(--navy); font-weight: 700; }
.resposta .r-h { font-weight: 800; color: var(--navy); margin: 12px 0 4px; font-size: 15.5px; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
details summary { cursor: pointer; font-size: 13px; color: var(--cinza); font-weight: 600; }
pre#sql { white-space: pre-wrap; font-size: 12.5px; color: var(--navy-2); margin: 8px 0 0; }

.tabela-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { border-bottom: 1px solid var(--borda); padding: 6px 9px; text-align: left; white-space: nowrap; }
th { color: var(--navy); font-weight: 700; }

@media (max-width: 820px) {
  main { flex-direction: column; height: auto; }
  .painel { width: 100%; max-width: none; }
  .mapa-wrap { border-left: none; border-top: 1px solid var(--borda); }
  #mapa { height: 60vh; }
  .brand-slogan { display: none; }
}
