@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;700;800&display=swap');

:root {
  --bg:       #050a0f;
  --panel:    #080f18;
  --card:     #0a1422;
  --border:   #1a3a5c;
  --border2:  #0d2540;
  --text:     #c8dff0;
  --sub:      #3a6080;
  --cyan:     #00e5ff;
  --cyan2:    #2979ff;
  --green:    #00e676;
  --red:      #ff1744;
  --yellow:   #ffd600;
  --orange:   #ff6d00;
  --purple:   #aa00ff;
  --blue:     #2979ff;
  --font:     'JetBrains Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  overflow-x: hidden;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--cyan); }

/* ── Cyber map canvas background ── */
#cyber-map-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  display: block;
}

/* ── Header ── */
header {
  height: 56px;
  background: rgba(5,10,15,.97);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 200;
  backdrop-filter: blur(10px);
  overflow: hidden;
}

header .logo {
  font-size: .95rem;
  font-weight: 800;
  color: var(--cyan);
  letter-spacing: .06em;
  text-shadow: 0 0 16px rgba(0,229,255,.5);
}

header .byline {
  color: var(--sub);
  font-size: .7rem;
}

header .credits-badge {
  margin-left: auto;
  background: rgba(0,229,255,.07);
  border: 1px solid rgba(0,229,255,.18);
  border-radius: 5px;
  padding: 3px 10px;
  font-size: .8rem;
  color: var(--cyan);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

header a.nav-link {
  color: var(--sub);
  text-decoration: none;
  font-size: .8rem;
  padding: 5px 9px;
  border-radius: 4px;
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

header a.nav-link:hover {
  color: var(--cyan);
  background: rgba(0,229,255,.07);
  text-shadow: 0 0 8px rgba(0,229,255,.4);
}

/* ícone e texto do nav */
header .nav-link .ni { font-size: .8rem; line-height: 1; }
header .nav-link .nt { font-size: .8rem; font-weight: 700; letter-spacing: .03em; }

/* botões Key / Acessos */
.nav-btn-sm {
  background: rgba(0,229,255,.05);
  border: 1px solid rgba(0,229,255,.14);
  border-radius: 4px;
  padding: 3px 8px;
  cursor: pointer;
  font-family: var(--font);
  font-weight: 700;
  color: var(--cyan);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .8rem;
  transition: all .2s;
  width: auto;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-btn-sm:hover {
  background: rgba(0,229,255,.1);
  border-color: rgba(0,229,255,.3);
  color: var(--cyan);
}

/* botão X sair */
.nav-btn-exit {
  background: rgba(255,82,82,.05);
  border: 1px solid rgba(255,82,82,.18);
  color: rgba(255,82,82,.7);
  font-size: .8rem;
  font-weight: 900;
  padding: 3px 8px;
  text-decoration: none;
  width: auto;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-btn-exit:hover {
  background: rgba(255,82,82,.12);
  border-color: rgba(255,82,82,.4);
  color: #ff5252;
  text-shadow: none;
}

/* ── Banner ── */
.banner-alert {
  background: rgba(255,23,68,.06);
  border-bottom: 1px solid rgba(255,23,68,.18);
  color: #ff6b6b;
  text-align: center;
  padding: 5px 16px;
  font-size: .76rem;
  font-weight: 700;
  animation: pulse-banner 2s infinite;
  position: relative;
  z-index: 10;
}
}

@keyframes pulse-banner { 0%,100%{opacity:1} 50%{opacity:.6} }

.banner-sem-plano {
  background: rgba(255,193,7,.07);
  border-bottom: 1px solid rgba(255,193,7,.22);
  color: #ffc107;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 7px 20px;
  font-size: .76rem;
  font-weight: 700;
  position: relative;
  z-index: 10;
}

.banner-btn-plano {
  background: rgba(255,193,7,.15);
  border: 1px solid rgba(255,193,7,.35);
  color: #ffc107;
  border-radius: 5px;
  padding: 4px 14px;
  font-size: .72rem;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: .04em;
  transition: all .2s;
  white-space: nowrap;
}
.banner-btn-plano:hover {
  background: rgba(255,193,7,.28);
  border-color: rgba(255,193,7,.6);
}

/* ── Layout ── */
.layout {
  display: flex;
  height: calc(100vh - 48px);
  overflow: hidden;
}

.left-panel {
  width: 240px;
  min-width: 220px;
  background: rgba(8,15,24,.97);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 14px 12px;
  gap: 8px;
  overflow-y: auto;
  position: relative;
  z-index: 10;
}

.right-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 10px;
  gap: 8px;
  position: relative;
  z-index: 10;
}

/* ── Section title ── */
.section-title {
  font-size: .7rem;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 2px;
  text-shadow: 0 0 8px rgba(0,229,255,.3);
}

/* ── Labels / inputs ── */
label {
  font-size: .7rem;
  color: var(--sub);
  margin-top: 4px;
  display: block;
}

input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  background: #030810;
  border: 1px solid var(--border2);
  border-radius: 4px;
  color: var(--text);
  font-family: var(--font);
  font-size: .82rem;
  padding: 7px 9px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(0,229,255,.08);
}

select option { background: var(--panel); }

/* Remove spinners nativos dos inputs number */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

hr { border: none; border-top: 1px solid var(--border2); margin: 6px 0; }

/* ── Botões ── */
button, .btn {
  font-family: var(--font);
  font-size: .78rem;
  font-weight: 700;
  border: none;
  border-radius: 4px;
  padding: 8px 12px;
  cursor: pointer;
  width: 100%;
  transition: all .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  letter-spacing: .03em;
}

.btn-cyan  { background: linear-gradient(135deg,#00e5ff,#0097a7); color:#000; }
.btn-cyan:hover  { filter:brightness(1.15); box-shadow:0 0 18px rgba(0,229,255,.35); }

.btn-blue  { background: linear-gradient(135deg,#2979ff,#1565c0); color:#fff; }
.btn-blue:hover  { filter:brightness(1.1); box-shadow:0 0 14px rgba(41,121,255,.3); }

.btn-green { background: linear-gradient(135deg,#00e676,#00897b); color:#000; }
.btn-green:hover { filter:brightness(1.1); box-shadow:0 0 14px rgba(0,230,118,.25); }

.btn-red   { background: linear-gradient(135deg,#ff1744,#b71c1c); color:#fff; }
.btn-red:hover   { filter:brightness(1.1); }

.btn-ghost { background:transparent; border:1px solid var(--border); color:var(--sub); }
.btn-ghost:hover { border-color:var(--cyan); color:var(--cyan); }

button:disabled { opacity:.4; cursor:not-allowed; }

/* ── Stats ── */
.stats-row { display:flex; gap:8px; flex-shrink:0; }

.stat-box {
  flex:1;
  background: rgba(10,20,34,.92);
  border: 1px solid var(--border2);
  border-radius: 6px;
  padding: 10px 8px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.stat-box::after {
  content:'';
  position:absolute;
  bottom:0; left:0; right:0;
  height:2px;
  background: linear-gradient(90deg,transparent,var(--cyan),transparent);
  opacity:.2;
}

.stat-label { font-size:.6rem; color:var(--sub); text-transform:uppercase; letter-spacing:.07em; }

.stat-val { font-size:1.6rem; font-weight:800; color:var(--text); line-height:1.2; }
.stat-val.cyan   { color:var(--cyan);   text-shadow:0 0 12px rgba(0,229,255,.5); }
.stat-val.green  { color:var(--green);  text-shadow:0 0 10px rgba(0,230,118,.4); }
.stat-val.red    { color:var(--red); }
.stat-val.yellow { color:var(--yellow); }
.stat-val.purple { color:var(--purple); }

/* ── Log box ── */
.log-box {
  flex:1;
  background: rgba(3,8,16,.97);
  border: 1px solid var(--border2);
  border-radius: 6px;
  padding: 10px;
  overflow-y: auto;
  font-size: .78rem;
  line-height: 1.7;
  position: relative;
  z-index: 5;
}

.log-line { padding:3px 6px; border-radius:2px; margin-bottom:2px; border-left:3px solid transparent; }
.log-line.live    { border-color:var(--green);  background:rgba(0,230,118,.04); }
.log-line.parcial { border-color:var(--yellow); background:rgba(255,214,0,.03); }
.log-line.morta   { border-color:#1a2a3a; color:#2a4a6a; }
.log-line.semcpf  { border-color:var(--sub); color:var(--sub); }
.log-line.info    { border-color:var(--cyan); color:var(--cyan); }
.log-line.erro    { border-color:var(--orange); color:var(--orange); }

.log-live-badge {
  display:inline-block;
  background:var(--green); color:#000;
  font-size:.62rem; font-weight:800;
  padding:1px 6px; border-radius:2px; margin-right:4px;
}

.log-die-badge {
  display:inline-block;
  background:var(--red); color:#fff;
  font-size:.62rem; font-weight:800;
  padding:1px 6px; border-radius:2px; margin-right:4px;
}

.log-parcial-badge {
  display:inline-block;
  background:var(--yellow); color:#000;
  font-size:.62rem; font-weight:800;
  padding:1px 6px; border-radius:2px; margin-right:4px;
}

/* ── Buy panel ── */
.buy-panel {
  background: rgba(10,20,34,.95);
  border: 1px solid var(--cyan);
  border-radius: 6px;
  padding: 12px;
  flex-shrink: 0;
  box-shadow: 0 0 24px rgba(0,229,255,.08);
  position: relative;
  z-index: 5;
}

.buy-info { font-size:.82rem; color:var(--text); margin-bottom:10px; line-height:1.6; }
.buy-btns { display:flex; flex-direction:column; gap:6px; }
.buy-row  { display:flex; gap:6px; }

.btn-buy-green  { flex:1; background:linear-gradient(135deg,#00e676,#00897b); color:#000; }
.btn-buy-ghost  { flex:1; background:transparent; border:1px solid var(--border); color:var(--sub); }
.btn-buy-indigo { flex:1; background:linear-gradient(135deg,#651fff,#4527a0); color:#fff; }

/* ── Footer status ── */
footer#status-bar {
  height:28px;
  background:rgba(5,10,15,.98);
  border-top:1px solid var(--border2);
  display:flex; align-items:center;
  padding:0 14px; font-size:.7rem; gap:8px;
  position:relative; z-index:10;
}

.status-connected    { color:var(--green); text-shadow:0 0 8px rgba(0,230,118,.4); }
.status-disconnected { color:var(--sub); }
.status-connecting   { color:var(--yellow); }

/* ── Bot search ── */
.bot-search-wrap { position:relative; }
.bot-suggestions {
  position:absolute; top:100%; left:0; right:0;
  background:var(--panel); border:1px solid var(--border);
  border-radius:0 0 4px 4px; z-index:50;
  max-height:160px; overflow-y:auto;
}
.bot-suggestion-item { padding:6px 10px; cursor:pointer; font-size:.76rem; transition:background .15s; }
.bot-suggestion-item:hover { background:rgba(0,229,255,.07); color:var(--cyan); }

/* ── Spinner ── */
.spinner { display:none; width:14px; height:14px; border:2px solid rgba(0,229,255,.2); border-top-color:var(--cyan); border-radius:50%; animation:spin .6s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }

/* ── Suporte float ── */
.wa-float {
  position:fixed; bottom:22px; right:22px; z-index:9999;
  background:transparent; width:96px; height:96px;
  border-radius:50%; display:flex; align-items:center; justify-content:center;
  box-shadow:0 4px 22px rgba(0,0,0,.7);
  text-decoration:none; transition:transform .2s, box-shadow .2s;
  overflow:hidden;
}
.wa-float img {
  width:100%; height:100%;
  object-fit:cover; border-radius:50%; display:block;
  image-rendering:-webkit-optimize-contrast;
  image-rendering:crisp-edges;
}
.wa-float:hover { transform:scale(1.1); box-shadow:0 6px 28px rgba(0,229,255,.3); }

/* ── Page wrap (páginas internas) ── */
.page-wrap { max-width:900px; margin:0 auto; padding:24px 16px; position:relative; z-index:5; }

/* ── Responsive ── */
@media (max-width:768px) {
  .layout { flex-direction:column; height:auto; overflow:auto; }
  .left-panel { width:100%; min-width:0; border-right:none; border-bottom:1px solid var(--border); }
  .stats-row { flex-wrap:wrap; }
  .stat-box { min-width:calc(50% - 4px); }
}
