/* =====================================================================
 * Enviame Hub — tema azul + modo escuro
 * Sobrescreve o tema base (Sneat) e define os componentes da plataforma.
 * O modo escuro é ativado por <html data-theme="dark">.
 * ===================================================================== */

:root {
    --hub-primary: #2563eb;
    --hub-primary-600: #1d4ed8;
    --hub-primary-rgb: 37, 99, 235;
    --hub-accent: #06b6d4;
    --hub-success: #16a34a;
    --hub-success-rgb: 22, 163, 74;
    --hub-warning: #f59e0b;
    --hub-danger: #ef4444;

    --hub-bg: #f3f6fb;
    --hub-surface: #ffffff;
    --hub-surface-2: #f8fafc;
    --hub-surface-3: #eef2f8;
    --hub-border: #e3e8f1;
    --hub-text: #3b4a63;
    --hub-heading: #0f1b33;
    --hub-muted: #6b7a93;
    --hub-shadow: 0 1px 2px rgba(15, 27, 51, .04), 0 8px 24px rgba(15, 27, 51, .06);
    --hub-shadow-lg: 0 20px 50px rgba(15, 27, 51, .12);

    --hub-code-bg: #0b1426;
    --hub-code-text: #dbe5f7;
    --hub-radius: .85rem;
    --hub-gradient: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
}

html[data-theme="dark"] {
    color-scheme: dark;
    --hub-bg: #0a1120;
    --hub-surface: #101a2e;
    --hub-surface-2: #0d1627;
    --hub-surface-3: #16223a;
    --hub-border: #1f2c46;
    --hub-text: #c3cee0;
    --hub-heading: #f1f5fb;
    --hub-muted: #8395b3;
    --hub-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --hub-shadow-lg: 0 20px 50px rgba(0, 0, 0, .45);
    --hub-code-bg: #070d19;
}

/* ---------------------------------------------------------------------
 * Base
 * ------------------------------------------------------------------- */
body {
    font-family: 'Inter', 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--hub-bg) !important;
    color: var(--hub-text);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { color: var(--hub-heading); letter-spacing: -.01em; }
.text-muted { color: var(--hub-muted) !important; }
.text-heading { color: var(--hub-heading) !important; }
a { color: var(--hub-primary); }
a:hover { color: var(--hub-primary-600); }
code, pre, .font-mono { font-family: 'JetBrains Mono', SFMono-Regular, Menlo, monospace; }

.card {
    background-color: var(--hub-surface);
    border: 1px solid var(--hub-border);
    border-radius: var(--hub-radius);
    box-shadow: var(--hub-shadow);
}
.card-header { background: transparent; border-bottom: 1px solid var(--hub-border); }
.card-footer { background: transparent; border-top: 1px solid var(--hub-border); }

.btn { border-radius: .6rem; font-weight: 600; }
.btn-primary { background: var(--hub-primary); border-color: var(--hub-primary); box-shadow: 0 1px 2px rgba(15, 27, 51, .12); }
.btn-primary:hover, .btn-primary:focus { background: var(--hub-primary-600) !important; border-color: var(--hub-primary-600) !important; }
.btn-soft-primary { background: rgba(var(--hub-primary-rgb), .1); color: var(--hub-primary); border: 0; }
.btn-soft-primary:hover { background: rgba(var(--hub-primary-rgb), .18); color: var(--hub-primary); }
.btn-soft-danger { background: rgba(239, 68, 68, .1); color: var(--hub-danger); border: 0; }
.btn-soft-danger:hover { background: rgba(239, 68, 68, .18); color: var(--hub-danger); }
.btn-soft-secondary { background: var(--hub-surface-3); color: var(--hub-text); border: 0; }
.btn-soft-secondary:hover { background: var(--hub-border); color: var(--hub-heading); }

.form-control, .form-select { border-radius: .6rem; }
.form-control:focus, .form-select:focus { border-color: var(--hub-primary); box-shadow: 0 0 0 .2rem rgba(var(--hub-primary-rgb), .15); }

.badge { font-weight: 600; letter-spacing: .01em; }

/* ---------------------------------------------------------------------
 * Layout: menu, navbar, marca
 * ------------------------------------------------------------------- */
.app-brand-text.demo { text-transform: none; font-size: 1.25rem; letter-spacing: -.02em; color: var(--hub-heading); }
.hub-logo {
    width: 36px; height: 36px; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--hub-gradient); color: #fff; font-size: 1.25rem;
    box-shadow: 0 1px 2px rgba(15, 27, 51, .12);
    flex-shrink: 0;
}

.bg-menu-theme { background-color: var(--hub-surface) !important; color: var(--hub-text); border-right: 1px solid var(--hub-border); }
.bg-menu-theme .menu-link, .bg-menu-theme .menu-horizontal-prev, .bg-menu-theme .menu-horizontal-next { color: var(--hub-text); }
.bg-menu-theme .menu-header { color: var(--hub-muted); }
.bg-menu-theme .menu-inner > .menu-item.active > .menu-link {
    background: rgba(var(--hub-primary-rgb), .1) !important;
    color: var(--hub-primary) !important;
}
.bg-menu-theme .menu-inner > .menu-item.active:before { background: var(--hub-primary); }
.bg-menu-theme .menu-item.disabled .menu-link { opacity: .55; cursor: default; }
.layout-menu { box-shadow: none !important; }

.bg-navbar-theme {
    background-color: rgba(255, 255, 255, .82) !important;
    backdrop-filter: saturate(180%) blur(10px);
    color: var(--hub-text);
    border: 1px solid var(--hub-border);
    box-shadow: var(--hub-shadow) !important;
}
html[data-theme="dark"] .bg-navbar-theme { background-color: rgba(16, 26, 46, .82) !important; }
.hub-navbar-greeting { color: var(--hub-muted); }
.hub-navbar-greeting strong { color: var(--hub-heading); }

.bg-footer-theme { background-color: transparent !important; color: var(--hub-muted); }

.hub-icon-btn {
    width: 38px; height: 38px; border-radius: 10px;
    border: 1px solid var(--hub-border); background: var(--hub-surface-2);
    color: var(--hub-text); display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.2rem; transition: all .15s ease;
}
.hub-icon-btn:hover { color: var(--hub-primary); border-color: rgba(var(--hub-primary-rgb), .4); }
.hub-theme-icon-light { display: none; }
html[data-theme="dark"] .hub-theme-icon-light { display: inline; }
html[data-theme="dark"] .hub-theme-icon-dark { display: none; }

.hub-avatar {
    width: 38px; height: 38px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--hub-gradient); color: #fff; font-weight: 700; font-size: .85rem;
}

/* ---------------------------------------------------------------------
 * Modo escuro: componentes do tema base
 * ------------------------------------------------------------------- */
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .offcanvas,
html[data-theme="dark"] .popover,
html[data-theme="dark"] .toast { background-color: var(--hub-surface); color: var(--hub-text); border: 1px solid var(--hub-border); }
html[data-theme="dark"] .dropdown-item { color: var(--hub-text); }
html[data-theme="dark"] .dropdown-item:hover, html[data-theme="dark"] .dropdown-item:focus { background: var(--hub-surface-3); color: var(--hub-heading); }
html[data-theme="dark"] .dropdown-divider,
html[data-theme="dark"] hr { border-color: var(--hub-border); opacity: 1; }
html[data-theme="dark"] .modal-header, html[data-theme="dark"] .modal-footer,
html[data-theme="dark"] .offcanvas-header, html[data-theme="dark"] .offcanvas .border-top,
html[data-theme="dark"] .offcanvas .border { border-color: var(--hub-border) !important; }
html[data-theme="dark"] .offcanvas-title, html[data-theme="dark"] .offcanvas h6 { color: var(--hub-heading); }
html[data-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .input-group-text { background-color: var(--hub-surface-2); border-color: var(--hub-border); color: var(--hub-heading); }
html[data-theme="dark"] .form-control::placeholder { color: #5d6f8f; }
html[data-theme="dark"] .form-control:disabled, html[data-theme="dark"] .form-control[readonly] { background-color: var(--hub-surface-3); }
html[data-theme="dark"] .form-label, html[data-theme="dark"] .form-check-label { color: var(--hub-text); }
html[data-theme="dark"] .form-check-input { background-color: var(--hub-surface-3); border-color: #34456a; }
html[data-theme="dark"] .form-check-input:checked { background-color: var(--hub-primary); border-color: var(--hub-primary); }

html[data-theme="dark"] .table { color: var(--hub-text); --bs-table-bg: transparent; }
html[data-theme="dark"] .table > :not(caption) > * > * { border-bottom-color: var(--hub-border); color: var(--hub-text); background-color: transparent; }
html[data-theme="dark"] .table th { color: var(--hub-muted); }
html[data-theme="dark"] .table-hover > tbody > tr:hover > * { background-color: var(--hub-surface-3); }

html[data-theme="dark"] .text-body, html[data-theme="dark"] .text-dark { color: var(--hub-text) !important; }
html[data-theme="dark"] .bg-white, html[data-theme="dark"] .bg-light, html[data-theme="dark"] .bg-lighter { background-color: var(--hub-surface-2) !important; }
html[data-theme="dark"] .border, html[data-theme="dark"] .border-top, html[data-theme="dark"] .border-bottom,
html[data-theme="dark"] .border-start, html[data-theme="dark"] .border-end { border-color: var(--hub-border) !important; }
html[data-theme="dark"] .list-group-item { background-color: var(--hub-surface); border-color: var(--hub-border); color: var(--hub-text); }
html[data-theme="dark"] .nav-tabs { border-color: var(--hub-border); }
html[data-theme="dark"] .nav-tabs .nav-link { color: var(--hub-muted); }
html[data-theme="dark"] .nav-tabs .nav-link.active { background: var(--hub-surface); border-color: var(--hub-border) var(--hub-border) var(--hub-surface); color: var(--hub-heading); }
html[data-theme="dark"] .page-link { background-color: var(--hub-surface); border-color: var(--hub-border); color: var(--hub-text); }
html[data-theme="dark"] .page-item.disabled .page-link { background-color: var(--hub-surface-2); color: var(--hub-muted); }
html[data-theme="dark"] .page-item.active .page-link { background-color: var(--hub-primary); border-color: var(--hub-primary); color: #fff; }
html[data-theme="dark"] .card-footer { background-color: transparent; border-color: var(--hub-border); }
html[data-theme="dark"] .menu-inner-shadow { background: linear-gradient(var(--hub-surface) 41%, rgba(16, 26, 46, .11) 95%, rgba(16, 26, 46, 0)); }
html[data-theme="dark"] .layout-menu-toggle i, html[data-theme="dark"] .navbar .nav-link { color: var(--hub-text); }
html[data-theme="dark"] .app-brand .layout-menu-toggle { background-color: var(--hub-primary); }
html[data-theme="dark"] .content-backdrop, html[data-theme="dark"] .layout-overlay { background-color: rgba(0, 0, 0, .55); }

html[data-theme="dark"] .bg-label-primary { background-color: rgba(var(--hub-primary-rgb), .18) !important; color: #8aa9e6 !important; }
html[data-theme="dark"] .bg-label-success { background-color: rgba(34, 197, 94, .16) !important; color: #6cc58a !important; }
html[data-theme="dark"] .bg-label-warning { background-color: rgba(245, 158, 11, .16) !important; color: #e0b252 !important; }
html[data-theme="dark"] .bg-label-danger { background-color: rgba(239, 68, 68, .16) !important; color: #e58a8a !important; }
html[data-theme="dark"] .bg-label-info { background-color: rgba(6, 182, 212, .16) !important; color: #5fb8c9 !important; }
html[data-theme="dark"] .bg-label-secondary { background-color: rgba(148, 163, 184, .14) !important; color: #a8b5c9 !important; }

/* SweetAlert no modo escuro */
html[data-theme="dark"] .swal2-popup { background: var(--hub-surface); color: var(--hub-text); border: 1px solid var(--hub-border); }
html[data-theme="dark"] .swal2-title { color: var(--hub-heading); }
html[data-theme="dark"] .swal2-html-container { color: var(--hub-text); }
html[data-theme="dark"] .swal2-input { background: var(--hub-surface-2); color: var(--hub-heading); border-color: var(--hub-border); }
.swal2-actions { gap: .5rem; }

/* Loader global (alerts.js) */
#global-loader { position: fixed; inset: 0; z-index: 3000; display: none; align-items: center; justify-content: center; opacity: 0; transition: opacity .2s; }
#global-loader.show { opacity: 1; }
#global-loader .loader-backdrop { position: absolute; inset: 0; background: rgba(10, 17, 32, .55); backdrop-filter: blur(2px); }
#global-loader .loader-content { position: relative; text-align: center; }

/* ---------------------------------------------------------------------
 * Componentes da plataforma
 * ------------------------------------------------------------------- */
.hub-page-header { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem; }
.hub-page-header h4 { font-weight: 800; margin-bottom: .25rem; }
.hub-page-header p { color: var(--hub-muted); margin: 0; }

.hub-hero {
    position: relative; overflow: hidden; border-radius: 1.1rem; padding: 1.75rem;
    background: var(--hub-gradient); color: #fff; box-shadow: 0 1px 2px rgba(15, 27, 51, .12);
}
.hub-hero h3, .hub-hero h4, .hub-hero h5 { color: #fff; }
.hub-hero p { color: rgba(255, 255, 255, .82); }
.hub-hero::after {
    content: ''; position: absolute; right: -60px; top: -60px; width: 240px; height: 240px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, .22), transparent 70%);
}
.hub-hero .btn-light { color: var(--hub-primary-600); font-weight: 700; }

.hub-stat { display: flex; align-items: center; gap: 1rem; }
.hub-stat-icon {
    width: 48px; height: 48px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.5rem; flex-shrink: 0;
}
.hub-stat-icon.primary { background: rgba(var(--hub-primary-rgb), .12); color: var(--hub-primary); }
.hub-stat-icon.success { background: rgba(var(--hub-success-rgb), .12); color: var(--hub-success); }
.hub-stat-icon.warning { background: rgba(245, 158, 11, .14); color: var(--hub-warning); }
.hub-stat-icon.danger { background: rgba(239, 68, 68, .12); color: var(--hub-danger); }
.hub-stat-icon.info { background: rgba(6, 182, 212, .12); color: var(--hub-accent); }
.hub-stat-label { color: var(--hub-muted); font-size: .82rem; font-weight: 500; }
.hub-stat-value { color: var(--hub-heading); font-size: 1.5rem; font-weight: 800; line-height: 1.2; }

.hub-empty { text-align: center; padding: 3rem 1.5rem; }
.hub-empty-icon {
    width: 80px; height: 80px; margin: 0 auto 1.25rem; border-radius: 24px; display: flex; align-items: center; justify-content: center;
    font-size: 2.4rem; background: rgba(var(--hub-primary-rgb), .1); color: var(--hub-primary);
}

.hub-pill { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .7rem; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.hub-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }
.hub-dot.pulse { animation: hubPulse 1.6s infinite; }
@keyframes hubPulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

.status-connected { background: rgba(34, 197, 94, .12); color: #16a34a; }
.status-connecting { background: rgba(245, 158, 11, .14); color: #d97706; }
.status-disconnected { background: rgba(148, 163, 184, .16); color: #64748b; }
.status-hibernated { background: rgba(6, 182, 212, .14); color: #0891b2; }
html[data-theme="dark"] .status-connected { color: #6cc58a; }
html[data-theme="dark"] .status-connecting { color: #e0b252; }
html[data-theme="dark"] .status-disconnected { color: #a8b5c9; }

.hub-progress { height: 8px; border-radius: 99px; background: var(--hub-surface-3); overflow: hidden; }
.hub-progress > span { display: block; height: 100%; border-radius: 99px; background: var(--hub-gradient); transition: width .4s ease; }

/* ---------------------------------------------------------------------
 * Instâncias
 * ------------------------------------------------------------------- */
.instance-card { transition: transform .15s ease, box-shadow .15s ease; height: 100%; }
.instance-card:hover { transform: translateY(-2px); box-shadow: var(--hub-shadow-lg); }
.instance-avatar {
    width: 56px; height: 56px; border-radius: 16px; overflow: hidden; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 1.8rem;
    background: linear-gradient(135deg, rgba(34, 197, 94, .18), rgba(34, 197, 94, .06)); color: #16a34a;
}
.instance-avatar img { width: 100%; height: 100%; object-fit: cover; }
.instance-meta { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; padding: .9rem; border-radius: .7rem; background: var(--hub-surface-2); border: 1px solid var(--hub-border); }
.instance-meta small { display: block; color: var(--hub-muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
.instance-meta span { color: var(--hub-heading); font-weight: 600; font-size: .9rem; white-space: nowrap; }

.token-box {
    display: flex; align-items: center; gap: .5rem; padding: .75rem .9rem; border-radius: .7rem;
    background: var(--hub-code-bg); color: var(--hub-code-text); font-family: 'JetBrains Mono', monospace; font-size: .85rem;
    word-break: break-all;
}

/* ---------------------------------------------------------------------
 * Tela de conexão
 * ------------------------------------------------------------------- */
.connect-shell { border-radius: 1.25rem; overflow: hidden; }
.connect-side {
    background: var(--hub-gradient); color: #fff; padding: 2rem; position: relative; overflow: hidden; height: 100%;
}
.connect-side h4, .connect-side h5 { color: #fff; }
.connect-side::before {
    content: ''; position: absolute; width: 320px; height: 320px; border-radius: 50%; right: -120px; bottom: -120px;
    background: radial-gradient(circle, rgba(255, 255, 255, .18), transparent 70%);
}
.connect-steps { list-style: none; padding: 0; margin: 1.5rem 0 0; counter-reset: step; position: relative; z-index: 1; }
.connect-steps li { counter-increment: step; display: flex; gap: .85rem; margin-bottom: 1.1rem; color: rgba(255, 255, 255, .9); font-size: .93rem; }
.connect-steps li::before {
    content: counter(step); flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
    background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .35);
    display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem;
}
.connect-steps strong { color: #fff; }

.connect-tabs { display: inline-flex; padding: .3rem; border-radius: .9rem; background: var(--hub-surface-3); gap: .25rem; }
.connect-tab {
    border: 0; background: transparent; color: var(--hub-muted); padding: .55rem 1.1rem; border-radius: .7rem;
    font-weight: 600; display: inline-flex; align-items: center; gap: .45rem; transition: all .15s;
}
.connect-tab.active { background: var(--hub-surface); color: var(--hub-primary); box-shadow: var(--hub-shadow); }

.connect-stage { min-height: 380px; display: flex; align-items: center; justify-content: center; flex-direction: column; text-align: center; }

.qr-frame {
    position: relative; width: 290px; height: 290px; padding: 18px; border-radius: 1.25rem; background: #fff;
    box-shadow: 0 18px 45px rgba(15, 27, 51, .14);
}
.qr-frame img { width: 100%; height: 100%; display: block; image-rendering: pixelated; border-radius: .4rem; }
.qr-frame .corner { position: absolute; width: 34px; height: 34px; border: 4px solid var(--hub-primary); }
.qr-frame .corner.tl { top: -2px; left: -2px; border-right: 0; border-bottom: 0; border-top-left-radius: 1.25rem; }
.qr-frame .corner.tr { top: -2px; right: -2px; border-left: 0; border-bottom: 0; border-top-right-radius: 1.25rem; }
.qr-frame .corner.bl { bottom: -2px; left: -2px; border-right: 0; border-top: 0; border-bottom-left-radius: 1.25rem; }
.qr-frame .corner.br { bottom: -2px; right: -2px; border-left: 0; border-top: 0; border-bottom-right-radius: 1.25rem; }
.qr-frame .scan-line {
    position: absolute; left: 18px; right: 18px; height: 3px; top: 18px; border-radius: 3px;
    background: rgba(var(--hub-primary-rgb), .55);
    animation: hubScan 2.6s ease-in-out infinite;
}
@keyframes hubScan { 0%, 100% { top: 18px; } 50% { top: calc(100% - 21px); } }
.qr-frame.is-loading img { filter: blur(6px); opacity: .5; }
.qr-skeleton {
    width: 100%; height: 100%; border-radius: .5rem;
    background: linear-gradient(90deg, #eef2f8 25%, #e2e8f2 37%, #eef2f8 63%); background-size: 400% 100%;
    animation: hubShimmer 1.3s ease infinite;
}
@keyframes hubShimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.pair-code { display: flex; gap: .5rem; justify-content: center; align-items: center; flex-wrap: wrap; }
.pair-code .char {
    width: 50px; height: 62px; border-radius: .8rem; display: inline-flex; align-items: center; justify-content: center;
    font-family: 'JetBrains Mono', monospace; font-size: 1.75rem; font-weight: 600; color: var(--hub-heading);
    background: var(--hub-surface-2); border: 2px solid var(--hub-border);
    animation: hubPop .35s ease both;
}
.pair-code .sep { width: 14px; height: 4px; border-radius: 4px; background: var(--hub-border); }
@keyframes hubPop { from { transform: translateY(8px) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }

.phone-input-group .input-group-text { font-weight: 600; }

.live-indicator { display: inline-flex; align-items: center; gap: .45rem; font-size: .8rem; font-weight: 600; color: var(--hub-muted); }
.live-indicator.on { color: #16a34a; }
html[data-theme="dark"] .live-indicator.on { color: #6cc58a; }

.countdown-ring { position: relative; width: 46px; height: 46px; }
.countdown-ring svg { transform: rotate(-90deg); }
.countdown-ring circle { fill: none; stroke-width: 4; }
.countdown-ring .track { stroke: var(--hub-surface-3); }
.countdown-ring .bar { stroke: var(--hub-primary); stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.countdown-ring span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; color: var(--hub-heading); }

.success-check {
    width: 110px; height: 110px; border-radius: 50%; margin: 0 auto 1.25rem; display: flex; align-items: center; justify-content: center;
    background: rgba(34, 197, 94, .12); color: #16a34a; font-size: 3.5rem; position: relative; animation: hubPop .5s ease both;
}
.success-check::after { content: ''; position: absolute; inset: -10px; border-radius: 50%; border: 2px solid rgba(34, 197, 94, .25); animation: hubRipple 1.8s ease-out infinite; }
@keyframes hubRipple { from { transform: scale(.9); opacity: 1; } to { transform: scale(1.25); opacity: 0; } }
.connected-profile { display: inline-flex; align-items: center; gap: .85rem; padding: .75rem 1.1rem; border-radius: 1rem; background: var(--hub-surface-2); border: 1px solid var(--hub-border); }
.connected-profile img, .connected-profile .ph { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; }
.connected-profile .ph { display: flex; align-items: center; justify-content: center; background: rgba(34, 197, 94, .14); color: #16a34a; font-size: 1.4rem; }

/* ---------------------------------------------------------------------
 * Integrações (documentação da API)
 * ------------------------------------------------------------------- */
.api-base { display: flex; flex-wrap: wrap; gap: .75rem; }
.api-base-item { flex: 1 1 260px; padding: .85rem 1rem; border-radius: .8rem; background: var(--hub-surface-2); border: 1px solid var(--hub-border); }
.api-base-item small { display: block; color: var(--hub-muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: .2rem; }
.api-base-item code { color: var(--hub-heading); font-size: .88rem; background: none; padding: 0; word-break: break-all; }

.api-cats { position: sticky; top: 90px; }
.api-cat-link {
    display: flex; align-items: center; gap: .65rem; padding: .6rem .8rem; border-radius: .65rem;
    color: var(--hub-text); font-weight: 500; font-size: .92rem; cursor: pointer; transition: all .12s;
}
.api-cat-link i { font-size: 1.15rem; color: var(--hub-muted); }
.api-cat-link .count { margin-left: auto; font-size: .72rem; font-weight: 700; padding: .1rem .5rem; border-radius: 99px; background: var(--hub-surface-3); color: var(--hub-muted); }
.api-cat-link:hover { background: var(--hub-surface-3); color: var(--hub-heading); }
.api-cat-link.active { background: rgba(var(--hub-primary-rgb), .1); color: var(--hub-primary); }
.api-cat-link.active i { color: var(--hub-primary); }

.api-category-title { display: flex; align-items: center; gap: .75rem; margin: 2rem 0 .9rem; }
.api-category-title:first-child { margin-top: 0; }
.api-category-title .ic { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: rgba(var(--hub-primary-rgb), .1); color: var(--hub-primary); font-size: 1.2rem; }
.api-category-title h5 { margin: 0; font-weight: 700; }
.api-category-title p { margin: 0; color: var(--hub-muted); font-size: .85rem; }

.endpoint { border: 1px solid var(--hub-border); border-radius: .85rem; background: var(--hub-surface); margin-bottom: .65rem; overflow: hidden; transition: border-color .15s; }
.endpoint:hover { border-color: rgba(var(--hub-primary-rgb), .35); }
.endpoint-head { display: flex; align-items: center; gap: .85rem; padding: .85rem 1rem; cursor: pointer; user-select: none; }
.endpoint-head .path { font-family: 'JetBrains Mono', monospace; font-size: .88rem; color: var(--hub-heading); font-weight: 500; word-break: break-all; }
.endpoint-head .name { color: var(--hub-muted); font-size: .85rem; margin-left: auto; text-align: right; }
.endpoint-head .chev { color: var(--hub-muted); transition: transform .2s; font-size: 1.2rem; }
.endpoint.open .endpoint-head .chev { transform: rotate(180deg); }
.endpoint-head .path { flex: 1 1 auto; }
.endpoint-copy { border: 0; background: transparent; color: var(--hub-muted); font-size: 1.1rem; padding: .2rem .35rem; border-radius: .45rem; line-height: 1; flex-shrink: 0; }
.endpoint-copy:hover { color: var(--hub-primary); background: rgba(var(--hub-primary-rgb), .1); }
.endpoint-url { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .55rem .65rem; margin-bottom: .9rem; border: 1px solid var(--hub-border); border-radius: .65rem; background: rgba(var(--hub-primary-rgb), .04); }
.endpoint-url code { flex: 1 1 220px; font-family: 'JetBrains Mono', monospace; font-size: .82rem; color: var(--hub-heading); word-break: break-all; background: transparent; padding: 0; }
.endpoint-body { display: none; padding: 0 1rem 1rem; }
.endpoint.open .endpoint-body { display: block; }

.method { font-family: 'JetBrains Mono', monospace; font-size: .7rem; font-weight: 700; padding: .3rem .55rem; border-radius: .45rem; min-width: 62px; text-align: center; letter-spacing: .03em; flex-shrink: 0; }
.method-GET { background: rgba(34, 197, 94, .14); color: #16a34a; }
.method-POST { background: rgba(var(--hub-primary-rgb), .14); color: var(--hub-primary); }
.method-PUT, .method-PATCH { background: rgba(245, 158, 11, .16); color: #d97706; }
.method-DELETE { background: rgba(239, 68, 68, .14); color: #dc2626; }
html[data-theme="dark"] .method-GET { color: #6cc58a; }
html[data-theme="dark"] .method-POST { color: #8aa9e6; }

.code-tabs { display: flex; gap: .25rem; border-bottom: 1px solid #1c2944; padding: .4rem .5rem 0; background: var(--hub-code-bg); }
.code-tab { border: 0; background: transparent; color: #7f8fb0; font-size: .78rem; font-weight: 600; padding: .45rem .75rem; border-radius: .45rem .45rem 0 0; }
.code-tab.active { color: #fff; background: #13203a; }
.code-block { position: relative; background: var(--hub-code-bg); border-radius: .75rem; overflow: hidden; border: 1px solid #16223b; }
.code-block pre { margin: 0; padding: 1rem 1.1rem; color: var(--hub-code-text); font-size: .82rem; line-height: 1.65; max-height: 420px; overflow: auto; background: transparent; }
.code-block .copy-btn {
    position: absolute; top: .5rem; right: .5rem; border: 1px solid #23324f; background: #13203a; color: #a9b8d6;
    border-radius: .5rem; font-size: .75rem; padding: .3rem .6rem; z-index: 2;
}
.code-block .copy-btn:hover { color: #fff; border-color: var(--hub-primary); }
.json-key { color: #7dd3fc; }
.json-string { color: #a5e8a1; }
.json-number { color: #fbbf77; }
.json-bool { color: #f0a6ff; }
.json-null { color: #94a3b8; }

/* ---------------------------------------------------------------------
 * Planos
 * ------------------------------------------------------------------- */
.service-tabs { display: inline-flex; gap: .4rem; padding: .35rem; border-radius: 1rem; background: var(--hub-surface); border: 1px solid var(--hub-border); flex-wrap: wrap; }
.service-tab { border: 0; background: transparent; color: var(--hub-muted); font-weight: 600; padding: .6rem 1.1rem; border-radius: .75rem; display: inline-flex; align-items: center; gap: .5rem; }
.service-tab i { font-size: 1.2rem; }
.service-tab.active { background: var(--hub-primary); color: #fff; box-shadow: 0 1px 2px rgba(15, 27, 51, .12); }
.service-tab .soon { font-size: .65rem; padding: .1rem .4rem; border-radius: 99px; background: rgba(245, 158, 11, .18); color: #d97706; }
.service-tab.active .soon { background: rgba(255, 255, 255, .25); color: #fff; }

.plan-card { position: relative; height: 100%; padding: 1.75rem; border-radius: 1.1rem; display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; }
.plan-card:hover { transform: translateY(-4px); box-shadow: var(--hub-shadow-lg); }
.plan-card.featured { border: 2px solid var(--hub-primary); box-shadow: 0 1px 2px rgba(15, 27, 51, .12); }
.plan-card .ribbon {
    position: absolute; top: -13px; left: 50%; transform: translateX(-50%); white-space: nowrap;
    background: var(--hub-gradient); color: #fff; font-size: .72rem; font-weight: 700; padding: .35rem .9rem; border-radius: 99px;
    letter-spacing: .04em; text-transform: uppercase; box-shadow: 0 1px 2px rgba(15, 27, 51, .12);
}
.plan-name { font-weight: 800; font-size: 1.25rem; color: var(--hub-heading); }
.plan-desc { color: var(--hub-muted); font-size: .9rem; min-height: 42px; }
.plan-price { display: flex; align-items: flex-end; gap: .25rem; margin: 1.25rem 0; }
.plan-price .cur { font-weight: 700; color: var(--hub-muted); margin-bottom: .55rem; }
.plan-price .val { font-size: 2.6rem; font-weight: 800; color: var(--hub-heading); line-height: 1; letter-spacing: -.03em; }
.plan-price .per { color: var(--hub-muted); margin-bottom: .4rem; }
.plan-features { list-style: none; padding: 0; margin: 0 0 1.5rem; flex: 1; }
.plan-features li { display: flex; align-items: flex-start; gap: .6rem; padding: .45rem 0; font-size: .93rem; color: var(--hub-text); }
.plan-features li i { font-size: 1.15rem; margin-top: .05rem; }
.plan-features li.yes i { color: var(--hub-success); }
.plan-features li.no { color: var(--hub-muted); text-decoration: line-through; opacity: .7; }
.plan-features li.no i { color: var(--hub-muted); }
.plan-current { position: absolute; top: 1rem; right: 1rem; }

/* ---------------------------------------------------------------------
 * Faturas
 * ------------------------------------------------------------------- */
.filter-pills { display: inline-flex; gap: .35rem; flex-wrap: wrap; }
.filter-pill { border: 1px solid var(--hub-border); background: var(--hub-surface); color: var(--hub-text); border-radius: 99px; padding: .4rem .95rem; font-size: .85rem; font-weight: 600; }
.filter-pill.active { background: var(--hub-primary); border-color: var(--hub-primary); color: #fff; }
.filter-pill .n { font-size: .72rem; opacity: .75; margin-left: .25rem; }

.invoice-row { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--hub-border); transition: background .12s; }
.invoice-row:last-child { border-bottom: 0; }
.invoice-row:hover { background: var(--hub-surface-2); }
.invoice-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.35rem; flex-shrink: 0; }
.invoice-icon.pending { background: rgba(245, 158, 11, .14); color: var(--hub-warning); }
.invoice-icon.paid { background: rgba(34, 197, 94, .12); color: var(--hub-success); }
.invoice-icon.canceled, .invoice-icon.expired, .invoice-icon.refunded { background: var(--hub-surface-3); color: var(--hub-muted); }
.invoice-main { flex: 1; min-width: 0; }
.invoice-main .desc { font-weight: 600; color: var(--hub-heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.invoice-main .sub { color: var(--hub-muted); font-size: .82rem; }
.invoice-amount { font-weight: 800; color: var(--hub-heading); white-space: nowrap; }
@media (max-width: 767.98px) {
    .invoice-row { flex-wrap: wrap; }
    .invoice-main { flex-basis: calc(100% - 60px); }
    .invoice-row .invoice-side { width: 100%; display: flex; justify-content: space-between; align-items: center; }
}

.invoice-sheet { border-radius: 1.1rem; overflow: hidden; }
.invoice-sheet-head { background: var(--hub-gradient); color: #fff; padding: 1.5rem 1.75rem; }
.invoice-sheet-head h4, .invoice-sheet-head h5 { color: #fff; }
.invoice-sheet-head .muted { color: rgba(255, 255, 255, .75); font-size: .85rem; }
.invoice-line { display: flex; justify-content: space-between; padding: .65rem 0; border-bottom: 1px dashed var(--hub-border); color: var(--hub-text); }
.invoice-line:last-child { border-bottom: 0; }
.invoice-line strong { color: var(--hub-heading); }
.invoice-total { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.1rem; border-radius: .8rem; background: rgba(var(--hub-primary-rgb), .08); }
.invoice-total .v { font-size: 1.6rem; font-weight: 800; color: var(--hub-primary); }

.pay-methods { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.pay-method {
    border: 2px solid var(--hub-border); background: var(--hub-surface); border-radius: .9rem; padding: .9rem; text-align: left;
    display: flex; align-items: center; gap: .75rem; color: var(--hub-text); transition: all .15s;
}
.pay-method i { font-size: 1.6rem; color: var(--hub-muted); }
.pay-method strong { display: block; color: var(--hub-heading); }
.pay-method small { color: var(--hub-muted); }
.pay-method.active { border-color: var(--hub-primary); background: rgba(var(--hub-primary-rgb), .06); }
.pay-method.active i { color: var(--hub-primary); }

.pix-qr { width: 230px; height: 230px; margin: 0 auto; padding: 12px; background: #fff; border-radius: 1rem; box-shadow: var(--hub-shadow); }
.pix-qr img { width: 100%; height: 100%; }
.pix-code { display: flex; gap: .5rem; }
.pix-code input { font-family: 'JetBrains Mono', monospace; font-size: .78rem; }

.mp-field { height: 42px; padding: 0 .875rem; border: 1px solid #d9dee3; border-radius: .6rem; background: #fff; display: flex; align-items: center; }
html[data-theme="dark"] .mp-field { background: var(--hub-surface-2); border-color: var(--hub-border); }

.paid-state { text-align: center; padding: 2rem 1rem; }

/* ---------------------------------------------------------------------
 * Admin
 * ------------------------------------------------------------------- */
.feature-row { display: grid; grid-template-columns: 1fr 140px 110px auto auto; gap: .5rem; align-items: center; margin-bottom: .5rem; }
@media (max-width: 767.98px) { .feature-row { grid-template-columns: 1fr 1fr; } }
.admin-endpoint { display: flex; align-items: center; gap: .75rem; padding: .6rem .25rem; border-bottom: 1px solid var(--hub-border); }
.admin-endpoint:last-child { border-bottom: 0; }
.admin-endpoint .path { font-family: 'JetBrains Mono', monospace; font-size: .82rem; color: var(--hub-heading); }
.admin-endpoint .upstream { font-family: 'JetBrains Mono', monospace; font-size: .72rem; color: var(--hub-muted); }
.btn-text-primary, .btn-text-secondary, .btn-text-danger { background: transparent; border: 0; }
.btn-text-primary { color: var(--hub-primary); }
.btn-text-secondary { color: var(--hub-muted); }
.btn-text-danger { color: #dc2626; }
.btn-text-primary:hover { background: rgba(var(--hub-primary-rgb), .1); color: var(--hub-primary); }
.btn-text-secondary:hover { background: rgba(var(--hub-primary-rgb), .1); color: var(--hub-primary); }
.btn-text-danger:hover { background: rgba(239, 68, 68, .12); color: #dc2626; }
.json-input { min-height: 140px; resize: vertical; tab-size: 2; }

/* ---------------------------------------------------------------------
 * Autenticação (login / cadastro)
 * ------------------------------------------------------------------- */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
@media (max-width: 991.98px) { .auth-shell { grid-template-columns: 1fr; } .auth-aside { display: none !important; } }
.auth-aside {
    position: relative; overflow: hidden; background: var(--hub-gradient); color: #fff;
    display: flex; flex-direction: column; justify-content: space-between; padding: 3rem;
}
.auth-aside::before, .auth-aside::after { content: ''; position: absolute; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .16), transparent 70%); }
.auth-aside::before { width: 520px; height: 520px; right: -180px; top: -160px; }
.auth-aside::after { width: 380px; height: 380px; left: -140px; bottom: -140px; }
.auth-aside h1 { color: #fff; font-weight: 800; font-size: 2.4rem; line-height: 1.15; letter-spacing: -.03em; }
.auth-aside p { color: rgba(255, 255, 255, .82); font-size: 1.05rem; }
.auth-aside > * { position: relative; z-index: 1; }
.auth-feature { display: flex; gap: .9rem; align-items: flex-start; margin-bottom: 1.1rem; }
.auth-feature i { width: 40px; height: 40px; border-radius: 12px; background: rgba(255, 255, 255, .16); display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; }
.auth-feature strong { display: block; color: #fff; }
.auth-feature span { color: rgba(255, 255, 255, .75); font-size: .9rem; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; position: relative; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h3 { font-weight: 800; letter-spacing: -.02em; }
.auth-theme { position: absolute; top: 1.25rem; right: 1.25rem; }
.auth-card .form-control { padding: .7rem .9rem; }
.auth-card .input-group-text { cursor: pointer; }

/* Divisor "ou" nas telas de login/registro */
.auth-divider { display: flex; align-items: center; gap: .75rem; margin: 1.25rem 0; color: var(--bs-secondary-color, #8592a3); font-size: .85rem; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: currentColor; opacity: .3; }
