/* ==========================================================================
   HUBCLIENTE — OBSIDIAN CLEAN DESIGN SYSTEM (v2.0)
   Transformação visual completa estilo Linear / Vercel / Stripe Dark.
   Sobrescreve tokens :root e seletores de alta especificidade em TODOS os menus.
   Zero alteração de lógica JS ou regras de negócio.
   ========================================================================== */

:root {
    /* Sobrescrita direta dos tokens originais do sistema */
    --bg-main: #06090f;
    --bg-surface: #0b0f19;
    --card-bg: #0e131f;
    --card-border: rgba(255, 255, 255, 0.08);
    --input-bg: #080c14;
    --glass: rgba(14, 19, 31, 0.96);
    --hover-bg: rgba(255, 255, 255, 0.04);

    --primary: #6366f1;
    --primary-hover: #818cf8;
    --primary-glow: rgba(99, 102, 241, 0.22);
    --accent: #10b981;
    --error: #f43f5e;
    --warn: #f59e0b;
    --info: #38bdf8;

    --text-main: #f8fafc;
    --text-muted: #94a3b8;

    /* Raios mais modernos e precisos (estilo Linear/Vercel) */
    --radius-xl: 14px;
    --radius-lg: 12px;
    --radius-md: 10px;
    --radius-sm: 8px;
    --radius-xs: 6px;

    /* Tokens internos Obsidian */
    --obs-bg: #06090f;
    --obs-sidebar: #080b12;
    --obs-surface: #0e131f;
    --obs-surface-2: #131a29;
    --obs-border: rgba(255, 255, 255, 0.08);
    --obs-border-hover: rgba(255, 255, 255, 0.16);
    --obs-sheen: inset 0 1px 0 rgba(255, 255, 255, 0.055);
    --obs-shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 10px 28px -14px rgba(0, 0, 0, 0.7);
}

/* ==========================================================================
   1. FUNDO GLOBAL COM GRADIENTE AMBIENTE SUTIL + TIPOGRAFIA
   ========================================================================== */
html,
body,
body.dark-mode {
    background-color: var(--obs-bg) !important;
    background-image:
        radial-gradient(ellipse 80% 45% at 50% -10%, rgba(99, 102, 241, 0.11), transparent 65%),
        radial-gradient(ellipse 50% 35% at 90% 10%, rgba(16, 185, 129, 0.05), transparent 60%) !important;
    background-attachment: fixed !important;
    color: var(--text-main) !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

main.content {
    background: transparent !important;
}

.venc-count,
.venc-value,
.stat-value,
.kpi-value,
#filtered-clients-count,
#clients-table .col-valor,
#clients-table .col-venc {
    font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   2. SIDEBAR OBSIDIAN ENXUTA
   ========================================================================== */
body.dark-mode aside.sidebar,
aside.sidebar {
    background: var(--obs-sidebar) !important;
    border-right: 1px solid var(--obs-border) !important;
    box-shadow: none !important;
}

body.dark-mode .sidebar nav .nav-item {
    border-radius: 9px !important;
    color: #8b9bb4 !important;
    font-size: 0.86rem !important;
    font-weight: 500 !important;
    padding: 0.62rem 0.85rem !important;
    margin-bottom: 3px !important;
    border: 1px solid transparent !important;
    background: transparent !important;
    transition: all 0.16s ease !important;
}

body.dark-mode .sidebar nav .nav-item:hover {
    background: rgba(255, 255, 255, 0.045) !important;
    color: #f8fafc !important;
    transform: none !important;
}

body.dark-mode .sidebar nav .nav-item.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.22) 0%, rgba(99, 102, 241, 0.08) 100%) !important;
    color: #ffffff !important;
    border: 1px solid rgba(129, 140, 248, 0.3) !important;
    box-shadow: inset 2px 0 0 #818cf8 !important;
    font-weight: 600 !important;
}

body.dark-mode .sidebar nav .nav-item.active i {
    color: #818cf8 !important;
}

body.dark-mode .sidebar .bot-status .status-indicator {
    background: rgba(16, 185, 129, 0.07) !important;
    border: 1px solid rgba(16, 185, 129, 0.22) !important;
    border-radius: 10px !important;
}

body.dark-mode .sidebar .logout-btn {
    background: rgba(244, 63, 94, 0.08) !important;
    border: 1px solid rgba(244, 63, 94, 0.22) !important;
    color: #fda4af !important;
    border-radius: 10px !important;
}

/* ==========================================================================
   3. CABEÇALHO SUPERIOR INTEGRADO
   ========================================================================== */
body.dark-mode main.content > header {
    padding-bottom: 1rem !important;
    margin-bottom: 1.25rem !important;
    border-bottom: 1px solid var(--obs-border) !important;
}

body.dark-mode main.content > header h1#page-title {
    font-size: 1.6rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.03em !important;
    color: #ffffff !important;
}

body.dark-mode main.content > header p#page-desc {
    color: #7c8ca6 !important;
    font-size: 0.84rem !important;
}

body.dark-mode .app-version-badge-container {
    background: var(--obs-surface) !important;
    border: 1px solid var(--obs-border) !important;
    box-shadow: var(--obs-sheen), 0 4px 16px rgba(0, 0, 0, 0.35) !important;
    border-radius: 999px !important;
    padding: 0.32rem 0.75rem !important;
}

body.dark-mode #infra-status-mini.status-online {
    background: rgba(16, 185, 129, 0.14) !important;
    border: 1px solid rgba(16, 185, 129, 0.32) !important;
    color: #34d399 !important;
    border-radius: 999px !important;
    padding: 0.18rem 0.6rem !important;
    font-size: 0.67rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.05em !important;
}

/* ==========================================================================
   4. CARDS OBSIDIAN CLEAN (REMOVE BORDAS GROSSAS DE 4PX E UNIFICA TUDO)
   ========================================================================== */
body.dark-mode .card,
body.dark-mode .premium-card,
body.dark-mode .stat-card,
body.dark-mode .chart-card,
body.dark-mode .opt-modern-card,
body.dark-mode #config-sistema-tab .card,
body.dark-mode #mensagens-tab .card,
body.dark-mode #clients-tab .card,
body.dark-mode #logs-tab .card,
body.dark-mode #payment-gateway-tab .card,
body.dark-mode #panels-tab .card,
body.dark-mode #security-tab .card,
body.dark-mode #manual-actions-tab .card,
body.dark-mode #operations-tab .card {
    background: var(--obs-surface) !important;
    border: 1px solid var(--obs-border) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.11) !important;
    border-radius: 14px !important;
    box-shadow: var(--obs-sheen), var(--obs-shadow) !important;
}

/* Cards internos (ex: cobranças, templates, campos padrão) */
body.dark-mode .card .card,
body.dark-mode #msg-cobrancas-body .card,
body.dark-mode #msg-templates-body .card,
body.dark-mode #options-manager-container .opt-modern-card {
    background: #0a0e18 !important;
    border: 1px solid rgba(255, 255, 255, 0.075) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 12px !important;
    box-shadow: none !important;
    transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease !important;
}

body.dark-mode #msg-cobrancas-body .card:hover,
body.dark-mode #msg-templates-body .card:hover,
body.dark-mode #options-manager-container .opt-modern-card:hover {
    background: #101625 !important;
    border-color: rgba(129, 140, 248, 0.32) !important;
}

/* ==========================================================================
   5. DASHBOARD — CARDS DE VENCIMENTO ESTILO LINEAR (CLEAN + COMPACTOS)
   ========================================================================== */
body.dark-mode .dashboard-section-title,
body.light-mode .dashboard-section-title {
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.1em !important;
    color: #64748b !important;
    text-transform: uppercase !important;
    text-align: left !important;
    justify-content: flex-start !important;
    margin-bottom: 0.85rem !important;
}

body.dark-mode .dashboard-section-title::after,
body.light-mode .dashboard-section-title::after {
    display: none !important;
}

/* Remove caixa dupla quando há tabela dentro de um card (ex: Recebimentos Hoje) */
body.dark-mode .card .table-container,
body.light-mode .card .table-container {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 10px !important;
    padding: 0 !important;
}

body.dark-mode #dashboard-tab .venc-card,
body.dark-mode .venc-card {
    background: var(--obs-surface) !important;
    border: 1px solid var(--obs-border) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 14px !important;
    box-shadow: var(--obs-sheen), var(--obs-shadow) !important;
    overflow: hidden !important;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease !important;
}

body.dark-mode #dashboard-tab .venc-card:hover,
body.dark-mode .venc-card:hover {
    transform: translateY(-2px) !important;
    background: var(--obs-surface-2) !important;
    border-color: rgba(129, 140, 248, 0.35) !important;
}

/* Barra lateral/superior de acento bem fina e refinada */
body.dark-mode .venc-card .venc-accent {
    height: 2px !important;
    opacity: 0.85 !important;
}

body.dark-mode .venc-card .venc-title {
    color: #94a3b8 !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
}

body.dark-mode .venc-card .venc-count {
    font-size: 1.75rem !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    letter-spacing: -0.03em !important;
}

body.dark-mode .venc-card .venc-value {
    color: #94a3b8 !important;
    font-size: 0.88rem !important;
    font-weight: 600 !important;
}

body.dark-mode .venc-card .venc-badge {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.09) !important;
    color: #cbd5e1 !important;
    border-radius: 999px !important;
    font-size: 0.68rem !important;
    font-weight: 600 !important;
}

/* ==========================================================================
   6. GESTÃO DE CLIENTES — CHIPS DE FILTRO + TABELA OBSIDIAN (ALTA ESPECIFICIDADE)
   ========================================================================== */
body.dark-mode #clients-tab #status-filter-buttons {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 0.45rem !important;
}

body.dark-mode #clients-tab #status-filter-buttons .filter-btn {
    flex: 0 0 auto !important;
    width: auto !important;
    background: rgba(255, 255, 255, 0.035) !important;
    border: 1px solid rgba(255, 255, 255, 0.09) !important;
    border-radius: 999px !important;
    color: #94a3b8 !important;
    font-size: 0.78rem !important;
    font-weight: 500 !important;
    padding: 0.44rem 0.85rem !important;
    white-space: nowrap !important;
    overflow: visible !important;
    box-shadow: none !important;
    transition: all 0.16s ease !important;
}

body.dark-mode #clients-tab #status-filter-buttons .filter-btn:hover {
    background: rgba(255, 255, 255, 0.075) !important;
    border-color: rgba(255, 255, 255, 0.18) !important;
    color: #ffffff !important;
}

body.dark-mode #clients-tab #status-filter-buttons .filter-btn.active {
    background: rgba(99, 102, 241, 0.22) !important;
    border: 1px solid #818cf8 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    box-shadow: 0 0 16px -2px rgba(99, 102, 241, 0.5) !important;
}

body.dark-mode #clients-tab #status-filter-buttons .filter-btn.filter-danger.active {
    background: rgba(244, 63, 94, 0.22) !important;
    border-color: #fb7185 !important;
    color: #fff1f2 !important;
    box-shadow: 0 0 16px -2px rgba(244, 63, 94, 0.5) !important;
}

body.dark-mode #clients-tab #status-filter-buttons .filter-btn.filter-warn.active {
    background: rgba(245, 158, 11, 0.22) !important;
    border-color: #fbbf24 !important;
    color: #fffbeb !important;
    box-shadow: 0 0 16px -2px rgba(245, 158, 11, 0.5) !important;
}

body.dark-mode #clients-tab #status-filter-buttons .filter-btn.filter-info.active {
    background: rgba(56, 189, 248, 0.22) !important;
    border-color: #38bdf8 !important;
    color: #f0f9ff !important;
    box-shadow: 0 0 16px -2px rgba(56, 189, 248, 0.5) !important;
}

body.dark-mode #clients-tab #dropdown-extra-filters .dropdown-trigger {
    background: rgba(255, 255, 255, 0.035) !important;
    border: 1px solid rgba(255, 255, 255, 0.09) !important;
    border-radius: 999px !important;
    color: #94a3b8 !important;
    padding: 0.44rem 0.85rem !important;
    font-size: 0.78rem !important;
}

body.dark-mode #clients-tab #dropdown-extra-filters .dropdown-menu {
    background: #0e131f !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    border-radius: 12px !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7) !important;
}

/* Tabela de Clientes & Todas as Tabelas */
body.dark-mode #clients-tab .table-container,
body.dark-mode .table-container {
    background: var(--obs-surface) !important;
    border: 1px solid var(--obs-border) !important;
    border-radius: 14px !important;
    box-shadow: var(--obs-sheen), var(--obs-shadow) !important;
}

body.dark-mode #clients-table thead,
body.dark-mode #clients-table thead tr,
body.dark-mode #clients-table thead th,
body.dark-mode table thead,
body.dark-mode table thead tr,
body.dark-mode table thead th {
    background: #0a0e18 !important;
    color: #64748b !important;
    font-size: 0.69rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.07em !important;
    text-transform: uppercase !important;
    border-bottom: 1px solid var(--obs-border) !important;
}

body.dark-mode #clients-tab table tbody tr,
body.dark-mode table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.045) !important;
}

body.dark-mode #clients-tab table tbody tr:hover td,
body.dark-mode table tbody tr:hover td {
    background: rgba(99, 102, 241, 0.045) !important;
}

body.dark-mode #clients-table .clean-server,
body.light-mode #clients-table .clean-server {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.02em !important;
}

body.dark-mode #clients-table .clean-pgto,
body.light-mode #clients-table .clean-pgto {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    font-size: 0.8rem !important;
}

body.dark-mode #clients-table .clean-pgto {
    color: #94a3b8 !important;
}

body.light-mode #clients-table .clean-pgto {
    color: #475569 !important;
}

body.dark-mode #clients-table .clean-pgto.pgto-depix-pill {
    display: inline-flex !important;
    align-items: center !important;
    padding: 2px 8px !important;
    border-radius: 999px !important;
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    color: #e2e8f0 !important;
    font-size: 0.74rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.02em !important;
    line-height: 1.35 !important;
    white-space: nowrap !important;
}

body.light-mode #clients-table .clean-pgto.pgto-depix-pill {
    display: inline-flex !important;
    align-items: center !important;
    padding: 2px 8px !important;
    border-radius: 999px !important;
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #1e293b !important;
    font-size: 0.74rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.02em !important;
    line-height: 1.35 !important;
    white-space: nowrap !important;
}

/* Remove o ponto da frente do texto na coluna Status */
#clients-table .clean-status::before {
    display: none !important;
    content: none !important;
}

/* Remove caixinha/chip dos botões da coluna Ações */
body.dark-mode #clients-table .col-actions .icon-btn,
body.light-mode #clients-table .col-actions .icon-btn {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 6px !important;
    width: 30px !important;
    height: 30px !important;
}

body.dark-mode #clients-table .col-actions .icon-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.06) !important;
    border: none !important;
    color: #ffffff !important;
}

body.light-mode #clients-table .col-actions .icon-btn:hover:not(:disabled) {
    background: #f1f5f9 !important;
    border: none !important;
    color: #0f172a !important;
}

/* ==========================================================================
   7. INPUTS, BOTÕES, SUB-NAVEGAÇÃO (MENSAGENS & CONFIGURAÇÕES) E MODAIS
   ========================================================================== */
body.dark-mode input[type="text"],
body.dark-mode input[type="password"],
body.dark-mode input[type="email"],
body.dark-mode input[type="number"],
body.dark-mode input[type="date"],
body.dark-mode input[type="time"],
body.dark-mode input[type="search"],
body.dark-mode input[type="url"],
body.dark-mode textarea,
body.dark-mode select,
body.dark-mode .custom-input,
body.dark-mode .custom-select {
    background: #080c14 !important;
    border: 1px solid rgba(255, 255, 255, 0.11) !important;
    border-radius: 10px !important;
    color: #f8fafc !important;
}

body.dark-mode input:focus,
body.dark-mode textarea:focus,
body.dark-mode select:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2) !important;
}

body.dark-mode .btn.primary,
body.dark-mode button.btn.primary,
body.dark-mode .btn-new-client-icon {
    background: linear-gradient(180deg, #6b6ff7 0%, #5558e6 100%) !important;
    border: 1px solid rgba(165, 180, 252, 0.35) !important;
    color: #ffffff !important;
    border-radius: 10px !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 6px 16px -4px rgba(99, 102, 241, 0.5) !important;
}

body.dark-mode .btn.secondary,
body.dark-mode button.btn.secondary {
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.11) !important;
    color: #e2e8f0 !important;
    border-radius: 10px !important;
}

body.dark-mode .btn.secondary:hover,
body.dark-mode button.btn.secondary:hover {
    background: rgba(255, 255, 255, 0.09) !important;
    border-color: rgba(255, 255, 255, 0.22) !important;
}

body.dark-mode .config-nav-btn.active-highlight,
body.dark-mode .msg-nav-btn.active-highlight {
    background: linear-gradient(180deg, #6b6ff7 0%, #5558e6 100%) !important;
    border: 1px solid rgba(165, 180, 252, 0.35) !important;
    color: #ffffff !important;
    border-radius: 10px !important;
    box-shadow: 0 6px 16px -4px rgba(99, 102, 241, 0.5) !important;
}

body.dark-mode .modal {
    background: rgba(3, 5, 10, 0.78) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
}

body.dark-mode .modal-content {
    background: #0e131f !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 16px !important;
    box-shadow: var(--obs-sheen), 0 28px 70px rgba(0, 0, 0, 0.75) !important;
}

/* ==========================================================================
   8. MOBILE — BOTTOM NAV & CARDS CLIENTES
   ========================================================================== */
@media (max-width: 768px) {
    body.dark-mode .bottom-nav {
        background: rgba(8, 11, 18, 0.94) !important;
        backdrop-filter: blur(18px) !important;
        -webkit-backdrop-filter: blur(18px) !important;
        border-top: 1px solid rgba(255, 255, 255, 0.09) !important;
    }

    body.dark-mode #clients-table tbody tr {
        background: var(--obs-surface) !important;
        border: 1px solid var(--obs-border) !important;
        border-radius: 14px !important;
        box-shadow: var(--obs-sheen), var(--obs-shadow) !important;
    }
}

/* ==========================================================================
   9. MODO CLARO (OBSIDIAN CLEAN LIGHT)
   ========================================================================== */
body.light-mode {
    --bg-main: #f8fafc;
    --bg-surface: #ffffff;
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --input-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    background: #f8fafc !important;
    background-image: none !important;
    color: #0f172a !important;
}

body.light-mode aside.sidebar {
    background: #ffffff !important;
    border-right: 1px solid #e2e8f0 !important;
}

body.light-mode .card,
body.light-mode .premium-card,
body.light-mode .venc-card,
body.light-mode .modal-content,
body.light-mode .table-container {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-top: 1px solid #e2e8f0 !important;
    border-radius: 14px !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05) !important;
}

body.light-mode #clients-tab #status-filter-buttons .filter-btn {
    flex: 0 0 auto !important;
    width: auto !important;
    border-radius: 999px !important;
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
}

body.light-mode #clients-tab #status-filter-buttons .filter-btn.active {
    background: rgba(99, 102, 241, 0.14) !important;
    border-color: #6366f1 !important;
    color: #312e81 !important;
}

body.light-mode #clients-tab #status-filter-buttons .filter-btn.filter-danger.active {
    background: rgba(244, 63, 94, 0.14) !important;
    border-color: #f43f5e !important;
    color: #881337 !important;
}

body.light-mode #clients-tab #status-filter-buttons .filter-btn.filter-warn.active {
    background: rgba(245, 158, 11, 0.16) !important;
    border-color: #d97706 !important;
    color: #78350f !important;
}

body.light-mode #clients-tab #status-filter-buttons .filter-btn.filter-info.active {
    background: rgba(14, 165, 233, 0.15) !important;
    border-color: #0284c7 !important;
    color: #0c4a6e !important;
}

/* ==========================================================================
   10. LAYOUT ESTRUTURAL OBSIDIAN (IDÊNTICO AO MOCKUP DO PROJETO)
   ========================================================================== */

/* Sidebar Logo alinhada na mesma altura (60px) da Topbar */
aside.sidebar {
    padding: 0 !important;
}

aside.sidebar .obs-sidebar-logo {
    height: 60px !important;
    min-height: 60px !important;
    padding: 0 1.25rem !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    border-bottom: 1px solid var(--obs-border) !important;
    box-sizing: border-box !important;
}

aside.sidebar .obs-sidebar-logo .sidebar-banner {
    max-height: 30px !important;
    width: auto !important;
    object-fit: contain !important;
}

aside.sidebar nav.obs-sidebar-nav {
    padding: 1rem 0.75rem !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.2rem !important;
    overflow-y: auto !important;
    flex: 1 !important;
}

.obs-nav-divider {
    height: 1px !important;
    background: var(--obs-border) !important;
    margin: 0.65rem 0.4rem !important;
}

/* Topbar slim 60px alinhada com a logo da sidebar (T-junction limpa) */
body main.content > header.obs-topbar,
header.obs-topbar {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    text-align: left !important;
    gap: 1rem !important;
    height: 60px !important;
    min-height: 60px !important;
    margin: -2rem -3rem 1.5rem -3rem !important;
    padding: 0 2rem !important;
    border-bottom: 1px solid var(--obs-border) !important;
    background: rgba(6, 9, 15, 0.78) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 40 !important;
    box-sizing: border-box !important;
}

body main.content > header.obs-topbar .obs-topbar-left {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 0.85rem !important;
    min-width: 0 !important;
    flex: 0 1 auto !important;
}

body main.content > header.obs-topbar h1#page-title {
    font-size: 1.25rem !important;
    font-weight: 600 !important;
    letter-spacing: -0.02em !important;
    white-space: nowrap !important;
    margin: 0 !important;
}

body main.content > header.obs-topbar .obs-topbar-right.app-version-badge-container {
    position: static !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    transform: none !important;
    width: auto !important;
    max-width: none !important;
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 0.5rem !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
}

.obs-topbar-actions {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.55rem !important;
}

/* Botão monitor de WhatsApp na topbar (apenas ícone, mesmo tamanho dos demais) */
.obs-wa-monitor-btn {
    position: relative !important;
    color: #34d399 !important;
}

.obs-wa-monitor-btn.offline {
    color: #fb7185 !important;
}

.obs-wa-monitor-btn.connecting {
    color: #fbbf24 !important;
}

.obs-wa-mini-dot {
    position: absolute !important;
    top: 5px !important;
    right: 5px !important;
    width: 7px !important;
    height: 7px !important;
    border-radius: 50% !important;
    background: #10b981 !important;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.85) !important;
    border: 1.5px solid #06090f !important;
}

.obs-wa-monitor-btn.offline .obs-wa-mini-dot {
    background: #f43f5e !important;
    box-shadow: 0 0 6px rgba(244, 63, 94, 0.85) !important;
}

.obs-wa-monitor-btn.connecting .obs-wa-mini-dot {
    background: #f59e0b !important;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.85) !important;
}

/* Ícones minimalistas sem caixa (igual ao mockup) */
.obs-ghost-icon {
    width: 32px !important;
    height: 32px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    border: none !important;
    border-radius: 8px !important;
    color: #94a3b8 !important;
    font-size: 1.1rem !important;
    cursor: pointer !important;
    transition: color 0.15s ease, background 0.15s ease !important;
}

.obs-ghost-icon:hover {
    background: rgba(255, 255, 255, 0.06) !important;
    color: #ffffff !important;
}

/* Botão intuitivo de Tema Claro/Escuro (ícone Lua/Sol no mesmo padrão dos demais) */
.obs-theme-icon-btn {
    color: #fbbf24 !important;
}

.obs-theme-icon-btn:hover {
    background: rgba(251, 191, 36, 0.12) !important;
    color: #fde68a !important;
}

body.light-mode .obs-theme-icon-btn {
    color: #4f46e5 !important;
}

body.light-mode .obs-theme-icon-btn:hover {
    background: rgba(99, 102, 241, 0.12) !important;
    color: #4338ca !important;
}

/* Avatar + Dropdown de Conta / Bot / Sair */
.obs-user-menu-wrap {
    position: relative !important;
}

.obs-avatar-btn {
    width: 34px !important;
    height: 34px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #312e81 0%, #1e293b 100%) !important;
    border: 1px solid rgba(165, 180, 252, 0.35) !important;
    color: #e2e8f0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.95rem !important;
    cursor: pointer !important;
    position: relative !important;
    transition: border-color 0.15s ease, transform 0.15s ease !important;
}

.obs-avatar-btn:hover {
    border-color: #818cf8 !important;
    transform: scale(1.03) !important;
}

.obs-avatar-dot {
    position: absolute !important;
    bottom: 0 !important;
    right: 0 !important;
    width: 9px !important;
    height: 9px !important;
    border-radius: 50% !important;
    background: #10b981 !important;
    border: 2px solid #06090f !important;
}

.obs-user-dropdown {
    display: none !important;
    position: absolute !important;
    top: calc(100% + 10px) !important;
    right: 0 !important;
    width: 220px !important;
    background: #0e131f !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 12px !important;
    padding: 0.65rem !important;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.65) !important;
    z-index: 9999 !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
}

.obs-user-dropdown.open {
    display: flex !important;
}

.obs-user-dropdown-row .status-indicator {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    padding: 0.45rem 0.65rem !important;
    border-radius: 8px !important;
    background: rgba(16, 185, 129, 0.09) !important;
    border: 1px solid rgba(16, 185, 129, 0.22) !important;
    font-size: 0.78rem !important;
    color: #34d399 !important;
    font-weight: 600 !important;
}

.obs-user-dropdown-meta {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0.25rem 0.4rem !important;
    font-size: 0.74rem !important;
    color: #64748b !important;
}

.obs-user-dropdown-divider {
    height: 1px !important;
    background: rgba(255, 255, 255, 0.08) !important;
    margin: 0.15rem 0 !important;
}

.obs-dropdown-logout {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.55rem !important;
    padding: 0.55rem 0.65rem !important;
    border-radius: 8px !important;
    background: rgba(244, 63, 94, 0.09) !important;
    border: 1px solid rgba(244, 63, 94, 0.22) !important;
    color: #fda4af !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: background 0.15s ease !important;
}

.obs-dropdown-logout:hover {
    background: rgba(244, 63, 94, 0.18) !important;
    color: #fff1f2 !important;
}

body.light-mode header.obs-topbar {
    background: rgba(255, 255, 255, 0.9) !important;
    border-bottom-color: #e2e8f0 !important;
}

body.light-mode .obs-ghost-icon {
    color: #475569 !important;
}

body.light-mode .obs-ghost-icon:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}

body.light-mode .obs-user-dropdown {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.12) !important;
}

@media (max-width: 1024px) {
    header.obs-topbar {
        margin: -1rem -1rem 1rem -1rem !important;
        padding: 0 1rem !important;
    }
}

.obs-page-desc {
    display: none !important;
}

/* Dashboard Layout Vertical */
.obs-dashboard-layout {
    display: flex !important;
    flex-direction: column !important;
    gap: 1.5rem !important;
}

/* ROW 1: 4 KPI Cards */
.obs-kpi-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 1rem !important;
    width: 100% !important;
}

.obs-kpi-card {
    background: var(--obs-surface) !important;
    border: 1px solid var(--obs-border) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.11) !important;
    border-radius: 14px !important;
    padding: 1.15rem 1.25rem !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.55rem !important;
    box-shadow: var(--obs-sheen), var(--obs-shadow) !important;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease !important;
}

.obs-kpi-card.clickable {
    cursor: pointer !important;
}

.obs-kpi-card:hover {
    transform: translateY(-2px) !important;
    background: var(--obs-surface-2) !important;
    border-color: rgba(129, 140, 248, 0.32) !important;
}

.obs-kpi-top {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0.5rem !important;
}

.obs-kpi-label {
    font-size: 0.82rem !important;
    font-weight: 500 !important;
    color: #94a3b8 !important;
}

.obs-kpi-icon {
    width: 28px !important;
    height: 28px !important;
    border-radius: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid var(--obs-border) !important;
    color: #94a3b8 !important;
    font-size: 0.95rem !important;
}

.obs-kpi-icon.emerald {
    color: #34d399 !important;
    background: rgba(16, 185, 129, 0.1) !important;
    border-color: rgba(16, 185, 129, 0.25) !important;
}

.obs-kpi-value {
    font-size: 1.7rem !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    letter-spacing: -0.03em !important;
    line-height: 1.15 !important;
    font-variant-numeric: tabular-nums !important;
}

.obs-kpi-bottom {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0.5rem !important;
    margin-top: 0.15rem !important;
}

.obs-kpi-pill {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.25rem !important;
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    padding: 0.2rem 0.55rem !important;
    border-radius: 999px !important;
    white-space: nowrap !important;
}

.obs-kpi-pill.emerald {
    background: rgba(16, 185, 129, 0.14) !important;
    color: #34d399 !important;
    border: 1px solid rgba(16, 185, 129, 0.28) !important;
}

.obs-kpi-pill.indigo {
    background: rgba(99, 102, 241, 0.16) !important;
    color: #a5b4fc !important;
    border: 1px solid rgba(129, 140, 248, 0.3) !important;
}

.obs-kpi-pill.muted {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #94a3b8 !important;
    border: 1px solid var(--obs-border) !important;
}

.obs-sparkline {
    width: 74px !important;
    height: 22px !important;
    flex-shrink: 0 !important;
    opacity: 0.9 !important;
}

.obs-kpi-sub {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0.4rem !important;
    flex-wrap: wrap !important;
    margin-top: 0.35rem !important;
    padding-top: 0.5rem !important;
    border-top: 1px solid rgba(255, 255, 255, 0.055) !important;
    font-size: 0.72rem !important;
    color: #64748b !important;
}

.obs-kpi-sub b {
    color: #cbd5e1 !important;
    font-weight: 600 !important;
}

/* ROW 2: Vencimentos (6 cards limpos com ponto colorido, sem barra lateral grossa) */
.obs-venc-grid {
    display: grid !important;
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    gap: 0.85rem !important;
}

.obs-venc-grid .venc-card {
    padding: 1rem 1.05rem !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.45rem !important;
    min-height: auto !important;
    cursor: pointer !important;
}

.obs-venc-grid .venc-top {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0.35rem !important;
    width: 100% !important;
}

.obs-venc-grid .venc-title {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.45rem !important;
    font-size: 0.8rem !important;
    font-weight: 500 !important;
    color: #cbd5e1 !important;
    white-space: nowrap !important;
}

.obs-dot {
    width: 8px !important;
    height: 8px !important;
    border-radius: 50% !important;
    display: inline-block !important;
    flex-shrink: 0 !important;
}

.obs-dot.dot-red { background: #f43f5e; box-shadow: 0 0 8px rgba(244, 63, 94, 0.7); }
.obs-dot.dot-rose { background: #fb7185; box-shadow: 0 0 8px rgba(251, 113, 133, 0.7); }
.obs-dot.dot-orange { background: #f97316; box-shadow: 0 0 8px rgba(249, 115, 22, 0.7); }
.obs-dot.dot-amber { background: #f59e0b; box-shadow: 0 0 8px rgba(245, 158, 11, 0.7); }
.obs-dot.dot-sky { background: #38bdf8; box-shadow: 0 0 8px rgba(56, 189, 248, 0.7); }
.obs-dot.dot-emerald { background: #10b981; box-shadow: 0 0 8px rgba(16, 185, 129, 0.7); }

.obs-venc-grid .venc-count {
    font-size: 1.65rem !important;
    font-weight: 700 !important;
    line-height: 1.15 !important;
    color: #ffffff !important;
}

.obs-venc-grid .venc-value {
    font-size: 0.78rem !important;
    color: #94a3b8 !important;
    font-weight: 500 !important;
}

/* ROW 3: Evolução Financeira (65%) + Recebimentos Hoje (35%) */
.obs-dash-bottom {
    display: grid !important;
    grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr) !important;
    gap: 1rem !important;
    align-items: stretch !important;
}

.obs-chart-panel,
.obs-receipts-panel {
    padding: 1.25rem !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.85rem !important;
    min-width: 0 !important;
}

.obs-panel-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0.75rem !important;
    flex-wrap: wrap !important;
}

.obs-panel-title {
    margin: 0 !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: #f8fafc !important;
    letter-spacing: -0.015em !important;
}

.obs-panel-sub {
    font-size: 0.75rem !important;
    color: #64748b !important;
}

.obs-prev-month-pill {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.45rem !important;
    font-size: 0.75rem !important;
    color: #94a3b8 !important;
    background: rgba(255, 255, 255, 0.035) !important;
    border: 1px solid var(--obs-border) !important;
    border-radius: 999px !important;
    padding: 0.28rem 0.75rem !important;
}

.obs-prev-month-pill strong {
    color: #f8fafc !important;
    font-variant-numeric: tabular-nums !important;
}

.obs-receipts-scroll {
    max-height: 260px !important;
    overflow-y: auto !important;
    overflow-x: auto !important;
}

/* Responsividade dos novos grids do Dashboard */
@media (max-width: 1280px) {
    .obs-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    .obs-venc-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
    .obs-dash-bottom {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 768px) {
    header.obs-topbar {
        padding-bottom: 0.75rem !important;
        margin-bottom: 1rem !important;
    }
    .obs-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.65rem !important;
    }
    .obs-kpi-card {
        padding: 0.85rem !important;
    }
    .obs-kpi-value {
        font-size: 1.2rem !important;
    }
    .obs-sparkline {
        display: none !important;
    }
    .obs-venc-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.65rem !important;
    }
    .obs-venc-grid .venc-card {
        padding: 0.85rem !important;
    }
    .obs-venc-grid .venc-count {
        font-size: 1.35rem !important;
    }
}

/* Suporte Light Mode para os novos componentes */
body.light-mode .obs-kpi-card,
body.light-mode .obs-topbar-actions .header-icon-btn,
body.light-mode .obs-version-pill {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05) !important;
}

body.light-mode .obs-kpi-value,
body.light-mode .obs-venc-grid .venc-count,
body.light-mode .obs-panel-title,
body.light-mode .obs-prev-month-pill strong {
    color: #0f172a !important;
}

body.light-mode .obs-venc-grid .venc-title,
body.light-mode .obs-kpi-sub b {
    color: #334155 !important;
}

body.light-mode .obs-kpi-sub {
    border-top-color: #f1f5f9 !important;
}

body.light-mode .obs-prev-month-pill {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
    color: #475569 !important;
}

/* ==========================================================================
   11. REPAGINAÇÃO COMPLETA DOS DEMAIS MENUS
       (Clientes, Mensagens, Histórico, Sistema, Painéis, Pagamentos, 2FA, Operações)
   ========================================================================== */

/* --- GESTÃO DE CLIENTES (Mockup 2) --- */
.obs-clients-shell {
    padding: 1.35rem !important;
}

.obs-clients-toolbar-top {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: wrap !important;
    gap: 0.85rem !important;
    margin-bottom: 1rem !important;
}

.obs-clients-search-wrap {
    flex: 1 1 280px !important;
    min-width: 220px !important;
    max-width: 440px !important;
}

.obs-clients-top-right {
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 0.65rem !important;
}

.obs-inline-pills {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    flex-wrap: wrap !important;
}

.obs-inline-pills .summary-mini-card {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.4rem !important;
    padding: 0.45rem 0.8rem !important;
    border-radius: 10px !important;
    background: #0a0e18 !important;
    border: 1px solid var(--obs-border) !important;
    min-width: auto !important;
    height: 36px !important;
    box-sizing: border-box !important;
}

.obs-inline-pills .summary-mini-card .label {
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    color: #94a3b8 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    margin: 0 !important;
}

.obs-inline-pills .summary-mini-card .value {
    font-size: 0.84rem !important;
    font-weight: 700 !important;
    color: #f8fafc !important;
    font-variant-numeric: tabular-nums !important;
}

.obs-inline-pills .summary-mini-card.lucro {
    background: rgba(16, 185, 129, 0.1) !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
}

.obs-inline-pills .summary-mini-card.lucro .value {
    color: #34d399 !important;
}

.obs-btn-new-client {
    flex: 0 0 auto !important;
    width: 36px !important;
    min-width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    font-size: 1.05rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.obs-btn-compact {
    flex: 0 0 auto !important;
    width: auto !important;
    height: 36px !important;
    padding: 0 0.95rem !important;
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    gap: 0.4rem !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.obs-clients-filter-row {
    margin-bottom: 1.15rem !important;
    padding-bottom: 1rem !important;
    border-bottom: 1px solid var(--obs-border) !important;
}

.obs-count-chip {
    flex: 0 0 auto !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.4rem !important;
    padding: 0.38rem 0.75rem !important;
    border-radius: 999px !important;
    background: rgba(99, 102, 241, 0.12) !important;
    border: 1px solid rgba(129, 140, 248, 0.28) !important;
    color: #a5b4fc !important;
    box-shadow: none !important;
}

/* --- MENSAGENS, CONFIGURAÇÕES, HISTÓRICO, PAINÉIS, PAGAMENTOS, 2FA, OPERAÇÕES --- */
#mensagens-tab .config-sidebar-nav .card,
#config-sistema-tab .config-sidebar-nav .card {
    padding: 0.55rem !important;
    gap: 0.25rem !important;
}

#mensagens-tab .config-main-area > div > .card,
#config-sistema-tab .config-main-area > div > .card,
#logs-tab > .card,
#panels-tab > .card,
#payment-gateway-tab .card,
#security-tab .card,
#manual-actions-tab .card {
    padding: 1.35rem !important;
}

/* Sub-blocos internos de Migração de Dados, Backup, WhatsApp Config, Gateway */
body.dark-mode #sub-geral .card > div[style*="border-radius: 16px"],
body.dark-mode #wa-config-body,
body.dark-mode #sub-backup .card > div[style*="border-radius"] {
    background: #0a0e18 !important;
    border: 1px solid var(--obs-border) !important;
    border-radius: 12px !important;
}

/* Gestor de Campos Padrão — linhas mais limpas */
body.dark-mode #options-manager-container .opt-item-row {
    background: rgba(255, 255, 255, 0.025) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 8px !important;
}

body.dark-mode #options-manager-container .opt-item-row:hover {
    background: rgba(99, 102, 241, 0.08) !important;
    border-color: rgba(129, 140, 248, 0.25) !important;
}

/* Responsividade Mobile para Clientes e demais menus */
@media (max-width: 768px) {
    .obs-clients-shell {
        padding: 0.9rem !important;
    }

    .obs-clients-search-wrap {
        flex: 0 0 auto !important;
        min-width: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    .obs-clients-top-right {
        width: 100% !important;
        justify-content: space-between !important;
    }

    .obs-inline-pills {
        width: 100% !important;
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 0.4rem !important;
    }

    .obs-inline-pills .summary-mini-card {
        flex-direction: column !important;
        align-items: flex-start !important;
        height: auto !important;
        padding: 0.5rem 0.6rem !important;
        gap: 0.15rem !important;
    }

    .obs-inline-pills .summary-mini-card .obs-dot {
        display: none !important;
    }

    .obs-btn-new-client {
        width: 40px !important;
        min-width: 40px !important;
        height: 40px !important;
    }
}

/* Light Mode para Clientes e demais menus */
body.light-mode .obs-inline-pills .summary-mini-card {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

body.light-mode .obs-inline-pills .summary-mini-card .value {
    color: #0f172a !important;
}

body.light-mode .obs-inline-pills .summary-mini-card.lucro {
    background: rgba(16, 185, 129, 0.09) !important;
    border-color: rgba(16, 185, 129, 0.28) !important;
}

body.light-mode .obs-inline-pills .summary-mini-card.lucro .value {
    color: #047857 !important;
}

body.light-mode .obs-count-chip {
    background: rgba(99, 102, 241, 0.1) !important;
    border-color: rgba(99, 102, 241, 0.25) !important;
    color: #4338ca !important;
}

/* Remove o submenu duplicado dentro de #config-sistema-tab no desktop
   (já que WhatsApp, Geral, Usuários e Backup estão direto na sidebar) */
@media (min-width: 769px) {
    #config-sistema-tab .config-sidebar-nav {
        display: none !important;
    }

    #config-sistema-tab .config-container {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 0 !important;
    }
}

/* --- PAINÉIS / SERVIDORES (#panels-tab): evita que botões e badges saiam do card --- */
#panels-list.panel-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)) !important;
    gap: 1.15rem !important;
    width: 100% !important;
}

#panels-list .panel-card {
    padding: 1.2rem !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
}

#panels-list .panel-card > div:first-child {
    gap: 0.65rem !important;
    align-items: flex-start !important;
}

#panels-list .panel-card > div:first-child > div:first-child {
    min-width: 0 !important;
    flex: 1 1 auto !important;
    gap: 0.75rem !important;
}

#panels-list .panel-card > div:first-child > div:first-child > div:first-child {
    flex-shrink: 0 !important;
}

#panels-list .panel-card > div:first-child > div:first-child > div:last-child {
    min-width: 0 !important;
    flex: 1 1 auto !important;
}

#panels-list .panel-card > div:first-child > div:first-child > div:last-child > div {
    flex-wrap: wrap !important;
    gap: 4px 6px !important;
}

#panels-list .panel-card > div:first-child p {
    max-width: 100% !important;
}

#panels-list .panel-card > div:first-child > div:last-child {
    flex-shrink: 0 !important;
    gap: 0.35rem !important;
}

@media (max-width: 768px) {
    #panels-list.panel-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}

/* ==========================================================================
   12. POPOVER MODERNO DE FILTROS AVANÇADOS (DINÂMICO EM CHIPS)
   ========================================================================== */
#dropdown-extra-filters {
    position: relative !important;
}

#dropdown-extra-filters.has-filters .dropdown-trigger,
#dropdown-extra-filters.active .dropdown-trigger {
    background: rgba(99, 102, 241, 0.2) !important;
    border-color: #818cf8 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    box-shadow: 0 0 14px -3px rgba(99, 102, 241, 0.45) !important;
}

#custom-dropdown-menu.obs-filters-popover {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    right: 0 !important;
    left: auto !important;
    width: 470px !important;
    max-width: calc(100vw - 24px) !important;
    max-height: 74vh !important;
    overflow-y: auto !important;
    padding: 1rem 1.1rem !important;
    background: #0d121e !important;
    border: 1px solid rgba(255, 255, 255, 0.13) !important;
    border-radius: 14px !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 24px 60px rgba(0, 0, 0, 0.72) !important;
    z-index: 9999 !important;
    box-sizing: border-box !important;
}

.obs-ef-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding-bottom: 0.75rem !important;
    margin-bottom: 0.85rem !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.obs-ef-title {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.45rem !important;
    font-size: 0.84rem !important;
    font-weight: 700 !important;
    color: #f8fafc !important;
}

.obs-ef-title i {
    color: #818cf8 !important;
}

.obs-ef-clear {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.3rem !important;
    padding: 0.25rem 0.65rem !important;
    border-radius: 999px !important;
    background: rgba(244, 63, 94, 0.12) !important;
    border: 1px solid rgba(244, 63, 94, 0.28) !important;
    color: #fda4af !important;
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    opacity: 0.45 !important;
    transition: all 0.15s ease !important;
}

.obs-ef-clear.visible {
    opacity: 1 !important;
}

.obs-ef-clear:hover {
    background: rgba(244, 63, 94, 0.22) !important;
    color: #fff1f2 !important;
}

.obs-ef-section {
    margin-bottom: 0.9rem !important;
}

.obs-ef-section:last-child {
    margin-bottom: 0 !important;
}

.obs-ef-label {
    display: block !important;
    font-size: 0.68rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    color: #64748b !important;
    margin-bottom: 0.45rem !important;
}

.obs-ef-chips {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.4rem !important;
}

.obs-ef-chip {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
    padding: 0.36rem 0.72rem !important;
    border-radius: 999px !important;
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.09) !important;
    color: #cbd5e1 !important;
    font-size: 0.76rem !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    white-space: nowrap !important;
}

.obs-ef-chip:hover {
    background: rgba(255, 255, 255, 0.09) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
}

.obs-ef-chip.active {
    background: rgba(99, 102, 241, 0.24) !important;
    border-color: #818cf8 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    box-shadow: 0 0 12px -2px rgba(99, 102, 241, 0.45) !important;
}

@media (max-width: 768px) {
    #custom-dropdown-menu.obs-filters-popover {
        position: fixed !important;
        top: auto !important;
        bottom: calc(74px + env(safe-area-inset-bottom, 0px)) !important;
        left: 12px !important;
        right: 12px !important;
        width: auto !important;
        max-width: none !important;
        max-height: 68vh !important;
    }
}

/* Light Mode */
body.light-mode #custom-dropdown-menu.obs-filters-popover {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.16) !important;
}

body.light-mode .obs-ef-header {
    border-bottom-color: #e2e8f0 !important;
}

body.light-mode .obs-ef-title {
    color: #0f172a !important;
}

body.light-mode .obs-ef-chip {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #334155 !important;
}

body.light-mode .obs-ef-chip:hover {
    background: #e2e8f0 !important;
    color: #0f172a !important;
}

body.light-mode .obs-ef-chip.active {
    background: rgba(99, 102, 241, 0.15) !important;
    border-color: #6366f1 !important;
    color: #312e81 !important;
    box-shadow: none !important;
}

body.light-mode #dropdown-extra-filters.has-filters .dropdown-trigger {
    background: rgba(99, 102, 241, 0.14) !important;
    border-color: #6366f1 !important;
    color: #312e81 !important;
    box-shadow: none !important;
}

/* ==========================================================================
   13. POLIMENTO COMPLETO DO MODO CLARO (100% LEGÍVEL EM TODOS OS MENUS)
   ========================================================================== */
body.light-mode {
    --obs-bg: #f8fafc;
    --obs-sidebar: #ffffff;
    --obs-surface: #ffffff;
    --obs-surface-2: #f8fafc;
    --obs-border: #e2e8f0;
    --obs-border-hover: #cbd5e1;
    --obs-sheen: none;
    --obs-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

body.light-mode main.content > header.obs-topbar,
body.light-mode header.obs-topbar {
    background: rgba(255, 255, 255, 0.94) !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

body.light-mode header.obs-topbar h1#page-title {
    color: #0f172a !important;
}

body.light-mode aside.sidebar .obs-sidebar-logo {
    border-bottom-color: #e2e8f0 !important;
}

body.light-mode .sidebar nav .nav-item {
    color: #475569 !important;
}

body.light-mode .sidebar nav .nav-item:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}

body.light-mode .sidebar nav .nav-item.active {
    background: rgba(99, 102, 241, 0.11) !important;
    color: #4338ca !important;
    border-color: rgba(99, 102, 241, 0.25) !important;
    box-shadow: inset 2px 0 0 #6366f1 !important;
}

body.light-mode .sidebar nav .nav-item.active i {
    color: #4f46e5 !important;
}

body.light-mode .card .card,
body.light-mode #msg-cobrancas-body .card,
body.light-mode #msg-templates-body .card,
body.light-mode #options-manager-container .opt-modern-card,
body.light-mode #wa-config-body {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
}

body.light-mode .config-sidebar-nav .card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-mode .config-nav-btn,
body.light-mode .msg-nav-btn {
    color: #475569 !important;
}

body.light-mode .config-nav-btn:hover,
body.light-mode .msg-nav-btn:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}

body.light-mode .config-nav-btn.active-highlight,
body.light-mode .msg-nav-btn.active-highlight {
    background: #6366f1 !important;
    color: #ffffff !important;
}

body.light-mode table,
body.light-mode table tbody,
body.light-mode table tbody tr,
body.light-mode table tbody td {
    background: #ffffff !important;
    color: #1e293b !important;
}

body.light-mode table tbody tr:hover td {
    background: #f8fafc !important;
}

body.light-mode table thead,
body.light-mode table thead tr,
body.light-mode table thead th {
    background: #f8fafc !important;
    color: #475569 !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

body.light-mode input[type="text"],
body.light-mode input[type="password"],
body.light-mode input[type="email"],
body.light-mode input[type="number"],
body.light-mode input[type="date"],
body.light-mode input[type="time"],
body.light-mode input[type="search"],
body.light-mode input[type="url"],
body.light-mode textarea,
body.light-mode select,
body.light-mode .custom-input,
body.light-mode .custom-select {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}

body.light-mode .btn.secondary,
body.light-mode button.btn.secondary {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #1e293b !important;
}

body.light-mode .btn.secondary:hover,
body.light-mode button.btn.secondary:hover {
    background: #e2e8f0 !important;
}

body.light-mode .obs-avatar-btn {
    background: #eef2ff !important;
    border-color: #c7d2fe !important;
    color: #4338ca !important;
}

body.light-mode .obs-avatar-dot,
body.light-mode .obs-wa-mini-dot {
    border-color: #ffffff !important;
}

body.light-mode .obs-wa-monitor-btn {
    color: #059669 !important;
}

body.light-mode .obs-wa-monitor-btn.offline {
    color: #e11d48 !important;
}

body.light-mode .obs-venc-grid .venc-badge {
    background: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
    color: #475569 !important;
}

body.light-mode .obs-venc-grid .venc-value {
    color: #64748b !important;
}

body.light-mode #dropdown-extra-filters .dropdown-trigger {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #334155 !important;
}

/* ==========================================================================
   14. TELA WHATSAPP LADO A LADO (CONEXÃO/QR CODE À ESQUERDA + ANTI-CHAMADA À DIREITA)
   ========================================================================== */
#sub-whatsapp-config > .card {
    display: grid !important;
    grid-template-columns: minmax(300px, 1fr) minmax(0, 1.45fr) !important;
    gap: 1.25rem !important;
    align-items: stretch !important;
    padding: 1.25rem 1.4rem !important;
}

#sub-whatsapp-config > .card > div:first-child {
    grid-column: 1 / -1 !important;
    margin-bottom: 0.25rem !important;
}

#wa-config-body {
    padding: 1.4rem 1.25rem !important;
    min-height: 290px !important;
    border-radius: 14px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
}

#wa-connected-container {
    width: 100% !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.65rem !important;
    text-align: center !important;
}

#wa-connected-container > div:first-child {
    width: 60px !important;
    height: 60px !important;
    min-width: 60px !important;
    font-size: 2.2rem !important;
    margin-bottom: 0.25rem !important;
}

#wa-connected-container > h4 {
    margin: 0 !important;
    font-size: 1.08rem !important;
}

#wa-connected-container > p {
    margin: 0 0 0.75rem 0 !important;
    font-size: 0.82rem !important;
    max-width: 340px !important;
    line-height: 1.45 !important;
}

#wa-connected-container > button {
    width: 100% !important;
    max-width: 240px !important;
    height: 38px !important;
    padding: 0 1rem !important;
    font-size: 0.82rem !important;
}

#sub-whatsapp-config > .card > div:last-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
    border-top: none !important;
    display: flex !important;
    flex-direction: column !important;
    min-width: 0 !important;
}

#sub-whatsapp-config > .card > div:last-child > h4 {
    margin: 0 0 0.65rem 0 !important;
    font-size: 0.9rem !important;
}

#sub-whatsapp-config > .card > div:last-child > div {
    padding: 1.15rem 1.25rem !important;
    border-radius: 14px !important;
    box-shadow: none !important;
    flex: 1 !important;
}

#sub-whatsapp-config > .card > div:last-child > div > div:first-child {
    margin-bottom: 0.95rem !important;
}

#sub-whatsapp-config textarea {
    min-height: 76px !important;
    height: 80px !important;
    padding: 0.7rem 0.9rem !important;
    font-size: 0.84rem !important;
}

body.light-mode #sub-whatsapp-config h3,
body.light-mode #sub-whatsapp-config h4 {
    color: #0f172a !important;
}

@media (max-width: 1024px) {
    #sub-whatsapp-config > .card {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    #wa-config-body {
        min-height: auto !important;
    }
}

/* ==========================================================================
   15. GATEWAY DE PAGAMENTOS — 3 CARDS LADO A LADO EM UMA ÚNICA LINHA
   ========================================================================== */
#payment-gateway-tab > div {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 1.15rem !important;
    align-items: stretch !important;
}

#payment-gateway-tab > div > div:first-child {
    grid-column: 1 / -1 !important;
    margin-bottom: 0.25rem !important;
}

#payment-gateway-tab > div > .card {
    margin-bottom: 0 !important;
    padding: 1.25rem !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
}

/* Dentro do card Status dos Gateways, empilha os 2 mini-cards para ficar folgado na coluna */
#payment-gateway-tab #gw-status-cards,
#payment-gateway-tab > div > .card:nth-of-type(2) > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
}

/* Botão salvar e rodapé do card Gateway Ativo bem ajustados */
#payment-gateway-tab > div > .card:nth-of-type(3) > div:last-child {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
    margin-top: auto !important;
}

/* Scroll interno suave no Histórico de Alterações para manter altura uniforme */
#payment-gateway-tab #gw-audit-list,
#payment-gateway-tab > div > .card:last-of-type > div:last-child {
    max-height: 280px !important;
    overflow-y: auto !important;
}

@media (max-width: 1100px) {
    #payment-gateway-tab > div {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}

/* ==========================================================================
   16. SCROLLBARS DISCRETAS E ESCURAS EM TODO O SISTEMA
   ========================================================================== */
html,
body.dark-mode {
    color-scheme: dark;
}

body.light-mode {
    color-scheme: light;
}

body.dark-mode * {
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.24) transparent;
}

body.light-mode * {
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 116, 139, 0.28) transparent;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.24);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.45);
}

::-webkit-scrollbar-corner {
    background: transparent;
}

/* ==========================================================================
   17. MONITORES DISCRETOS NO RODAPÉ DA SIDEBAR (INFRA + WHATSAPP)
   ========================================================================== */
.obs-sidebar-monitors {
    margin-top: auto !important;
    padding: 0.75rem 1rem !important;
    border-top: 1px solid var(--obs-border) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.85rem !important;
}

.obs-monitor-icon-btn,
body.dark-mode #infra-status-mini.obs-monitor-icon-btn,
body.light-mode #infra-status-mini.obs-monitor-icon-btn {
    position: relative !important;
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 10px !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.2rem !important;
    color: #94a3b8 !important;
    cursor: pointer !important;
    transition: background 0.16s ease, color 0.16s ease, transform 0.14s ease !important;
}

.obs-monitor-icon-btn:hover,
body.dark-mode #infra-status-mini.obs-monitor-icon-btn:hover {
    background: rgba(255, 255, 255, 0.06) !important;
    color: #ffffff !important;
}

body.light-mode .obs-monitor-icon-btn:hover,
body.light-mode #infra-status-mini.obs-monitor-icon-btn:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}

.obs-monitor-icon-btn .obs-mon-dot {
    position: absolute !important;
    top: 6px !important;
    right: 6px !important;
    width: 7px !important;
    height: 7px !important;
    border-radius: 50% !important;
    background: #10b981 !important;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.85) !important;
    border: 1.5px solid #080b12 !important;
}

.obs-monitor-icon-btn.status-offline .obs-mon-dot,
.obs-monitor-icon-btn.offline .obs-mon-dot {
    background: #f43f5e !important;
    box-shadow: 0 0 6px rgba(244, 63, 94, 0.85) !important;
}

.obs-monitor-icon-btn.status-degraded .obs-mon-dot,
.obs-monitor-icon-btn.connecting .obs-mon-dot {
    background: #f59e0b !important;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.85) !important;
}

body.light-mode .obs-monitor-icon-btn .obs-mon-dot {
    border-color: #ffffff !important;
}
