/* =========================================================================
   Painel GTI API — sistema visual "Sinal"
   Usado por todas as páginas do layout (o base.php coloca body.gx por padrão)
   e pelas telas de acesso (_acesso_topo.php). Tudo fica dentro de body.gx /
   .gx-page; as regras genéricas do style.css antigo são neutralizadas abaixo.
   ========================================================================= */

body.gx {
    /* Cores: tinta azul-marinho (casa com o menu), papel quente, ciano da marca */
    --gx-canvas: #f5f4f0;
    --gx-surface: #ffffff;
    --gx-surface-2: #faf9f6;
    --gx-line: #e7e4dd;
    --gx-line-strong: #d4d0c6;
    --gx-ink: #171a26;
    --gx-ink-2: #474c5e;
    --gx-ink-3: #686d80;
    --gx-accent: #0e7490;
    --gx-accent-hover: #0b5f76;
    --gx-accent-soft: #e3f3f7;
    --gx-ok: #157a3b;
    --gx-ok-soft: #e6f5eb;
    --gx-ok-rail: #22a55a;
    --gx-warn: #a65208;
    --gx-warn-soft: #fcf1df;
    --gx-warn-rail: #eb9a1c;
    --gx-bad: #b4231f;
    --gx-bad-soft: #fcebea;
    --gx-bad-rail: #e5484d;

    /* Tipografia */
    --gx-font: 'Figtree', 'Segoe UI', sans-serif;
    --gx-font-display: 'Bricolage Grotesque', 'Figtree', 'Segoe UI', sans-serif;
    --gx-font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
    --gx-fs-xs: 12px;
    --gx-fs-sm: 13px;
    --gx-fs-base: 15px;
    --gx-fs-md: 16px;
    --gx-fs-xl: 24px;
    --gx-fs-2xl: 32px;

    /* Forma e profundidade */
    --gx-radius: 14px;
    --gx-radius-sm: 9px;
    --gx-shadow: 0 1px 2px rgba(23, 26, 38, .04), 0 8px 24px -14px rgba(23, 26, 38, .18);
    --gx-shadow-hover: 0 1px 2px rgba(23, 26, 38, .05), 0 14px 32px -16px rgba(23, 26, 38, .28);
    --gx-focus: 0 0 0 3px rgba(14, 116, 144, .25);

    background-color: var(--gx-canvas);
    color: var(--gx-ink);
    font-family: var(--gx-font);
    font-size: var(--gx-fs-base);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Área de conteúdo ao lado do menu (sidebar.css define --sb-width) ----------
   Substitui as regras antigas de .content do style.css (margem fixa de 250px). */
body.gx .content {
    flex: 1;
    min-width: 0;
    width: auto;
    max-width: none;
    margin-left: var(--sb-width, 236px);
    padding: 32px 40px 48px;
    min-height: 100vh;
}

@media (max-width: 900px) {
    /* Menu vira gaveta: o conteúdo usa a largura toda, abaixo do botão ☰ */
    body.gx .content {
        margin-left: 0;
        width: 100%;
        padding: 72px 16px 32px;
    }
}

/* ---------- Neutraliza os estilos genéricos do style.css dentro da página ---------- */
.gx-page h1::after,
.gx-page h2::after {
    content: none;
}

.gx-page h1,
.gx-page h2,
.gx-page h3 {
    margin: 0;
    color: var(--gx-ink);
}

.gx-page form,
.gx-page form:hover {
    background: none;
    padding: 0;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    transform: none;
}

/* style.css aplica margens em "form label" e "form input" */
.gx-page form label,
.gx-page form input,
.gx-page form select {
    margin: 0;
}

.gx-page button {
    background: none;
    border: 0;
    padding: 0;
    color: inherit;
    font: inherit;
    letter-spacing: normal;
    border-radius: 0;
    cursor: pointer;
    transition: none;
}

.gx-page button:hover,
.gx-page button:active {
    background: none;
    transform: none;
    box-shadow: none;
}

.gx-page a {
    color: inherit;
}

/* ---------- Layout ---------- */
.gx-page {
    max-width: 1240px;
    margin: 0 auto;
    padding: 8px 8px 64px;
}

.gx-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.gx-eyebrow {
    display: block;
    font-size: var(--gx-fs-xs);
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--gx-ink-3);
    margin-bottom: 6px;
}

.gx-eyebrow a {
    text-decoration: none;
    color: var(--gx-accent);
}

.gx-eyebrow a:hover {
    text-decoration: underline;
}

.gx-title {
    font-family: var(--gx-font-display);
    font-size: var(--gx-fs-xl);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -.01em;
}

.gx-subtitle {
    margin-top: 4px;
    color: var(--gx-ink-3);
    font-size: var(--gx-fs-sm);
}

.gx-header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.gx-card {
    background: var(--gx-surface);
    border: 1px solid var(--gx-line);
    border-radius: var(--gx-radius);
    box-shadow: var(--gx-shadow);
}

.gx-card-pad {
    padding: 24px;
}

.gx-page .gx-card-title {
    font-family: var(--gx-font-display);
    font-size: var(--gx-fs-md);
    font-weight: 600;
    margin-bottom: 4px;
}

.gx-card-hint {
    color: var(--gx-ink-3);
    font-size: var(--gx-fs-sm);
    margin-bottom: 20px;
}

.gx-mono {
    font-family: var(--gx-font-mono);
    font-size: .92em;
    letter-spacing: -.01em;
}

/* Texto só para leitores de tela */
.gx-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------- Botões ---------- */
.gx-page .gx-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 16px;
    border-radius: var(--gx-radius-sm);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.gx-page .gx-btn:focus-visible {
    outline: none;
    box-shadow: var(--gx-focus);
}

.gx-page .gx-btn[disabled] {
    opacity: .6;
    cursor: not-allowed;
}

.gx-page .gx-btn--primary {
    background: var(--gx-ink);
    color: #fff;
}

.gx-page .gx-btn--primary:hover {
    background: #2a2f44;
}

.gx-page .gx-btn--accent {
    background: var(--gx-accent);
    color: #fff;
}

.gx-page .gx-btn--accent:hover {
    background: var(--gx-accent-hover);
}

.gx-page .gx-btn--ghost {
    background: var(--gx-surface);
    color: var(--gx-ink);
    border: 1px solid var(--gx-line-strong);
}

.gx-page .gx-btn--ghost:hover {
    background: var(--gx-surface-2);
    border-color: var(--gx-ink-3);
}

.gx-page .gx-btn--danger {
    background: var(--gx-surface);
    color: var(--gx-bad);
    border: 1px solid #f1c4c2;
}

.gx-page .gx-btn--danger:hover {
    background: var(--gx-bad-soft);
    border-color: var(--gx-bad-rail);
}

.gx-page .gx-btn--sm {
    height: 32px;
    padding: 0 12px;
    font-size: var(--gx-fs-sm);
}

.gx-page .gx-btn--block {
    width: 100%;
}

.gx-page .gx-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    color: var(--gx-ink-3);
    transition: background-color .15s ease, color .15s ease;
}

.gx-page .gx-icon-btn:hover {
    background: var(--gx-canvas);
    color: var(--gx-ink);
}

.gx-page .gx-icon-btn:focus-visible {
    outline: none;
    box-shadow: var(--gx-focus);
}

/* ---------- Status ---------- */
.gx-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: var(--gx-fs-xs);
    font-weight: 600;
    white-space: nowrap;
}

.gx-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.gx-status--connected {
    background: var(--gx-ok-soft);
    color: var(--gx-ok);
}

.gx-status--connecting {
    background: var(--gx-warn-soft);
    color: var(--gx-warn);
}

.gx-status--disconnected {
    background: var(--gx-bad-soft);
    color: var(--gx-bad);
}

/* O ponto "ao vivo" só pulsa quando a instância está conectada */
.gx-status--connected .gx-dot {
    box-shadow: 0 0 0 0 rgba(34, 165, 90, .5);
    animation: gx-pulse 2.4s ease-out infinite;
}

@keyframes gx-pulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 165, 90, .45); }
    70% { box-shadow: 0 0 0 7px rgba(34, 165, 90, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 165, 90, 0); }
}

.gx-tag {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.gx-tag--paid {
    background: var(--gx-ok-soft);
    color: var(--gx-ok);
}

.gx-tag--pending {
    background: var(--gx-bad-soft);
    color: var(--gx-bad);
}

/* ---------- Faixa de status do dashboard ---------- */
.gx-signal {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 32px;
    align-items: center;
    padding: 24px 28px;
    margin-bottom: 32px;
}

.gx-signal-headline {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 14px;
}

.gx-signal-number {
    font-family: var(--gx-font-display);
    font-size: var(--gx-fs-2xl);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -.02em;
}

.gx-signal-caption {
    color: var(--gx-ink-2);
    font-size: var(--gx-fs-sm);
}

.gx-signal-bar {
    display: flex;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--gx-canvas);
    gap: 2px;
}

.gx-signal-bar span {
    display: block;
    height: 100%;
    min-width: 0;
    transform-origin: left;
    animation: gx-grow .7s cubic-bezier(.2, .8, .2, 1) both;
}

.gx-signal-bar .is-connected { background: var(--gx-ok-rail); }
.gx-signal-bar .is-connecting { background: var(--gx-warn-rail); }
.gx-signal-bar .is-disconnected { background: var(--gx-bad-rail); }

@keyframes gx-grow {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

.gx-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
    margin-top: 12px;
    font-size: var(--gx-fs-sm);
    color: var(--gx-ink-2);
}

.gx-legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.gx-legend b {
    color: var(--gx-ink);
    font-weight: 600;
}

.gx-legend .gx-dot.is-connected { color: var(--gx-ok-rail); }
.gx-legend .gx-dot.is-connecting { color: var(--gx-warn-rail); }
.gx-legend .gx-dot.is-disconnected { color: var(--gx-bad-rail); }

.gx-quota {
    min-width: 200px;
    padding-left: 32px;
    border-left: 1px solid var(--gx-line);
}

.gx-quota-value {
    font-family: var(--gx-font-display);
    font-size: var(--gx-fs-xl);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 10px;
}

.gx-quota-value small {
    font-family: var(--gx-font);
    font-size: var(--gx-fs-sm);
    font-weight: 500;
    color: var(--gx-ink-3);
}

.gx-meter {
    height: 6px;
    border-radius: 999px;
    background: var(--gx-canvas);
    overflow: hidden;
}

.gx-meter span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--gx-ink);
}

.gx-meter.is-high span { background: var(--gx-warn-rail); }
.gx-meter.is-full span { background: var(--gx-bad-rail); }

/* ---------- Barra de busca e filtro ---------- */
.gx-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.gx-section-title {
    font-family: var(--gx-font-display);
    font-size: 18px;
    font-weight: 600;
}

.gx-section-title small {
    font-family: var(--gx-font);
    font-size: var(--gx-fs-sm);
    font-weight: 500;
    color: var(--gx-ink-3);
    margin-left: 6px;
}

.gx-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.gx-search {
    position: relative;
}

.gx-search svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gx-ink-3);
    pointer-events: none;
}

/* ---------- Grade de instâncias ---------- */
.gx-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 16px;
}

.gx-instance {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: box-shadow .2s ease, border-color .2s ease, transform .2s ease;
    animation: gx-rise .45s cubic-bezier(.2, .8, .2, 1) both;
    animation-delay: calc(var(--i, 0) * 35ms);
}

/* Faixa de sinal: a cor do status na borda esquerda do cartão */
.gx-instance::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--gx-line-strong);
}

.gx-instance[data-status="connected"]::before { background: var(--gx-ok-rail); }
.gx-instance[data-status="connecting"]::before { background: var(--gx-warn-rail); }
.gx-instance[data-status="disconnected"]::before { background: var(--gx-bad-rail); }

.gx-instance:hover {
    border-color: var(--gx-line-strong);
    box-shadow: var(--gx-shadow-hover);
    transform: translateY(-2px);
}

.gx-instance-body {
    padding: 18px 20px 16px 24px;
    flex: 1;
}

.gx-instance-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 14px;
}

.gx-instance-code {
    font-family: var(--gx-font-mono);
    font-size: var(--gx-fs-xs);
    color: var(--gx-ink-3);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gx-page .gx-instance-name {
    font-family: var(--gx-font-display);
    font-size: var(--gx-fs-md);
    font-weight: 600;
    line-height: 1.3;
    min-height: 2.6em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
    margin-bottom: 14px;
}

.gx-facts {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 14px;
    font-size: var(--gx-fs-sm);
    margin: 0;
}

.gx-facts dt {
    color: var(--gx-ink-3);
}

.gx-facts dd {
    margin: 0;
    text-align: right;
    color: var(--gx-ink);
    font-weight: 500;
}

.gx-facts .gx-pay {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.gx-page .gx-pay-link {
    font-size: var(--gx-fs-xs);
    font-weight: 600;
    color: var(--gx-accent);
    text-decoration: none;
}

.gx-page .gx-pay-link:hover {
    text-decoration: underline;
}

.gx-instance-foot {
    border-top: 1px solid var(--gx-line);
}

.gx-instance-foot a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px 12px 24px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    color: var(--gx-ink);
    transition: background-color .15s ease, color .15s ease;
}

.gx-instance-foot a:hover {
    background: var(--gx-surface-2);
    color: var(--gx-accent);
}

.gx-instance-foot a svg {
    transition: transform .2s ease;
}

.gx-instance-foot a:hover svg {
    transform: translateX(3px);
}

.gx-no-results {
    display: none;
    padding: 40px;
    text-align: center;
    color: var(--gx-ink-3);
}

.gx-empty {
    text-align: center;
    padding: 64px 24px;
}

.gx-empty-icon {
    display: inline-flex;
    width: 56px;
    height: 56px;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: var(--gx-accent-soft);
    color: var(--gx-accent);
    margin-bottom: 16px;
}

.gx-empty p {
    color: var(--gx-ink-3);
    margin: 6px 0 20px;
}

@keyframes gx-rise {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- Formulários ---------- */
.gx-form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 24px;
    align-items: start;
}

.gx-form-stack {
    display: grid;
    gap: 16px;
}

.gx-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 20px;
}

.gx-field--full {
    grid-column: 1 / -1;
}

.gx-page .gx-field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 6px;
    color: var(--gx-ink);
}

.gx-field label .gx-optional {
    font-weight: 500;
    color: var(--gx-ink-3);
    font-size: var(--gx-fs-xs);
    margin-left: 4px;
}

.gx-field small {
    display: block;
    margin-top: 6px;
    font-size: var(--gx-fs-xs);
    line-height: 1.45;
    color: var(--gx-ink-3);
}

.gx-page .gx-input,
.gx-page .gx-field input[type="text"],
.gx-page .gx-field input[type="tel"],
.gx-page .gx-field select,
.gx-page .gx-search input,
.gx-page .gx-select {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--gx-line-strong);
    border-radius: var(--gx-radius-sm);
    background: var(--gx-surface);
    color: var(--gx-ink);
    font: inherit;
    font-size: 14px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.gx-page .gx-select {
    width: auto;
    min-width: 170px;
    cursor: pointer;
}

/* Depois da regra genérica de campos, para o recuo do ícone de busca prevalecer */
.gx-page .gx-search input {
    width: 280px;
    padding-left: 38px;
}

.gx-page .gx-input::placeholder,
.gx-page .gx-field input::placeholder,
.gx-page .gx-search input::placeholder {
    color: #9a9eac;
}

.gx-page .gx-input:focus,
.gx-page .gx-field input:focus,
.gx-page .gx-field select:focus,
.gx-page .gx-search input:focus,
.gx-page .gx-select:focus {
    outline: none;
    border-color: var(--gx-accent);
    box-shadow: var(--gx-focus);
}

.gx-page .gx-field input.error {
    border-color: var(--gx-bad-rail);
}

.gx-page .gx-field input.gx-mono-input {
    font-family: var(--gx-font-mono);
    font-size: 13.5px;
}

.gx-field .error-text {
    margin-top: 6px;
    font-size: var(--gx-fs-xs);
    font-weight: 500;
    color: var(--gx-bad);
}

.gx-field .error-text:empty {
    display: none;
}

/* Interruptores (checkbox real, acessível, com aparência de chave) */
.gx-switches {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 24px;
}

.gx-switch {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 0;
    border-top: 1px solid var(--gx-line);
    cursor: pointer;
}

.gx-switches .gx-switch:nth-child(-n+2) {
    border-top: 0;
}

.gx-switch input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.gx-switch-track {
    position: relative;
    flex-shrink: 0;
    width: 38px;
    height: 22px;
    margin-top: 1px;
    border-radius: 999px;
    background: var(--gx-line-strong);
    transition: background-color .2s ease;
}

.gx-switch-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(23, 26, 38, .25);
    transition: transform .2s cubic-bezier(.2, .8, .2, 1);
}

.gx-switch input:checked + .gx-switch-track {
    background: var(--gx-accent);
}

.gx-switch input:checked + .gx-switch-track::after {
    transform: translateX(16px);
}

.gx-switch input:focus-visible + .gx-switch-track {
    box-shadow: var(--gx-focus);
}

.gx-switch-text strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
}

.gx-switch-text small {
    display: block;
    font-size: var(--gx-fs-xs);
    color: var(--gx-ink-3);
    margin-top: 2px;
}

/* Pares nome/valor (cabeçalhos do webhook) */
.gx-kv {
    display: grid;
    gap: 8px;
}

.gx-kv-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto;
    gap: 8px;
    align-items: center;
}

.gx-page .gx-kv-row .gx-input {
    height: 38px;
    font-size: 13px;
}

/* Lista de caixas de seleção (eventos do webhook) */
.gx-checks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.gx-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--gx-line);
    border-radius: var(--gx-radius-sm);
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
}

.gx-check:hover {
    border-color: var(--gx-line-strong);
}

.gx-check:has(input:checked) {
    border-color: var(--gx-accent);
    background: var(--gx-accent-soft);
}

.gx-page .gx-check input {
    width: 16px;
    height: 16px;
    margin: 2px 0 0;
    accent-color: var(--gx-accent);
    flex-shrink: 0;
}

.gx-check strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
}

.gx-check small {
    display: block;
    font-size: 11px;
    color: var(--gx-ink-3);
}

/* Bloco esmaecido enquanto a opção principal está desligada (ex.: Chatwoot, webhook) */
.gx-disabled-block {
    opacity: .45;
    pointer-events: none;
    transition: opacity .2s ease;
}

.gx-switch-extra {
    grid-column: 1 / -1;
    padding: 4px 0 14px 52px;
}

.gx-form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 4px;
}

.gx-aside {
    position: sticky;
    top: 24px;
    display: grid;
    gap: 16px;
}

.gx-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: gx-step;
    display: grid;
    gap: 12px;
}

/* Número no ::before posicionado; o texto do <li> fica num único fluxo (com <b> no meio) */
.gx-steps li {
    counter-increment: gx-step;
    position: relative;
    min-height: 24px;
    padding: 2px 0 0 34px;
    font-size: var(--gx-fs-sm);
    color: var(--gx-ink-2);
}

.gx-steps li::before {
    content: counter(gx-step);
    position: absolute;
    left: 0;
    top: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--gx-canvas);
    border: 1px solid var(--gx-line);
    font-family: var(--gx-font-mono);
    font-size: var(--gx-fs-xs);
    font-weight: 500;
    color: var(--gx-ink);
}

/* ---------- Tela da instância ---------- */
.gx-instance-header .gx-title {
    overflow-wrap: anywhere;
}

.gx-header-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.gx-chip {
    display: inline-flex;
    align-items: center;
    height: 26px;
    padding: 0 10px;
    border-radius: 7px;
    background: var(--gx-surface);
    border: 1px solid var(--gx-line);
    font-family: var(--gx-font-mono);
    font-size: var(--gx-fs-xs);
    color: var(--gx-ink-2);
}

.gx-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.gx-page .gx-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--gx-surface);
    border: 1px solid var(--gx-line);
    font-size: var(--gx-fs-sm);
    font-weight: 600;
    text-decoration: none;
    color: var(--gx-ink-2);
    transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}

.gx-page .gx-tab:hover {
    border-color: var(--gx-accent);
    color: var(--gx-accent);
    background: var(--gx-accent-soft);
}

.gx-page .gx-tab.is-active,
.gx-page .gx-tab.is-active:hover {
    background: var(--gx-ink);
    border-color: var(--gx-ink);
    color: #fff;
}

.gx-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.gx-rows {
    margin: 0;
}

.gx-row {
    padding: 14px 0;
    border-top: 1px solid var(--gx-line);
}

.gx-row:first-child {
    border-top: 0;
    padding-top: 0;
}

.gx-row:last-child {
    padding-bottom: 0;
}

.gx-row dt {
    font-size: var(--gx-fs-xs);
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--gx-ink-3);
    margin-bottom: 6px;
}

.gx-row dd {
    margin: 0;
    font-size: 14px;
}

.gx-row-hint {
    display: block;
    margin-top: 4px;
    font-size: var(--gx-fs-xs);
    color: var(--gx-ink-3);
}

/* Linha editável: valor + lápis; ao editar vira campo + salvar/cancelar */
.gx-editable {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
}

.gx-editable .value {
    font-weight: 500;
    overflow-wrap: anywhere;
}

.gx-editable .value.is-empty {
    color: var(--gx-ink-3);
    font-weight: 400;
    font-style: italic;
}

.gx-edit {
    display: flex;
    align-items: center;
    gap: 6px;
}

.gx-page .gx-edit input {
    flex: 1;
    min-width: 0;
    height: 36px;
}

.gx-page .gx-edit .btn-save,
.gx-page .gx-edit .btn-cancel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: var(--gx-radius-sm);
    border: 1px solid var(--gx-line-strong);
    background: var(--gx-surface);
}

.gx-page .gx-edit .btn-save {
    background: var(--gx-ink);
    border-color: var(--gx-ink);
    color: #fff;
}

.gx-page .gx-edit .btn-save:hover {
    background: #2a2f44;
}

.gx-page .gx-edit .btn-cancel:hover {
    background: var(--gx-canvas);
}

.gx-secret {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 4px 0 12px;
    height: 38px;
    border: 1px solid var(--gx-line);
    border-radius: var(--gx-radius-sm);
    background: var(--gx-surface-2);
}

.gx-page .gx-secret input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: none;
    font-family: var(--gx-font-mono);
    font-size: 13px;
    color: var(--gx-ink);
    outline: none;
}

.gx-copyline {
    display: flex;
    align-items: center;
    gap: 6px;
}

.gx-copyline .gx-mono {
    overflow-wrap: anywhere;
    font-size: 13px;
}

/* Conexão: conectada */
.gx-connected {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 18px;
    align-items: start;
}

.gx-connected-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--gx-ok-soft);
    color: var(--gx-ok);
}

.gx-connected h2 {
    font-family: var(--gx-font-display);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.gx-connected p {
    color: var(--gx-ink-2);
    font-size: 14px;
    margin-bottom: 18px;
}

/* Conexão: QR Code. As classes abaixo também são geradas pelo JS da página */
.gx-qr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 28px;
    align-items: start;
}

.gx-qr h2 {
    font-family: var(--gx-font-display);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 14px;
}

.gx-qr-box {
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    border: 1px dashed var(--gx-line-strong);
    border-radius: var(--gx-radius);
    background: var(--gx-surface-2);
    text-align: center;
}

.gx-qr-box .qrcode-area {
    width: 100%;
}

.gx-qr-box .qrcode-wrapper img {
    display: block;
    width: 100%;
    max-width: 240px;
    height: auto;
    margin: 0 auto;
    border-radius: 10px;
    background: #fff;
    padding: 8px;
    border: 1px solid var(--gx-line);
}

.gx-qr-box .instructions {
    margin-top: 10px;
    font-size: var(--gx-fs-xs);
    color: var(--gx-ink-3);
}

.gx-qr-box .info-message,
.gx-qr-box .error-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 8px;
    font-size: var(--gx-fs-sm);
    line-height: 1.5;
}

.gx-qr-box .info-message {
    color: var(--gx-ink-2);
}

.gx-qr-box .info-message svg {
    color: var(--gx-accent);
}

.gx-qr-box .error-message {
    color: var(--gx-bad);
}

.gx-qr-box .info-message p,
.gx-qr-box .error-message p {
    margin: 0;
}

.gx-page .refresh-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 18px;
    border-radius: var(--gx-radius-sm);
    background: var(--gx-ink);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    margin-top: 4px;
}

.gx-page .refresh-button:hover {
    background: #2a2f44;
}

.gx-page .refresh-button[disabled] {
    opacity: .7;
    cursor: wait;
}

.gx-danger-zone {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--gx-line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.gx-danger-zone p {
    font-size: var(--gx-fs-sm);
    color: var(--gx-ink-3);
    margin: 0;
}

/* ---------- Avisos ---------- */
/* Avisos do base.php (flash) ficam fora da .gx-page: alinha com a largura dela */
.gx .content > .alert {
    width: calc(100% - 16px);
    max-width: 1224px;
    margin-left: auto;
    margin-right: auto;
}

.gx-page .alert,
.gx .content > .alert {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    border-radius: var(--gx-radius-sm);
    border: 1px solid transparent;
    margin-bottom: 20px;
    font-size: 14px;
}

.gx-page .alert svg,
.gx .content > .alert svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.gx-page .alert h4,
.gx .content > .alert h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 2px;
}

.gx-page .alert p,
.gx .content > .alert p {
    margin: 0;
}

.gx-page .alert-error,
.gx .content > .alert-error {
    background: var(--gx-bad-soft);
    border-color: #f3cfcd;
    color: var(--gx-bad);
}

.gx-page .alert-success,
.gx .content > .alert-success {
    background: var(--gx-ok-soft);
    border-color: #c8e8d3;
    color: var(--gx-ok);
}

.gx-page .alert-warning,
.gx .content > .alert-warning {
    background: var(--gx-warn-soft);
    border-color: #f2dcb6;
    color: var(--gx-warn);
}

.gx-page .alert-info,
.gx .content > .alert-info {
    background: var(--gx-accent-soft);
    border-color: #c7e6ee;
    color: var(--gx-accent);
}

/* ---------- Carregando ---------- */
.gx-page .spinner {
    width: 16px;
    height: 16px;
    animation: gx-rotate 1s linear infinite;
}

.gx-page .spinner .path {
    stroke: currentColor;
    stroke-linecap: round;
    animation: gx-dash 1.4s ease-in-out infinite;
}

@keyframes gx-rotate {
    100% { transform: rotate(360deg); }
}

@keyframes gx-dash {
    0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; }
    50% { stroke-dasharray: 90, 150; stroke-dashoffset: -35; }
    100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; }
}

/* ---------- Tabelas ---------- */
.gx-table-card {
    padding: 0;
    overflow: hidden;
}

.gx-table-scroll {
    overflow-x: auto;
}

/* Neutraliza "table/th/td/tr:hover" do style.css */
.gx-page table.gx-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    border-spacing: 0;
    background: none;
    box-shadow: none;
    border-radius: 0;
    overflow: visible;
    font-size: 14px;
}

.gx-page .gx-table th {
    padding: 11px 16px;
    background: var(--gx-surface-2);
    border-bottom: 1px solid var(--gx-line);
    color: var(--gx-ink-3);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .07em;
    text-transform: uppercase;
    text-align: left;
    white-space: nowrap;
}

.gx-page .gx-table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--gx-line);
    color: var(--gx-ink);
    font-size: 14px;
    text-align: left;
    vertical-align: middle;
}

.gx-page .gx-table tr:hover {
    background: none;
}

/* Indicador de ordenação (painel.js, tabelas com data-gx-ordenavel) */
.gx-page .gx-table th[aria-sort="ascending"]::after {
    content: ' ↑';
    color: var(--gx-accent);
}

.gx-page .gx-table th[aria-sort="descending"]::after {
    content: ' ↓';
    color: var(--gx-accent);
}

.gx-page .gx-table tbody tr:hover td {
    background: var(--gx-surface-2);
}

.gx-page .gx-table tbody tr:last-child td {
    border-bottom: 0;
}

.gx-page .gx-table .is-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.gx-page .gx-table .is-actions {
    text-align: right;
    white-space: nowrap;
}

.gx-page .gx-table .is-nowrap {
    white-space: nowrap;
}

.gx-cell-title {
    font-weight: 600;
}

.gx-cell-sub {
    display: block;
    margin-top: 2px;
    font-size: var(--gx-fs-xs);
    color: var(--gx-ink-3);
}

.gx-table-empty {
    padding: 40px 24px;
    text-align: center;
    color: var(--gx-ink-3);
}

/* Linha de total no <tfoot> (fica fora da ordenação e da busca) */
.gx-page .gx-table tfoot td {
    border-top: 1px solid var(--gx-line-strong);
    border-bottom: 0;
    background: var(--gx-surface-2);
    font-weight: 700;
}

.gx-page .gx-table .gx-filter-empty td {
    padding: 28px;
    text-align: center;
    color: var(--gx-ink-3);
}

.gx-page .gx-link {
    color: var(--gx-accent);
    font-weight: 600;
    text-decoration: none;
}

.gx-page .gx-link:hover {
    text-decoration: underline;
}

.gx-tag--neutral {
    background: var(--gx-canvas);
    color: var(--gx-ink-2);
}

.gx-tag--warn {
    background: var(--gx-warn-soft);
    color: var(--gx-warn);
}

.gx-tag--info {
    background: var(--gx-accent-soft);
    color: var(--gx-accent);
}

/* Usuário com avatar de iniciais (tabelas de admin) */
.gx-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.gx-avatar {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--gx-accent-soft);
    color: var(--gx-accent);
    font-size: 12px;
    font-weight: 700;
}

/* Medidor + número lado a lado */
.gx-usage {
    display: flex;
    align-items: center;
    gap: 10px;
}

.gx-usage .gx-meter {
    width: 110px;
    flex-shrink: 0;
}

/* ---------- Números em destaque (admin, afiliados) ---------- */
.gx-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.gx-stat {
    padding: 18px 20px;
}

.gx-stat-label {
    display: block;
    font-size: var(--gx-fs-xs);
    font-weight: 600;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--gx-ink-3);
    margin-bottom: 8px;
}

.gx-stat-value {
    font-family: var(--gx-font-display);
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -.02em;
}

.gx-stat-value.is-ok { color: var(--gx-ok); }
.gx-stat-value.is-warn { color: var(--gx-warn); }
.gx-stat-value.is-bad { color: var(--gx-bad); }

.gx-stat-hint {
    display: block;
    margin-top: 6px;
    font-size: var(--gx-fs-xs);
    color: var(--gx-ink-3);
}

/* Campo somente leitura com botão "Copiar" ao lado (link de afiliado) */
.gx-copy-field {
    display: flex;
    gap: 10px;
}

.gx-page .gx-copy-field .gx-input {
    flex: 1;
    min-width: 0;
    font-family: var(--gx-font-mono);
    font-size: 13.5px;
    background: var(--gx-surface-2);
}

@media (max-width: 640px) {
    .gx-copy-field {
        flex-direction: column;
    }

    /* Em coluna, o flex: 1 zeraria a altura do campo */
    .gx-page .gx-copy-field .gx-input {
        flex: none;
    }
}

/* Atalhos em forma de cartão (painel admin) */
.gx-shortcuts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 28px;
}

.gx-page .gx-shortcut {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    text-decoration: none;
    color: var(--gx-ink);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.gx-page .gx-shortcut:hover {
    border-color: var(--gx-accent);
    box-shadow: var(--gx-shadow-hover);
}

.gx-shortcut-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--gx-accent-soft);
    color: var(--gx-accent);
}

.gx-shortcut strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
}

.gx-shortcut small {
    display: block;
    font-size: var(--gx-fs-xs);
    color: var(--gx-ink-3);
}

/* ---------- Formulário simples em cartão ---------- */
.gx-form-card {
    max-width: 640px;
}

.gx-field + .gx-field {
    margin-top: 18px;
}

.gx-fields .gx-field + .gx-field {
    margin-top: 0;
}

.gx-page .gx-field textarea {
    width: 100%;
    min-height: 110px;
    padding: 10px 12px;
    border: 1px solid var(--gx-line-strong);
    border-radius: var(--gx-radius-sm);
    background: var(--gx-surface);
    color: var(--gx-ink);
    font: inherit;
    font-size: 14px;
    resize: vertical;
}

.gx-page .gx-field input[type="password"],
.gx-page .gx-field input[type="email"],
.gx-page .gx-field input[type="number"],
.gx-page .gx-field input[type="url"],
.gx-page .gx-field input[type="date"] {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--gx-line-strong);
    border-radius: var(--gx-radius-sm);
    background: var(--gx-surface);
    color: var(--gx-ink);
    font: inherit;
    font-size: 14px;
    margin: 0;
}

.gx-page .gx-field textarea:focus,
.gx-page .gx-field input[type="password"]:focus,
.gx-page .gx-field input[type="email"]:focus,
.gx-page .gx-field input[type="number"]:focus,
.gx-page .gx-field input[type="url"]:focus,
.gx-page .gx-field input[type="date"]:focus {
    outline: none;
    border-color: var(--gx-accent);
    box-shadow: var(--gx-focus);
}

/* Campo com botão dentro (ex.: mostrar senha) */
.gx-input-wrap {
    position: relative;
}

.gx-page .gx-input-wrap input {
    padding-right: 44px;
}

.gx-page .gx-input-wrap .gx-icon-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
}

.gx-form-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--gx-line);
}

/* Medidor de força de senha */
.gx-strength {
    display: flex;
    gap: 4px;
    margin-top: 8px;
}

.gx-strength span {
    flex: 1;
    height: 4px;
    border-radius: 999px;
    background: var(--gx-line);
    transition: background-color .2s ease;
}

/* Lista de requisitos */
.gx-checklist {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    display: grid;
    gap: 4px;
    font-size: var(--gx-fs-xs);
    color: var(--gx-ink-3);
}

.gx-checklist li {
    display: flex;
    align-items: center;
    gap: 6px;
}

.gx-checklist li::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gx-line-strong);
}

.gx-checklist li.is-ok {
    color: var(--gx-ok);
}

.gx-checklist li.is-ok::before {
    background: var(--gx-ok-rail);
}

/* ---------- Lista de tutoriais ---------- */
.gx-list {
    display: grid;
    gap: 12px;
}

.gx-list-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
}

.gx-list-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--gx-accent-soft);
    color: var(--gx-accent);
}

.gx-list-body {
    flex: 1;
    min-width: 0;
}

.gx-list-body strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
}

.gx-list-body p {
    margin: 2px 0 0;
    font-size: var(--gx-fs-sm);
    color: var(--gx-ink-3);
}

.gx-list-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* ---------- Telas de acesso (login, cadastro, recuperar senha) ---------- */
body.gx.gx-auth-body {
    display: block;
    min-height: 100vh;
    margin: 0;
}

/* As telas de acesso não carregam o style.css: traz o box-sizing que ele define */
body.gx-auth-body *,
body.gx-auth-body *::before,
body.gx-auth-body *::after {
    box-sizing: border-box;
}

.gx-auth {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.gx-auth-brand {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px;
    background: #161927;
    color: #fff;
}

/* Faixas de "sinal" decorativas, na mesma linguagem das instâncias */
.gx-auth-brand::after {
    content: '';
    position: absolute;
    right: -120px;
    bottom: -120px;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    border: 1px solid rgba(34, 195, 230, .18);
    box-shadow: 0 0 0 40px rgba(34, 195, 230, .05), 0 0 0 90px rgba(34, 195, 230, .03);
}

.gx-auth-brand img {
    height: 48px;
    width: auto;
    align-self: flex-start;
}

.gx-auth-brand h2 {
    font-family: var(--gx-font-display);
    font-size: 34px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -.02em;
    color: #fff;
    max-width: 420px;
    margin: 0 0 14px;
}

.gx-auth-brand p {
    max-width: 400px;
    color: rgba(255, 255, 255, .7);
    font-size: 15px;
    margin: 0;
}

.gx-auth-signal {
    display: flex;
    gap: 6px;
    margin-bottom: 28px;
}

.gx-auth-signal span {
    width: 34px;
    height: 6px;
    border-radius: 999px;
    background: #22a55a;
}

.gx-auth-signal span:nth-child(2) { background: #eb9a1c; width: 18px; }
.gx-auth-signal span:nth-child(3) { background: #22c3e6; width: 52px; }

.gx-auth-foot {
    position: relative;
    z-index: 1;
    font-size: var(--gx-fs-xs);
    color: rgba(255, 255, 255, .45);
}

.gx-auth-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
}

.gx-auth-card {
    width: 100%;
    max-width: 400px;
}

/* O cartão usa .gx-page só para herdar os estilos de campos e botões */
.gx-page.gx-auth-card {
    margin: 0;
    padding: 0;
}

.gx-auth-card .gx-title {
    font-size: 28px;
    margin-bottom: 6px;
}

.gx-auth-card .gx-subtitle {
    font-size: var(--gx-fs-base);
    margin-bottom: 28px;
}

.gx-page.gx-auth-card .gx-btn--block {
    height: 44px;
}

.gx-page.gx-auth-card form .gx-btn--block {
    margin-top: 24px;
}

/* Rótulo com link à direita (ex.: "Senha" + "Esqueceu a senha?") */
.gx-field-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.gx-page .gx-field-head label {
    margin: 0;
}

.gx-page .gx-field-head a,
.gx-page .gx-auth-alt a {
    color: var(--gx-accent);
    font-weight: 600;
    text-decoration: none;
}

.gx-page .gx-field-head a {
    font-size: var(--gx-fs-sm);
}

.gx-page .gx-field-head a:hover,
.gx-page .gx-auth-alt a:hover {
    text-decoration: underline;
}

.gx-auth-alt {
    margin-top: 24px;
    text-align: center;
    font-size: var(--gx-fs-sm);
    color: var(--gx-ink-3);
}

.gx-auth-captcha {
    min-height: 78px;
}

.gx-page .gx-auth-card .alert {
    margin-bottom: 20px;
}

@media (max-width: 900px) {
    /* Faixa da marca só com a altura do conteúdo; o formulário ocupa o resto */
    .gx-auth {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto 1fr;
    }

    .gx-auth-brand {
        padding: 24px 20px;
        gap: 18px;
    }

    .gx-auth-brand img {
        height: 38px;
    }

    .gx-auth-signal {
        margin-bottom: 16px;
    }

    .gx-auth-brand p {
        font-size: 14px;
    }

    .gx-auth-main {
        align-items: flex-start;
        padding: 32px 20px 40px;
    }

    .gx-auth-brand h2 {
        font-size: 24px;
    }

    .gx-auth-brand::after,
    .gx-auth-foot {
        display: none;
    }
}

/* ---------- Telas menores ---------- */
@media (max-width: 1100px) {
    .gx-form-layout,
    .gx-detail-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .gx-aside {
        position: static;
    }
}

@media (max-width: 820px) {
    .gx-signal {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
    }

    .gx-quota {
        border-left: 0;
        padding-left: 0;
        border-top: 1px solid var(--gx-line);
        padding-top: 18px;
    }

    .gx-qr {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 640px) {
    .gx-fields,
    .gx-switches {
        grid-template-columns: minmax(0, 1fr);
    }

    .gx-switches .gx-switch:nth-child(2) {
        border-top: 1px solid var(--gx-line);
    }

    .gx-page .gx-search input {
        width: 100%;
    }

    .gx-filters,
    .gx-search {
        width: 100%;
    }

    .gx-card-pad {
        padding: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gx-instance,
    .gx-signal-bar span,
    .gx-status--connected .gx-dot,
    .gx-switch-track::after {
        animation: none;
        transition: none;
    }
}
