:root {
  color-scheme: dark;
  --bg: #0b1220;
  --card: #121a2b;
  --line: #243044;
  --text: #e8eefc;
  --muted: #93a0b8;
  --accent: #3dd68c;
  --danger: #ff8b8b;
  --warn: #fcd34d;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
[hidden] { display: none !important; }
.manual-pix fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 16px 0; min-width: 0; padding: 12px; }
body {
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 32px 20px 64px; }
.wrap-wide { max-width: 1280px; margin: 0 auto; padding: 24px 24px 64px; }
.login { max-width: 420px; }
.eyebrow { color: var(--accent); letter-spacing: 0.08em; text-transform: uppercase; font-size: 12px; }
h1 { font-size: 28px; margin: 8px 0 12px; }
h1 small { color: var(--muted); font-size: 14px; font-weight: 400; margin-left: 6px; }
h2 { font-size: 18px; margin: 0 0 12px; }
h3 { font-size: 16px; margin: 0 0 8px; }
p, li { color: var(--muted); line-height: 1.5; }
a { color: var(--accent); }
code { background: #0b1220; border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: 13px; color: var(--text); }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.button, button {
  border: 0;
  background: var(--accent);
  color: #062015;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
button:disabled { opacity: .45; cursor: not-allowed; }
.button.secondary, button.secondary { background: transparent; color: var(--text); border: 1px solid var(--line); }
button.secondary:hover:not(:disabled) { border-color: #3a4a66; }
button.small, .button.small { padding: 6px 10px; font-size: 13px; }
button.danger { color: var(--danger); border-color: #5a2a2a; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-top: 16px; }
label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
input, select, textarea {
  background: #0b1220;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  font: inherit;
  font-size: 14px;
  width: 100%;
}
textarea { font-family: Consolas, "Courier New", monospace; font-size: 13px; resize: vertical; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.two { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.secret { background: #062015; border: 1px solid #115e59; color: var(--accent); padding: 14px; border-radius: 10px; word-break: break-all; margin: 12px 0; }
.secret p { color: #c7f9e2; margin: 0 0 8px; }
.secret textarea { background: #04170f; color: var(--accent); border-color: #115e59; margin-bottom: 8px; }
.error { color: var(--danger); }
.ok { color: var(--accent); }
.bad { color: var(--danger); }
.strong { font-weight: 700; }
.warn { color: var(--warn); }
.doc { white-space: pre-wrap; color: var(--text); }
.empty-row { padding: 14px 4px; margin: 0; }
.loading { padding: 32px; }

/* Barra superior com navegação principal */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: #0e1626;
  position: sticky;
  top: 0;
  z-index: 5;
}
.topbar .brand { display: grid; }
.topbar .brand strong { font-size: 16px; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav button { background: transparent; color: var(--muted); border: 1px solid transparent; padding: 8px 12px; font-weight: 600; }
.nav button:hover { color: var(--text); }
.nav button[aria-current="true"] { background: #172033; color: var(--text); border-color: var(--line); }
.notice { margin: 0; padding: 10px 24px; font-weight: 600; border-bottom: 1px solid var(--line); }
.notice.ok { background: #0b2a1d; color: var(--accent); }
.notice.bad { background: #2a1010; color: var(--danger); }
.notice[hidden] { display: none; }
.view { min-height: calc(100vh - 64px); }

/* Cartões de estatística */
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin: 16px 0; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; gap: 4px; }
.stat span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.stat strong { font-size: 26px; }
.stat small { color: var(--muted); font-size: 12px; }
.stat.mini { min-width: 220px; }
.stat.mini strong { font-size: 18px; }

/* Clientes: lista lateral + palco */
.desk { display: grid; grid-template-columns: 320px minmax(0, 1fr); min-height: calc(100vh - 64px); }
.side { padding: 20px 16px; border-right: 1px solid var(--line); background: #0e1626; }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.side-head h1 { margin: 0 0 10px; font-size: 20px; }
.search { margin-bottom: 10px; }
.stage { padding: 24px 28px 64px; min-width: 0; }
.stage h2 { font-size: 26px; margin: 4px 0 8px; }
.stage-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.stack { display: grid; gap: 10px; margin-top: 12px; }
.client { display: grid; gap: 4px; width: 100%; text-align: left; margin: 0 0 6px; padding: 10px 12px; border-radius: 10px; background: transparent; color: var(--text); border: 1px solid transparent; font-weight: 400; }
.client strong { color: var(--text); }
.client span { color: var(--muted); font-size: 12px; }
.client:hover { background: #121b2d; }
.client[aria-current="true"] { background: #172033; border-color: #2dd4bf; }
.badge { display: inline-flex; width: fit-content; border-radius: 999px; padding: 3px 9px; border: 1px solid var(--line); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.badge.ok { color: #5eead4; border-color: #115e59; }
.badge.wait { color: var(--warn); border-color: #78350f; }
.badge.bad { color: var(--danger); border-color: #7f1d1d; }
.meta { color: var(--muted); margin: 0 0 8px; font-size: 14px; }
.next { margin: 12px 0 0; padding: 10px 12px; border-left: 3px solid var(--accent); background: #0f1a2a; color: var(--text); border-radius: 0 8px 8px 0; }
.actions { margin: 14px 0 8px; }
.spread { justify-content: space-between; align-items: flex-start; }
.subtabs { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 16px; border-bottom: 1px solid var(--line); }
.subtabs button { background: transparent; color: var(--muted); border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 10px 12px; font-weight: 600; }
.subtabs button[aria-current="true"] { color: var(--text); border-bottom-color: var(--accent); }
.keyline { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.keyline:last-child { border-bottom: 0; }
.keyline .meta { display: block; margin: 2px 0 0; font-size: 13px; }
.empty { padding: 48px 8px; }
details summary { cursor: pointer; font-weight: 700; }

/* Filtros, grupos de chaves, confirmação inline e acesso do cliente */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 10px; }
.chips button { background: transparent; color: var(--muted); border: 1px solid var(--line); padding: 5px 9px; font-size: 12px; font-weight: 600; border-radius: 999px; }
.chips button small { color: var(--muted); font-weight: 400; }
.chips button[aria-current="true"] { background: #172033; color: var(--text); border-color: #2dd4bf; }
.keygroup { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.keygroup h4 { margin: 0 0 4px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.keyline .reveal:not(:empty) { margin-top: 8px; display: grid; gap: 6px; max-width: 720px; }
.keyline .reveal textarea { background: #04170f; color: var(--accent); border-color: #115e59; }
button.armed { background: var(--danger); color: #2a0a0a; border-color: var(--danger); }
.access { border-color: #1f4d3a; }
.access-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-top: 8px; }
.access .label { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }

/* Teste de chave e blocos de código */
.tester #t-out { margin-top: 12px; }
.response, .code pre { background: #070d18; border: 1px solid var(--line); border-radius: 8px; padding: 12px; overflow-x: auto; font-family: Consolas, "Courier New", monospace; font-size: 12.5px; line-height: 1.5; color: #d7e0f4; margin: 0; white-space: pre; }
.code { margin-top: 12px; }
.code-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; color: var(--text); font-weight: 600; font-size: 14px; }
/* Carteira, Pix manual e detalhe da cobrança (QR + copia e cola) */
.wallet .stats { margin: 12px 0 0; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.wallet .stat { padding: 10px 12px; }
.wallet .stat strong { font-size: 20px; }
.wallet.live { border-color: #115e59; }
.wallet.test { border-color: #3b4a6b; }
.charge-detail { border-color: #2dd4bf; }
.pix-grid { display: grid; gap: 16px; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); margin-top: 12px; }
.pix-grid .qr { display: grid; justify-items: center; gap: 6px; background: #fff; border-radius: 12px; padding: 12px; color: #0b1220; align-content: start; }
.pix-grid .qr img { width: 100%; max-width: 240px; height: auto; image-rendering: pixelated; }
.pix-grid .qr strong { font-size: 20px; }
.pix-grid .qr small { color: #4b5563; }
.pix-grid .copy textarea { font-family: Consolas, "Courier New", monospace; font-size: 12px; word-break: break-all; }
.pix-grid .copy .row { margin: 8px 0; }
.manual-pix .row { margin-top: 12px; }
.payout-stats { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.payout-form { align-items: end; }
.payout-submit { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.payout-automation { border-color: #78350f; }
.payout-actions { min-width: 220px; }
.table-sub { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
/* Painel "Receber Pix" (/pix e /painelapiteste) */
.pix-app { min-height: 100vh; background: var(--bg); }
.pix-top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: #0e1626;
}
.pix-top .console-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--accent); }
.pix-top .console-brand svg { width: 30px; height: 30px; }
.pix-top .console-brand strong { color: var(--text); font-size: 15px; }
.pix-top .console-brand strong span { color: var(--accent); }
.pix-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-top: 8px; }
.pix-hero h1 { margin: 4px 0 6px; }
.pix-hero-stats { display: flex; flex-wrap: wrap; gap: 10px; }
.pix-hero-stats .stat { min-width: 150px; padding: 10px 12px; }
.pix-hero-stats .stat strong { font-size: 20px; }
.checkline { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.checkline input { width: auto; min-height: 0; }
@media (max-width: 720px) { .pix-grid { grid-template-columns: 1fr; } .pix-grid .qr { justify-self: center; width: 100%; max-width: 280px; } .pix-top { padding: 12px 16px; } .pix-hero-stats { width: 100%; } .pix-hero-stats .stat { flex: 1 1 140px; } }
/* Módulos RV Hub demonstrativos no portal */
.demo-banner { border-color: #78350f; }
.demo-form input:disabled,
.demo-form select:disabled { opacity: 0.6; cursor: not-allowed; }
.demo-submit { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.demo-submit button[disabled] { opacity: 0.6; cursor: not-allowed; }

.plans { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.plan label { margin-top: 10px; }
.plan button { margin-top: 12px; }

/* Cabeçalho e cards das páginas do site (/APIs e /GUFIAPI) que usam este CSS */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}
.top .brand { font-weight: 800; font-size: 18px; color: var(--text); text-decoration: none; }
.top .brand span { color: var(--accent); }
.top nav { display: flex; gap: 14px; flex-wrap: wrap; }
.top nav a { color: var(--muted); text-decoration: none; font-size: 14px; }
.top nav a:hover { color: var(--text); }
a.api-card { display: block; text-decoration: none; color: inherit; }
a.api-card strong { display: block; font-size: 20px; color: var(--text); margin: 4px 0 6px; }
a.api-card .eyebrow { display: block; }
a.api-card .button { display: inline-block; margin-top: 12px; }

@media (max-width: 900px) {
  .desk { grid-template-columns: 1fr; }
  .side { border-right: 0; border-bottom: 1px solid var(--line); }
  .stage { padding: 20px 16px 48px; }
  .topbar { position: static; }
  .wrap-wide { padding: 16px 16px 48px; }
}

.login-entry {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(24px, 6vw, 72px) 20px;
  background: radial-gradient(ellipse at 50% 38%, rgba(61, 214, 140, .09), transparent 48%);
}
.login-card {
  width: min(100%, 460px);
  padding: clamp(26px, 5vw, 40px);
  background: linear-gradient(145deg, #151f32, #101827 72%);
  border: 1px solid #2a3850;
  border-radius: 22px;
  box-shadow: 0 24px 72px rgba(0, 0, 0, .32);
}
.login-heading { display: grid; gap: 26px; margin-bottom: 30px; }
.login-heading .console-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--accent); }
.login-heading .console-brand svg { width: 38px; height: 38px; }
.login-heading .console-brand strong { color: var(--text); font-size: 17px; letter-spacing: .02em; }
.login-heading .console-brand strong span { color: var(--accent); }
.login-heading .eyebrow { margin: 0 0 8px; font-size: 11px; font-weight: 700; }
.login-heading h1 { margin: 0; font-size: clamp(28px, 5vw, 34px); letter-spacing: -.035em; }
.login-intro { margin: 10px 0 0; font-size: 14px; }
.login-form { display: grid; gap: 17px; }
.login-form label { gap: 8px; font-size: 13px; font-weight: 600; color: #bdc8dc; }
.login-form input { min-height: 48px; padding: 12px 14px; background: #0b1220; border-color: #34425a; }
.login-form input:focus { outline: 2px solid rgba(61, 214, 140, .28); border-color: var(--accent); }
.login-form .error { min-height: 0; margin: -4px 0 0; font-size: 13px; }
.login-form .error:empty { display: none; }
.login-form button { width: fit-content; min-width: 140px; min-height: 44px; justify-content: center; margin-top: 2px; padding: 11px 20px; }
.login-form button:hover:not(:disabled) { background: #54e3a0; }
@media (max-width: 480px) {
  .login-entry { padding: 20px 14px; }
  .login-card { border-radius: 18px; }
}

.workspace {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  background: var(--bg);
}
.workspace-sidebar {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  padding: 16px 14px;
  background: #0e1626;
  border-right: 1px solid var(--line);
}
.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 2px 20px;
}
.workspace-sidebar .console-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--accent);
}
.workspace-sidebar .console-brand svg { display: block; width: 36px; height: 36px; flex: 0 0 36px; }
.workspace-sidebar .console-brand strong { color: var(--text); font-size: 15px; white-space: nowrap; }
.workspace-sidebar .console-brand strong span { color: var(--accent); }
.workspace-navigation {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
}
.workspace-nav {
  display: grid;
  flex: 1;
  align-content: start;
  gap: 18px;
}
.workspace-nav .nav-group { display: grid; align-content: start; gap: 4px; }
.workspace-nav .nav-group h2 {
  margin: 0 0 4px;
  padding: 0 10px;
  color: #77849b;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.workspace-nav .nav-group > button,
.workspace-nav .nav-group > a {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  text-decoration: none;
}
.workspace-nav .nav-group > button svg,
.workspace-nav .nav-group > a svg { display: block; width: 19px; height: 19px; flex: 0 0 19px; }
.workspace-nav .nav-group > button:hover,
.workspace-nav .nav-group > a:hover { background: #141f31; color: var(--text); }
.workspace-nav .nav-group > button[aria-current="true"] {
  border-color: #254638;
  background: #14271f;
  color: var(--accent);
}
.workspace-main { min-width: 0; min-height: 100vh; background: var(--bg); }
.workspace svg { display: block; width: 20px; height: 20px; flex: 0 0 auto; }
.workspace-context {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  padding: 12px 28px;
  border-bottom: 1px solid var(--line);
  background: #0e1626;
  color: var(--muted);
  font-size: 13px;
}
.workspace-context span:last-child { color: var(--text); font-weight: 600; }
.workspace-main .notice { padding: 10px 28px; }
.workspace .view { min-height: calc(100vh - 58px); }
.menu-toggle { display: none; }
.menu-logout {
  justify-content: flex-start;
  width: 100%;
  min-height: 42px;
  margin-top: 12px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
}
.menu-logout svg { width: 18px; height: 18px; }
.menu-logout:hover { border-color: #4a3440; color: var(--danger); }
@media (max-width: 900px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .workspace-sidebar {
    position: sticky;
    top: 0;
    height: auto;
    padding: 10px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .sidebar-head { padding: 0; }
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 11px;
    border: 1px solid var(--line);
    background: #141f31;
    color: var(--text);
  }
  .menu-toggle svg { width: 18px; height: 18px; }
  .workspace-navigation { display: none; }
  .workspace-sidebar.menu-open .workspace-navigation {
    display: flex;
    max-height: calc(100vh - 62px);
    padding-top: 16px;
  }
  .workspace-nav { gap: 14px; }
  .workspace-context { position: static; padding: 12px 16px; }
  .workspace-main .notice { padding-right: 16px; padding-left: 16px; }
}
