/* ==========================================================================
   PERFEX CRM - MODERN & DARK THEME CSS
   ========================================================================== */

:root {
    --modern-radius-sm: 6px;
    --modern-radius-md: 10px;
    --modern-radius-lg: 14px;
    --modern-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Light Mode */
    --modern-sidebar-bg: #ecf2ff;
    --modern-sidebar-hover: rgba(37, 99, 235, 0.08);
    --modern-sidebar-active: #2563eb;
    --modern-sidebar-text: #334155;
    --modern-sidebar-text-active: #1e3a8a;
    --modern-card-bg: #ffffff;
    --modern-card-border: #e2e8f0;
    --modern-settings-panel-bg: var(--modern-card-bg);
    --modern-settings-panel-border: var(--modern-card-border);
    --modern-settings-title: var(--modern-sidebar-text);
    --modern-settings-section: #64748b;
    --modern-settings-link: #475569;
    --modern-settings-icon: #64748b;
    --modern-settings-hover-bg: var(--modern-sidebar-hover);
    --modern-settings-hover-text: var(--modern-sidebar-text-active);
    --modern-settings-active-bg: var(--modern-sidebar-active);
    --modern-settings-active-text: #ffffff;
    --modern-settings-help: #64748b;
    --modern-settings-tab-indicator: var(--modern-sidebar-active);
}

/* ==========================================================================
   1. MODERN LIGHT THEME REFINEMENT
   ========================================================================== */

/* Menu Lateral Moderno (Sidebar) */
#menu.sidebar {
    background-color: var(--modern-sidebar-bg) !important;
    border-right: 1px solid #dbeafe !important;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.04);
}

#side-menu {
    padding: 0 10px 20px 10px;
}

#side-menu > li > a {
    color: var(--modern-sidebar-text) !important;
    border-radius: var(--modern-radius-md) !important;
    margin-bottom: 4px;
    padding: 10px 14px !important;
    font-weight: 500;
    transition: var(--modern-transition);
    display: flex;
    align-items: center;
}

#side-menu > li > a:hover,
#side-menu > li.active > a,
#side-menu > li.open > a {
    background: var(--modern-sidebar-hover) !important;
    color: var(--modern-sidebar-text-active) !important;
}

#side-menu > li.active > a {
    background: var(--modern-sidebar-active) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

#side-menu .menu-icon {
    font-size: 16px;
    width: 24px;
    margin-right: 10px;
    text-align: center;
    color: inherit !important;
}

#side-menu ul.nav-second-level {
    background: rgba(37, 99, 235, 0.04) !important;
    border-radius: var(--modern-radius-md);
    margin: 4px 0 8px 12px;
    padding: 6px;
    border-left: 1px solid #bfdbfe;
}

#side-menu ul.nav-second-level li a {
    color: #475569 !important;
    border-radius: var(--modern-radius-sm);
    padding: 8px 12px;
    font-size: 13px;
    transition: var(--modern-transition);
}

#side-menu ul.nav-second-level li a:hover,
#side-menu ul.nav-second-level li.active a {
    color: #1e3a8a !important;
    background: rgba(37, 99, 235, 0.1) !important;
}

/* Card de perfil na Sidebar */
.sidebar-user-profile .profile {
    background: #ffffff !important;
    border: 1px solid #dbeafe !important;
    border-radius: var(--modern-radius-md) !important;
    color: #1e293b !important;
    padding: 10px 12px !important;
    transition: var(--modern-transition);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.sidebar-user-profile .profile:hover {
    background: #f8fafc !important;
    border-color: #bfdbfe !important;
}


/* Header */
#header {
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

#header #search_input {
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: var(--modern-radius-md) !important;
    transition: var(--modern-transition);
}

#header #search_input:focus {
    background: #ffffff !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
}

/* Cards & Panels */
.panel_s,
.panel-default,
.panel {
    border-radius: var(--modern-radius-lg) !important;
    border: 1px solid var(--modern-card-border) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02) !important;
}

.top_stats_wrapper {
    border-radius: var(--modern-radius-md) !important;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
    transition: var(--modern-transition);
}

/* Inputs & Botões */
.form-control {
    border-radius: var(--modern-radius-sm) !important;
    border: 1px solid #cbd5e1;
    transition: var(--modern-transition);
}

.form-control:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
}

.btn {
    border-radius: var(--modern-radius-sm) !important;
    font-weight: 500;
    transition: var(--modern-transition);
}

.btn-primary {
    background-color: #2563eb !important;
    border-color: #2563eb !important;
}


/* ==========================================================================
   2. DARK THEME COMPLETE OVERHAUL (.dark-theme)
   ========================================================================== */

html.dark-theme,
body.dark-theme {
    background-color: #0b0f19 !important;
    color: #f1f5f9 !important;
}

body.dark-theme #wrapper,
body.dark-theme #content {
    background-color: #0b0f19 !important;
    color: #f1f5f9 !important;
}

/* Header no Dark Mode */
body.dark-theme #header {
    background: #0f172a !important;
    border-bottom: 1px solid #1e293b !important;
    color: #f1f5f9 !important;
}

body.dark-theme #header .hide-menu {
    color: #94a3b8 !important;
}

body.dark-theme #header .hide-menu:hover {
    color: #ffffff !important;
    background: #1e293b !important;
}

body.dark-theme #header #search_input {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}

body.dark-theme #header #search_input::placeholder {
    color: #64748b !important;
}

body.dark-theme #header .navbar-nav > li > a {
    color: #94a3b8 !important;
}

body.dark-theme #header .navbar-nav > li > a:hover {
    color: #ffffff !important;
}

body.dark-theme {
    --modern-settings-panel-bg: #151c2c;
    --modern-settings-panel-border: #243049;
    --modern-settings-title: #f8fafc;
    --modern-settings-section: #93c5fd;
    --modern-settings-link: #e5e7eb;
    --modern-settings-icon: #cbd5e1;
    --modern-settings-hover-bg: #1e293b;
    --modern-settings-hover-text: #ffffff;
    --modern-settings-active-bg: #2563eb;
    --modern-settings-active-text: #ffffff;
    --modern-settings-help: #cbd5e1;
    --modern-settings-tab-indicator: #3b82f6;
}

/* Sidebar no Dark Mode */
body.dark-theme #menu.sidebar {
    background-color: #080c14 !important;
    border-right: 1px solid #1e293b !important;
}

body.dark-theme #side-menu > li > a {
    color: #94a3b8 !important;
}

body.dark-theme #side-menu > li > a:hover,
body.dark-theme #side-menu > li.open > a {
    background: #1e293b !important;
    color: #ffffff !important;
}

body.dark-theme #side-menu > li.active > a {
    background: #2563eb !important;
    color: #ffffff !important;
}

body.dark-theme #side-menu ul.nav-second-level {
    background: #0b0f19 !important;
    border-left-color: #334155 !important;
}

body.dark-theme #side-menu ul.nav-second-level li a:hover {
    background: #1e293b !important;
    color: #ffffff !important;
}

/* Menu de Definições (setup menu) no Dark Mode: o wrapper não tem #menu, então não herda as regras acima */
body.dark-theme #setup-menu-wrapper.sidebar {
    background-color: #080c14 !important;
    border-right: 1px solid #1e293b !important;
}

body.dark-theme #setup-menu > li:first-child {
    color: #e2e8f0 !important;
    border-bottom-color: #1e293b !important;
}

body.dark-theme #setup-menu-wrapper .close-customizer,
body.dark-theme #setup-menu-wrapper .customizer-heading {
    color: #94a3b8 !important;
}

body.dark-theme #setup-menu > li > a {
    color: #94a3b8 !important;
}

body.dark-theme #setup-menu > li > a:hover,
body.dark-theme #setup-menu > li > a:focus,
body.dark-theme #setup-menu > li.open > a {
    background: #1e293b !important;
    color: #ffffff !important;
}

body.dark-theme #setup-menu > li.active > a {
    background: #2563eb !important;
    color: #ffffff !important;
}

body.dark-theme #setup-menu ul.nav-second-level {
    background: #0b0f19 !important;
    border-left-color: #334155 !important;
}

body.dark-theme #setup-menu ul.nav-second-level li a {
    color: #94a3b8 !important;
}

body.dark-theme #setup-menu ul.nav-second-level li a:hover,
body.dark-theme #setup-menu ul.nav-second-level li.active a {
    background: #1e293b !important;
    color: #ffffff !important;
}

/* Panels, Cards e Widgets no Dark Mode */
body.dark-theme .panel_s,
body.dark-theme .panel-default,
body.dark-theme .panel,
body.dark-theme .widget,
body.dark-theme .stats-well {
    background-color: #151c2c !important;
    border-color: #243049 !important;
    color: #f1f5f9 !important;
}

body.dark-theme .panel-heading,
body.dark-theme .panel-footer {
    background-color: #101725 !important;
    border-color: #243049 !important;
    color: #f1f5f9 !important;
}

body.dark-theme .panel-body {
    background-color: #151c2c !important;
    color: #cbd5e1 !important;
}

/* Cards de estatísticas e métricas (Dashboard & SaaS) */
body.dark-theme .top_stats_wrapper {
    background-color: #1a2333 !important;
    border-color: #2d3b55 !important;
    color: #f1f5f9 !important;
}

body.dark-theme .top_stats_wrapper:hover {
    border-color: #3b82f6 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

body.dark-theme .top_stats_wrapper svg {
    color: #94a3b8 !important;
}

body.dark-theme .tw-bg-white {
    background-color: #1a2333 !important;
    border-color: #2d3b55 !important;
    color: #f1f5f9 !important;
}

body.dark-theme hr {
    border-color: #243049 !important;
}

/* Textos e Utilitários Tailwind no Dark Mode */
body.dark-theme .tw-text-neutral-800,
body.dark-theme .tw-text-neutral-700,
body.dark-theme .tw-text-neutral-600,
body.dark-theme .tw-text-neutral-500,
body.dark-theme .text-neutral-600,
body.dark-theme .text-neutral-700,
body.dark-theme .text-neutral-800 {
    color: #f1f5f9 !important;
}

body.dark-theme .tw-text-neutral-400 {
    color: #94a3b8 !important;
}

body.dark-theme h1, 
body.dark-theme h2, 
body.dark-theme h3, 
body.dark-theme h4, 
body.dark-theme h5, 
body.dark-theme h6,
body.dark-theme .text-dark,
body.dark-theme strong,
body.dark-theme b {
    color: #f8fafc !important;
}

body.dark-theme p,
body.dark-theme span,
body.dark-theme label,
body.dark-theme .text-muted {
    color: #cbd5e1 !important;
}

body.dark-theme a {
    color: #60a5fa;
}

body.dark-theme a:hover {
    color: #93c5fd;
}

/* Barras de progresso */
body.dark-theme .progress {
    background-color: #0b0f19 !important;
    border: 1px solid #243049;
}

/* Botões no Dark Mode */
body.dark-theme .btn-default,
body.dark-theme .btn-white {
    background-color: #1a2333 !important;
    border-color: #2d3b55 !important;
    color: #f1f5f9 !important;
}

body.dark-theme .btn-default:hover,
body.dark-theme .btn-white:hover {
    background-color: #243049 !important;
    border-color: #3b82f6 !important;
    color: #ffffff !important;
}

/* Formulários e Inputs no Dark Mode */
body.dark-theme .form-control,
body.dark-theme select,
body.dark-theme textarea,
body.dark-theme .input-group-addon {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

body.dark-theme .form-control:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25) !important;
}

body.dark-theme .bootstrap-select > .btn-default {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

/* Dropdowns no Dark Mode */
body.dark-theme .dropdown-menu {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5) !important;
}

body.dark-theme .dropdown-menu > li > a {
    color: #cbd5e1 !important;
}

body.dark-theme .dropdown-menu > li > a:hover,
body.dark-theme .dropdown-menu > li > a:focus {
    background-color: #334155 !important;
    color: #ffffff !important;
}

body.dark-theme .dropdown-divider,
body.dark-theme .dropdown-menu .divider {
    background-color: #334155 !important;
}

/* Modais no Dark Mode */
body.dark-theme .modal-content {
    background-color: #151c2c !important;
    border: 1px solid #334155 !important;
    color: #f8fafc !important;
}

body.dark-theme .modal-header {
    border-bottom: 1px solid #243049 !important;
}

body.dark-theme .modal-footer {
    background-color: #101725 !important;
    border-top: 1px solid #243049 !important;
}

body.dark-theme .close {
    color: #cbd5e1 !important;
    text-shadow: none !important;
}

/* Tabelas e DataTables no Dark Mode */
body.dark-theme .table,
body.dark-theme .table > thead > tr > th,
body.dark-theme .table > tbody > tr > th,
body.dark-theme .table > tfoot > tr > th,
body.dark-theme .table > thead > tr > td,
body.dark-theme .table > tbody > tr > td,
body.dark-theme .table > tfoot > tr > td,
body.dark-theme .dataTables_wrapper {
    background-color: #151c2c !important;
    border-color: #243049 !important;
    color: #cbd5e1 !important;
}

body.dark-theme .table > thead > tr > th {
    background-color: #101725 !important;
    color: #f8fafc !important;
}

body.dark-theme .table-striped > tbody > tr:nth-of-type(odd) {
    background-color: #101725 !important;
}

body.dark-theme .table-hover > tbody > tr:hover {
    background-color: #1e293b !important;
}

body.dark-theme .dataTables_info,
body.dark-theme .dataTables_length,
body.dark-theme .dataTables_filter {
    color: #94a3b8 !important;
}

/* Clientes: texto e controles legíveis sem alterar outras telas. */
body.dark-theme .clients-list-page #clients > tbody > tr > td {
    color: #f1f5f9 !important;
}

body.dark-theme .clients-list-page #clients > tbody > tr > td .text-muted,
body.dark-theme .clients-list-page .text-muted,
body.dark-theme .clients-list-page .dataTables_info,
body.dark-theme .clients-list-page .dataTables_length,
body.dark-theme .clients-list-page .dataTables_filter,
body.dark-theme .clients-list-page .dataTables_paginate {
    color: #e2e8f0 !important;
}

body.dark-theme .clients-list-page .tw-grid > div > span:first-child {
    color: #f8fafc !important;
}

body.dark-theme .clients-list-page .tw-grid > div > .text-success {
    color: #86efac !important;
}

body.dark-theme .clients-list-page .tw-grid > div > .text-danger {
    color: #fca5a5 !important;
}

body.dark-theme .clients-list-page .tw-grid > div > .text-info {
    color: #7dd3fc !important;
}

body.dark-theme .clients-list-page .form-control,
body.dark-theme .clients-list-page .dataTables_filter input {
    background-color: #0f172a !important;
    border-color: #475569 !important;
    color: #f8fafc !important;
}

body.dark-theme .clients-list-page .form-control::placeholder,
body.dark-theme .clients-list-page .dataTables_filter input::placeholder {
    color: #cbd5e1 !important;
    opacity: 1;
}

body.dark-theme .pagination > li > a,
body.dark-theme .pagination > li > span {
    background-color: #101725 !important;
    border-color: #243049 !important;
    color: #94a3b8 !important;
}

body.dark-theme .pagination > .active > a,
body.dark-theme .pagination > .active > a:hover {
    background-color: #2563eb !important;
    border-color: #2563eb !important;
    color: #ffffff !important;
}

/* Tabs */
body.dark-theme .nav-tabs {
    border-bottom: 1px solid #243049 !important;
}

body.dark-theme .nav-tabs > li > a {
    color: #94a3b8 !important;
    border-color: transparent !important;
}

body.dark-theme .nav-tabs > li > a:hover {
    background-color: #1e293b !important;
    color: #f8fafc !important;
}

body.dark-theme .nav-tabs > li.active > a,
body.dark-theme .nav-tabs > li.active > a:focus,
body.dark-theme .nav-tabs > li.active > a:hover {
    background-color: #151c2c !important;
    border-color: #243049 #243049 transparent !important;
    color: #38bdf8 !important;
}

/* Alertas & Badges */
body.dark-theme .alert-info {
    background-color: rgba(14, 165, 233, 0.15) !important;
    border-color: rgba(14, 165, 233, 0.3) !important;
    color: #38bdf8 !important;
}

body.dark-theme .alert-warning {
    background-color: rgba(245, 158, 11, 0.15) !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
    color: #fbbf24 !important;
}

body.dark-theme .alert-success {
    background-color: rgba(16, 185, 129, 0.15) !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
    color: #34d399 !important;
}

body.dark-theme .alert-danger {
    background-color: rgba(239, 68, 68, 0.15) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
    color: #f87171 !important;
}

/* Botão Toggle */
.header-theme-toggle a {
    outline: none !important;
}

.header-theme-toggle .theme-icon-container {
    cursor: pointer;
    transition: var(--modern-transition);
}

.header-theme-toggle .theme-icon-container:hover {
    transform: scale(1.08);
}

/* ==========================================================================
   CRM KANBAN & PIPELINES (DARK THEME)
   ========================================================================== */
body.dark-theme .crm-kanban-board {
    padding-bottom: 15px;
}

body.dark-theme .crm-kanban-column {
    background: #111827 !important;
    border: 1px solid #243049 !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25) !important;
}

body.dark-theme .crm-kanban-column-header {
    background: #182337 !important;
    border-bottom: 1px solid #243049 !important;
}

body.dark-theme .crm-kanban-column-header strong {
    color: #ffffff !important;
    font-size: 14px;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

body.dark-theme .crm-kanban-column-header small {
    color: #94a3b8 !important;
}

body.dark-theme .crm-kanban-dropzone {
    background: transparent !important;
}

body.dark-theme .crm-kanban-dropzone.drag-over {
    background-color: rgba(59, 130, 246, 0.15) !important;
    border: 2px dashed #3b82f6 !important;
}

body.dark-theme .crm-kanban-card {
    background: #1a2333 !important;
    border: 1px solid #2d3b55 !important;
    border-top: 2px solid #3b82f6 !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25) !important;
    color: #e2e8f0 !important;
}

body.dark-theme .crm-kanban-card:hover {
    background: #202d44 !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35) !important;
}

body.dark-theme .crm-kanban-card a.tw-font-semibold,
body.dark-theme .crm-kanban-card a.tw-text-neutral-900,
body.dark-theme .crm-kanban-card .tw-font-semibold {
    color: #f8fafc !important;
}

body.dark-theme .crm-kanban-card a.tw-font-semibold:hover {
    color: #60a5fa !important;
}

body.dark-theme .crm-kanban-card .text-muted,
body.dark-theme .crm-kanban-card .tw-text-xs,
body.dark-theme .crm-kanban-card [class*="tw-text-neutral"] {
    color: #94a3b8 !important;
}

body.dark-theme .crm-kanban-card .font-bold.text-neutral-700,
body.dark-theme .crm-kanban-card #timer_display {
    color: #cbd5e1 !important;
}

body.dark-theme .crm-kanban-card .tw-border-slate-100 {
    border-color: #243049 !important;
}

body.dark-theme .crm-kanban-card .btn-default {
    background: #243049 !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

body.dark-theme .crm-kanban-card .btn-default:hover {
    background: #2d3b55 !important;
    color: #ffffff !important;
}

/* ==========================================================================
   CLIENT PORTAL SIDEBAR & CARDS (Estilo Admin no Portal do Cliente)
   ========================================================================== */

@media (min-width: 768px) {
    body.customers.logged-in {
        background-color: #f8fafc;
    }
    
    body.customers.logged-in aside#menu.client-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        width: 250px;
        z-index: 1000;
        background-color: #ffffff;
        border-right: 1px solid #e2e8f0;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.03);
        overflow-y: auto;
        transition: transform 0.2s ease-in-out;
    }

    body.customers.logged-in.sidebar-collapsed aside#menu.client-sidebar {
        transform: translateX(-250px);
    }

    body.customers.logged-in .client-top-header {
        position: fixed;
        top: 0;
        right: 0;
        left: 250px;
        height: 60px;
        z-index: 999;
        background-color: #ffffff;
        border-bottom: 1px solid #e2e8f0;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
        margin: 0;
        border-radius: 0;
        display: flex;
        align-items: center;
        transition: left 0.2s ease-in-out;
    }

    body.customers.logged-in.sidebar-collapsed .client-top-header {
        left: 0;
    }

    body.customers.logged-in #wrapper {
        margin-left: 250px;
        margin-top: 60px;
        padding: 24px;
        min-height: calc(100vh - 60px);
    }

    body.customers.logged-in.sidebar-collapsed #wrapper {
        margin-left: 0;
    }
}

/* Telas de Login / Não autenticadas */
body.customers.not-logged-in,
body.customers:not(.logged-in) {
    background-color: #f8fafc;
    overflow-x: hidden;
}

body.customers.not-logged-in #wrapper,
body.customers:not(.logged-in) #wrapper {
    margin: 0 auto !important;
    padding: 10px 15px !important;
    min-height: auto !important;
    max-width: 100% !important;
}

body.customers.not-logged-in .navbar.header,
body.customers:not(.logged-in) .navbar.header {
    margin-bottom: 0 !important;
    border-radius: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

body.customers.not-logged-in .login-wrapper {
    margin-top: 15px;
    margin-bottom: 15px;
}

body.customers.not-logged-in .login-heading {
    margin-bottom: 15px;
}

@media (max-width: 767px) {
    body.customers aside#menu.client-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: -260px;
        width: 260px;
        z-index: 1050;
        background-color: #ffffff;
        border-right: 1px solid #e2e8f0;
        box-shadow: 4px 0 16px rgba(0,0,0,0.1);
        overflow-y: auto;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    body.customers.sidebar-open aside#menu.client-sidebar {
        left: 0;
    }

    body.customers .client-top-header {
        height: 60px;
        background: #ffffff;
        border-bottom: 1px solid #e2e8f0;
        margin: 0;
    }

    body.customers #wrapper {
        padding: 15px;
    }
}

.client-sidebar-brand {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
}

.client-sidebar #side-menu {
    padding: 12px 10px;
    list-style: none;
    margin: 0;
}

.client-sidebar #side-menu > li > a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: #475569;
    font-weight: 500;
    font-size: 14px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.15s ease;
    margin-bottom: 3px;
}

.client-sidebar #side-menu > li > a:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}

.client-sidebar #side-menu > li.active > a {
    background-color: #2563eb;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.client-sidebar #side-menu > li.active > a i {
    color: #ffffff !important;
}

.client-sidebar #side-menu .menu-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
    color: #64748b;
}

/* Cards Interativos do Dashboard */
.client-quick-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.client-card-item {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s ease-in-out;
    text-decoration: none !important;
    color: inherit;
    position: relative;
    overflow: hidden;
}

.client-card-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.06);
    border-color: #cbd5e1;
}

.client-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.client-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.client-card-icon.whatsapp { background: rgba(34, 197, 94, 0.12); color: #16a34a; }
.client-card-icon.projects { background: rgba(59, 130, 246, 0.12); color: #2563eb; }
.client-card-icon.invoices { background: rgba(245, 158, 11, 0.12); color: #d97706; }
.client-card-icon.tickets { background: rgba(168, 85, 247, 0.12); color: #9333ea; }

.client-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.client-card-desc {
    font-size: 13px;
    color: #64748b;
    line-height: 1.4;
    margin-bottom: 16px;
}

.client-card-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #2563eb;
}

/* ==========================================================================
   CLIENT PORTAL DARK MODE & LIGHT MODE HARMONY
   ========================================================================== */

/* Dark Mode para a Sidebar do Cliente */
body.dark-theme aside#menu.client-sidebar {
    background-color: #080c14 !important;
    border-right: 1px solid #1e293b !important;
}

body.dark-theme .client-sidebar-brand {
    border-bottom: 1px solid #1e293b !important;
}

body.dark-theme .client-sidebar #side-menu > li > a {
    color: #94a3b8 !important;
}

body.dark-theme .client-sidebar #side-menu > li > a:hover {
    background-color: #1e293b !important;
    color: #ffffff !important;
}

body.dark-theme .client-sidebar #side-menu > li.active > a {
    background-color: #2563eb !important;
    color: #ffffff !important;
}

body.dark-theme .client-sidebar #side-menu .menu-icon {
    color: #94a3b8 !important;
}

/* Dark Mode para Header Topo do Cliente */
body.dark-theme .client-top-header {
    background-color: #0f172a !important;
    border-bottom: 1px solid #1e293b !important;
    color: #f1f5f9 !important;
}

body.dark-theme .client-top-header a,
body.dark-theme .client-top-header span,
body.dark-theme .client-top-header button,
body.dark-theme .client-top-header .dropdown-toggle {
    color: #cbd5e1 !important;
}

/* Dark Mode para Cards Rápidos do Dashboard */
body.dark-theme .client-card-item {
    background: #151c2c !important;
    border: 1px solid #243049 !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4) !important;
    color: #f1f5f9 !important;
}

body.dark-theme .client-card-item:hover {
    border-color: #3b82f6 !important;
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.6) !important;
}

body.dark-theme .client-card-title {
    color: #f8fafc !important;
}

body.dark-theme .client-card-desc {
    color: #94a3b8 !important;
}

/* Dark Mode para SaaS Cards e Views */
body.dark-theme .ps-card,
body.dark-theme .ps-view .card,
body.dark-theme .ps-view .panel {
    background-color: #151c2c !important;
    border-color: #243049 !important;
    color: #f1f5f9 !important;
}

body.dark-theme .ps-view h1,
body.dark-theme .ps-view h2,
body.dark-theme .ps-view h3,
body.dark-theme .ps-view h4,
body.dark-theme .ps-view h5 {
    color: #f8fafc !important;
}

/* Light Mode consistência */
body:not(.dark-theme) #wrapper,
body:not(.dark-theme) #content {
    background-color: #f8fafc !important;
}

body:not(.dark-theme) .client-card-item {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
}

body:not(.dark-theme) .client-sidebar {
    background-color: #ffffff !important;
    border-color: #e2e8f0 !important;
}

body:not(.dark-theme) .client-top-header {
    background-color: #ffffff !important;
    border-color: #e2e8f0 !important;
}

/* ======================================================================
   CRM DARK MODE COVERAGE
   Keep CRM views consistent when their markup uses fixed light palettes
   or Tailwind dark: utilities (which do not follow the .dark-theme class).
   ====================================================================== */

/* Lead tabs used a separate segmented treatment. Bring them in line with
   the rest of the CRM's underline tabs in dark mode. */
body.dark-theme .horizontal-scrollable-tabs .nav-tabs-segmented {
    background: transparent !important;
    border: 0 !important;
    border-bottom: 1px solid #243049 !important;
    border-radius: 0 !important;
    padding: 0 !important;
}

body.dark-theme .horizontal-scrollable-tabs .nav-tabs-segmented > li > a {
    background: transparent !important;
    border: 0 !important;
    border-bottom: 2px solid transparent !important;
    border-radius: 0 !important;
    color: #94a3b8 !important;
}

body.dark-theme .horizontal-scrollable-tabs .nav-tabs-segmented > li > a:hover,
body.dark-theme .horizontal-scrollable-tabs .nav-tabs-segmented > li > a:focus {
    background: #1e293b !important;
    color: #f8fafc !important;
}

body.dark-theme .horizontal-scrollable-tabs .nav-tabs-segmented > li.active > a,
body.dark-theme .horizontal-scrollable-tabs .nav-tabs-segmented > li.active > a:hover,
body.dark-theme .horizontal-scrollable-tabs .nav-tabs-segmented > li.active > a:focus {
    background: transparent !important;
    border: 0 !important;
    border-bottom: 2px solid #38bdf8 !important;
    box-shadow: none !important;
    color: #f8fafc !important;
}

body.dark-theme .horizontal-scrollable-tabs .nav-tabs-segmented .menu-icon,
body.dark-theme .horizontal-scrollable-tabs .nav-tabs-segmented > li > a > i {
    color: inherit !important;
}

/* Overview: KPI cards, filter header, and records list. */
body.dark-theme .crm-overview .crm-overview-header,
body.dark-theme .crm-overview .crm-overview-kpi,
body.dark-theme .crm-overview .crm-overview-list-panel {
    background: #151c2c !important;
    border-color: #2d3b55 !important;
    color: #e2e8f0 !important;
}

body.dark-theme .crm-overview .crm-overview-kpi-label,
body.dark-theme .crm-overview .crm-overview-meta,
body.dark-theme .crm-overview .crm-overview-comparison {
    color: #94a3b8 !important;
}

body.dark-theme .crm-overview .crm-overview-kpi-value,
body.dark-theme .crm-overview .crm-overview-header h1,
body.dark-theme .crm-overview .crm-overview-header h2,
body.dark-theme .crm-overview .crm-overview-header h3,
body.dark-theme .crm-overview .crm-overview-header h4 {
    color: #f8fafc !important;
}

body.dark-theme .crm-overview .crm-overview-empty {
    background: #101725 !important;
    color: #cbd5e1 !important;
}

/* Pipeline setup, including dynamically-created stage cards. */
body.dark-theme .stage-card,
body.dark-theme .stage-card.is-inactive {
    background: #151c2c !important;
    border-color: #2d3b55 !important;
    color: #e2e8f0 !important;
}

body.dark-theme .stage-card:hover {
    border-color: #475569 !important;
    background: #1a2333 !important;
}

body.dark-theme .stage-card label,
body.dark-theme .stage-card small,
body.dark-theme .stage-card .text-muted {
    color: #cbd5e1 !important;
}

body.dark-theme .color-preview-box {
    border-color: #475569 !important;
}

/* Forecast and analytics use slate utility classes with fixed light values. */
body.dark-theme .content:has(.fa-chart-line) .panel_s,
body.dark-theme .content:has(.crm-analytics-card) .panel_s {
    background-color: #151c2c !important;
    border-color: #2d3b55 !important;
    color: #e2e8f0 !important;
}

body.dark-theme .content:has(.fa-chart-line) .panel-heading,
body.dark-theme .content:has(.crm-analytics-card) .panel-heading {
    background-color: #101725 !important;
    border-color: #2d3b55 !important;
    color: #f1f5f9 !important;
}

body.dark-theme .content:has(.fa-chart-line) [class*="tw-bg-slate-50"],
body.dark-theme .content:has(.fa-chart-line) [class*="tw-bg-slate-100"],
body.dark-theme .content:has(.crm-analytics-card) [class*="tw-bg-slate-50"],
body.dark-theme .content:has(.crm-analytics-card) [class*="tw-bg-slate-100"] {
    background-color: #1e293b !important;
}

body.dark-theme .content:has(.fa-chart-line) [class*="tw-border-slate-100"],
body.dark-theme .content:has(.fa-chart-line) [class*="tw-border-slate-200"],
body.dark-theme .content:has(.fa-chart-line) [class*="tw-border-neutral-200"],
body.dark-theme .content:has(.crm-analytics-card) [class*="tw-border-slate-100"],
body.dark-theme .content:has(.crm-analytics-card) [class*="tw-border-slate-200"] {
    border-color: #2d3b55 !important;
}

body.dark-theme .crm-analytics-card,
body.dark-theme .crm-analytics-section,
body.dark-theme .crm-analytics-section .panel-body {
    color: #e2e8f0 !important;
}

body.dark-theme .crm-analytics-meta,
body.dark-theme .crm-analytics-section .text-muted {
    color: #94a3b8 !important;
}

/* Playbooks and task/attachment dialogs. */
body.dark-theme .crm-playbooks-page .crm-playbook-step,
body.dark-theme .crm-playbooks-page .crm-playbook-step input,
body.dark-theme .crm-playbooks-page .crm-playbook-step select,
body.dark-theme .crm-playbooks-page .crm-playbook-step textarea {
    background-color: #101725 !important;
    border-color: #2d3b55 !important;
    color: #e2e8f0 !important;
}

body.dark-theme .crm-playbooks-page .crm-playbook-step .step-number {
    color: #94a3b8 !important;
}

body.dark-theme #tasksModal .modal-body,
body.dark-theme #tasksModal .modal-footer,
body.dark-theme #tasksModal [class*="tw-bg-white"],
body.dark-theme #tasksModal [class*="tw-bg-slate-50"],
body.dark-theme #tasksModal [class*="tw-bg-slate-100"] {
    background-color: #151c2c !important;
    border-color: #2d3b55 !important;
    color: #e2e8f0 !important;
}

body.dark-theme #tasksModal [class*="tw-text-slate-800"],
body.dark-theme #tasksModal [class*="tw-text-slate-700"],
body.dark-theme #tasksModal [class*="tw-text-neutral-900"] {
    color: #f1f5f9 !important;
}

body.dark-theme #tasksModal [class*="tw-text-slate-600"],
body.dark-theme #tasksModal [class*="tw-text-slate-500"],
body.dark-theme #tasksModal [class*="tw-text-slate-400"],
body.dark-theme #tasksModal [class*="tw-text-slate-300"] {
    color: #94a3b8 !important;
}

body.dark-theme #tasksModal [class*="tw-border-slate-100"],
body.dark-theme #tasksModal [class*="tw-border-slate-200"],
body.dark-theme #tasksModal [class*="tw-border-slate-300"] {
    border-color: #2d3b55 !important;
}

body.dark-theme #tasksModal kbd {
    background: #1e293b !important;
    border-color: #475569 !important;
    color: #cbd5e1 !important;
}

/* Gantt chart labels and popovers. */
body.dark-theme .crm-kanban-gantt-page .gantt-container,
body.dark-theme .crm-kanban-gantt-page .gantt .grid-background,
body.dark-theme .crm-kanban-gantt-page .gantt .grid-row,
body.dark-theme .crm-kanban-gantt-page .gantt .grid-header {
    fill: #151c2c !important;
    background: #151c2c !important;
}

body.dark-theme .crm-kanban-gantt-page .gantt .grid-row,
body.dark-theme .crm-kanban-gantt-page .gantt .tick {
    stroke: #2d3b55 !important;
}

body.dark-theme .crm-kanban-gantt-page .gantt .lower-text,
body.dark-theme .crm-kanban-gantt-page .gantt .upper-text,
body.dark-theme .crm-kanban-gantt-page .gantt .bar-label,
body.dark-theme .crm-kanban-gantt-page .gantt .today-highlight {
    fill: #cbd5e1 !important;
}

body.dark-theme .crm-kanban-gantt-page .crm-gantt-popup {
    background: #151c2c !important;
    border-color: #2d3b55 !important;
    color: #e2e8f0 !important;
}

/* Legacy Leads screens share the CRM workflow and include their own kanban. */
body.dark-theme .lead-kan-ban,
body.dark-theme .lead-kan-ban .panel-body,
body.dark-theme .leads-status {
    background: #151c2c !important;
    border-color: #2d3b55 !important;
    color: #e2e8f0 !important;
}

body.dark-theme .lead-kan-ban .lead-field-heading,
body.dark-theme .lead-kan-ban .text-muted,
body.dark-theme .lead-kan-ban .tw-text-neutral-500,
body.dark-theme .lead-kan-ban .tw-text-neutral-400 {
    color: #94a3b8 !important;
}

body.dark-theme .lead-kan-ban .text-dark,
body.dark-theme .lead-kan-ban .bold,
body.dark-theme .lead-kan-ban .tw-text-slate-800 {
    color: #f1f5f9 !important;
}
/* ==========================================================================
   ANIMATED AURORA BACKGROUND & GLASSMORPHISM LOGIN
   ========================================================================== */

/* Remove qualquer rolagem vertical e força centralização total em telas de login (exceto registro e faturas) */
html:has(body.customers.not-logged-in:not(.register):not(.viewinvoice)),
html:has(body.login_admin),
body.customers.not-logged-in:not(.register):not(.viewinvoice),
body.login_admin {
    height: 100vh !important;
    max-height: 100vh !important;
    min-height: 100vh !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Liberação de rolagem para tela de cadastro de clientes */
html:has(body.customers.not-logged-in.register),
body.customers.not-logged-in.register {
    height: auto !important;
    min-height: 100vh !important;
    max-height: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
}

body.customers.not-logged-in:not(.viewinvoice),
body.login_admin {
    background-color: #0c1222 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
}

body.customers.not-logged-in:not(.dark-theme) {
    background-color: #eff6ff !important;
}

/* Fatura do cliente: rolagem normal e contêineres que não estouram a largura da tela */
body.viewinvoice {
    min-height: 100vh;
    overflow-x: hidden;
}

body.viewinvoice .container,
body.viewinvoice .row {
    max-width: 100%;
}

@media (max-width: 767px) {
    body.viewinvoice .container {
        width: 100%;
        padding-left: 15px;
        padding-right: 15px;
    }

    body.viewinvoice .row {
        margin-left: 0;
        margin-right: 0;
    }

    body.viewinvoice .preview-sticky-header .sm\:tw-flex {
        margin-left: 0;
        margin-right: 0;
    }

    body.viewinvoice .panel-body .col-md-10 {
        width: 100%;
        padding-left: 0;
        padding-right: 0;
    }

    body.viewinvoice .table-responsive {
        border: 0;
    }
}

body.customers.not-logged-in nav.navbar.header,
body.customers.not-logged-in footer.footer,
body.customers.not-logged-in .section-header {
    display: none !important;
}

body.customers.not-logged-in #wrapper {
    position: relative !important;
    z-index: 5 !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
}

body.customers.not-logged-in.register #wrapper {
    height: auto !important;
    min-height: 100vh !important;
    max-height: none !important;
    justify-content: flex-start !important;
    padding: 30px 15px 60px 15px !important;
    overflow: visible !important;
}

body.customers.not-logged-in #content {
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
}

body.customers.not-logged-in.register #content {
    height: auto !important;
    min-height: auto !important;
    justify-content: flex-start !important;
}

body.customers.not-logged-in .container,
body.customers.not-logged-in .row {
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
}

body.customers.not-logged-in .container:empty,
body.customers.not-logged-in .row:empty {
    display: none !important;
}

/* Fundo Animado com Gradientes Orgânicos */
.login-aurora-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
    background: radial-gradient(circle at 50% 50%, #0f172a 0%, #030712 100%);
    transition: background 0.4s ease;
}

html:not(.dark-theme) .login-aurora-bg,
body:not(.dark-theme) .login-aurora-bg {
    background: radial-gradient(circle at 50% 50%, #eff6ff 0%, #dbeafe 50%, #e0e7ff 100%) !important;
}

.aurora-orb {
    position: absolute;
    border-radius: 50%;
    will-change: transform;
    opacity: 0.75;
    transition: opacity 0.4s ease, background 0.4s ease;
}

.aurora-orb.orb-1 {
    width: 680px;
    height: 680px;
    top: -150px;
    left: -100px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.5) 0%, rgba(14, 165, 233, 0) 70%);
    filter: blur(80px);
    animation: auroraFloat1 10s ease-in-out infinite alternate;
}

.aurora-orb.orb-2 {
    width: 780px;
    height: 780px;
    bottom: -200px;
    right: -100px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.55) 0%, rgba(139, 92, 246, 0) 70%);
    filter: blur(90px);
    animation: auroraFloat2 12s ease-in-out infinite alternate;
}

.aurora-orb.orb-3 {
    width: 580px;
    height: 580px;
    top: 40%;
    left: 60%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.4) 0%, rgba(16, 185, 129, 0) 70%);
    filter: blur(75px);
    animation: auroraFloat3 9s ease-in-out infinite alternate;
}

html:not(.dark-theme) .aurora-orb.orb-1,
body:not(.dark-theme) .aurora-orb.orb-1 {
    background: radial-gradient(circle, rgba(37, 99, 235, 0.6) 0%, rgba(37, 99, 235, 0) 70%) !important;
    filter: blur(65px) !important;
}

html:not(.dark-theme) .aurora-orb.orb-2,
body:not(.dark-theme) .aurora-orb.orb-2 {
    background: radial-gradient(circle, rgba(147, 51, 234, 0.55) 0%, rgba(147, 51, 234, 0) 70%) !important;
    filter: blur(75px) !important;
}

html:not(.dark-theme) .aurora-orb.orb-3,
body:not(.dark-theme) .aurora-orb.orb-3 {
    background: radial-gradient(circle, rgba(236, 72, 153, 0.5) 0%, rgba(236, 72, 153, 0) 70%) !important;
    filter: blur(70px) !important;
}

@keyframes auroraFloat1 {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(120px, 80px, 0) scale(1.15); }
    100% { transform: translate3d(-60px, 140px, 0) scale(0.95); }
}

@keyframes auroraFloat2 {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(-140px, -90px, 0) scale(1.1); }
    100% { transform: translate3d(80px, -120px, 0) scale(0.9); }
}

@keyframes auroraFloat3 {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(-100px, 100px, 0) scale(1.2); }
    100% { transform: translate3d(100px, -60px, 0) scale(0.85); }
}

@media (prefers-reduced-motion: reduce) {
    .login-aurora-bg .aurora-orb {
        animation: none;
    }
}


.aurora-grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 32px 32px;
    opacity: 0.4;
}

body:not(.dark-theme) .aurora-grid-overlay,
html:not(.dark-theme) .aurora-grid-overlay {
    background-image: radial-gradient(rgba(99, 102, 241, 0.12) 1px, transparent 1px);
    opacity: 0.7;
}

/* Container & Card Glassmorphism */
.login-center-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 100%;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px 15px;
    box-sizing: border-box;
    margin: 0 auto !important;
}

.login-glass-card {
    width: 100%;
    max-width: 410px;
    background: rgba(255, 255, 255, 0.78) !important;
    backdrop-filter: blur(24px) saturate(190%);
    -webkit-backdrop-filter: blur(24px) saturate(190%);
    border: 1px solid rgba(255, 255, 255, 0.9) !important;
    border-radius: 22px !important;
    box-shadow: 0 20px 45px -12px rgba(15, 23, 42, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.6), inset 0 1px 2px rgba(255, 255, 255, 0.95) !important;
    padding: 28px 30px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html:not(.dark-theme) .login-glass-card,
body:not(.dark-theme) .login-glass-card {
    background: rgba(255, 255, 255, 0.78) !important;
    color: #0f172a !important;
}

html:not(.dark-theme) .login-glass-card label,
html:not(.dark-theme) .login-glass-card .checkbox label {
    color: #1e293b !important;
    font-weight: 500;
}

html.dark-theme .login-glass-card,
body.dark-theme .login-glass-card {
    background: rgba(15, 23, 42, 0.78) !important;
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.06), inset 0 1px 1px rgba(255, 255, 255, 0.1) !important;
    color: #f1f5f9 !important;
}

html.dark-theme .login-glass-card label,
body.dark-theme .login-glass-card label,
html.dark-theme .login-glass-card .checkbox label,
body.dark-theme .login-glass-card .checkbox label {
    color: #cbd5e1 !important;
}

.login-company-logo {
    max-height: 50px;
    max-width: 240px;
    width: auto;
    height: auto;
    margin: 0 auto;
    display: inline-block;
    object-fit: contain;
    border-radius: 8px;
}

.theme-toggle-pill {
    border-radius: 20px !important;
    padding: 4px 12px !important;
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    color: #1e293b !important;
    cursor: pointer !important;
    transition: all 0.2s ease;
}

.theme-toggle-pill:hover {
    background: #ffffff !important;
    border-color: #94a3b8 !important;
    transform: scale(1.03);
}

html.dark-theme .theme-toggle-pill,
body.dark-theme .theme-toggle-pill {
    background: rgba(30, 41, 59, 0.65) !important;
    border-color: rgba(255, 255, 255, 0.16) !important;
    color: #f1f5f9 !important;
    box-shadow: none !important;
}

html.dark-theme .theme-toggle-pill:hover,
body.dark-theme .theme-toggle-pill:hover {
    background: rgba(30, 41, 59, 0.95) !important;
}

/* Inputs Modernos & Unificados */
.input-group-modern {
    display: flex !important;
    align-items: stretch !important;
    width: 100% !important;
    border-radius: 12px !important;
    border: 1px solid #cbd5e1 !important;
    background: #ffffff !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    overflow: hidden !important;
}

.input-group-modern:focus-within {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18), 0 2px 8px rgba(37, 99, 235, 0.08) !important;
    background: #ffffff !important;
}

.input-group-modern .input-group-addon {
    background: #f8fafc !important;
    border: none !important;
    color: #475569 !important;
    font-size: 14px !important;
    min-width: 42px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 12px !important;
    margin: 0 !important;
}
.input-group-modern .input-group-addon > i {
    width: 16px;
    color: #2563eb !important;
    font-size: 15px !important;
    line-height: 1;
    text-align: center;
}

.input-group-modern .form-control {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #0f172a !important;
    font-size: 14px !important;
    height: 42px !important;
    padding: 8px 12px !important;
    flex: 1 1 auto !important;
    width: 1% !important;
}

.input-group-modern .form-control::placeholder {
    color: #94a3b8 !important;
}

.input-group-modern .input-group-btn {
    display: flex !important;
    align-items: stretch !important;
}

.input-group-modern .input-group-btn .btn {
    background: #f8fafc !important;
    border: none !important;
    box-shadow: none !important;
    color: #475569 !important;
    font-size: 14px !important;
    padding: 0 14px !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 0 !important;
    transition: color 0.15s ease, background 0.15s ease !important;
}

.input-group-modern .input-group-btn .btn:hover {
    background: #f1f5f9 !important;
    color: #1e293b !important;
}

/* Modo escuro dos inputs */
html.dark-theme .input-group-modern,
body.dark-theme .input-group-modern {
    background: rgba(15, 23, 42, 0.75) !important;
    border-color: rgba(255, 255, 255, 0.14) !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
}

html.dark-theme .input-group-modern:focus-within,
body.dark-theme .input-group-modern:focus-within {
    border-color: #60a5fa !important;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.25), 0 4px 12px rgba(0, 0, 0, 0.4) !important;
    background: rgba(15, 23, 42, 0.95) !important;
}

html.dark-theme .input-group-modern .input-group-addon,
body.dark-theme .input-group-modern .input-group-addon {
    background: rgba(30, 41, 59, 0.65) !important;
    color: #94a3b8 !important;
}
html.dark-theme .input-group-modern .input-group-addon > i,
body.dark-theme .input-group-modern .input-group-addon > i {
    color: #93c5fd !important;
}

html.dark-theme .input-group-modern .form-control,
body.dark-theme .input-group-modern .form-control {
    color: #f8fafc !important;
}

html.dark-theme .input-group-modern .form-control::placeholder,
body.dark-theme .input-group-modern .form-control::placeholder {
    color: #64748b !important;
}

html.dark-theme .input-group-modern .input-group-btn .btn,
body.dark-theme .input-group-modern .input-group-btn .btn {
    background: rgba(30, 41, 59, 0.65) !important;
    color: #94a3b8 !important;
}

html.dark-theme .input-group-modern .input-group-btn .btn:hover,
body.dark-theme .input-group-modern .input-group-btn .btn:hover {
    background: rgba(51, 65, 85, 0.8) !important;
    color: #f1f5f9 !important;
}

/* Selectpicker no Login */
.login-glass-card .bootstrap-select {
    width: 100% !important;
}

.login-glass-card .bootstrap-select > .btn {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 12px !important;
    color: #0f172a !important;
    font-size: 13px !important;
    padding: 8px 14px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}

.login-glass-card .bootstrap-select .dropdown-menu {
    background: rgba(255, 255, 255, 0.96) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(203, 213, 225, 0.8) !important;
    border-radius: 14px !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12) !important;
    padding: 6px !important;
}

.login-glass-card .bootstrap-select .dropdown-menu li a {
    color: #1e293b !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    font-size: 13px !important;
    transition: all 0.15s ease !important;
}

.login-glass-card .bootstrap-select .dropdown-menu li a:hover,
.login-glass-card .bootstrap-select .dropdown-menu li.selected a {
    background: rgba(37, 99, 235, 0.1) !important;
    color: #2563eb !important;
    font-weight: 600 !important;
}

html.dark-theme .login-glass-card .bootstrap-select > .btn,
body.dark-theme .login-glass-card .bootstrap-select > .btn {
    background: rgba(15, 23, 42, 0.65) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    color: #f1f5f9 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

html.dark-theme .login-glass-card .bootstrap-select > .btn:hover,
html.dark-theme .login-glass-card .bootstrap-select > .btn:focus {
    background: rgba(30, 41, 59, 0.85) !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
}

html.dark-theme .login-glass-card .bootstrap-select .bs-caret .caret {
    border-top-color: #94a3b8 !important;
}

html.dark-theme .login-glass-card .bootstrap-select .dropdown-menu {
    background: rgba(15, 23, 42, 0.94) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6) !important;
}

html.dark-theme .login-glass-card .bootstrap-select .dropdown-menu li a {
    color: #e2e8f0 !important;
}

html.dark-theme .login-glass-card .bootstrap-select .dropdown-menu li a:hover,
html.dark-theme .login-glass-card .bootstrap-select .dropdown-menu li.selected a {
    background: rgba(37, 99, 235, 0.3) !important;
    color: #93c5fd !important;
}

/* Botão Entrar com alto contraste e presença visual */
.btn-login-submit {
    height: 44px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    letter-spacing: 0.01em !important;
    border-radius: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border: none !important;
}

/* Tema Claro */
html:not(.dark-theme) .btn-login-submit,
body:not(.dark-theme) .btn-login-submit {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px -2px rgba(37, 99, 235, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
}

html:not(.dark-theme) .btn-login-submit:hover,
body:not(.dark-theme) .btn-login-submit:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%) !important;
    box-shadow: 0 6px 20px -2px rgba(37, 99, 235, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.35) !important;
    transform: translateY(-1px) !important;
}

/* Tema Escuro */
html.dark-theme .btn-login-submit,
body.dark-theme .btn-login-submit {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 16px -2px rgba(59, 130, 246, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
}

html.dark-theme .btn-login-submit:hover,
body.dark-theme .btn-login-submit:hover {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%) !important;
    box-shadow: 0 6px 22px -2px rgba(59, 130, 246, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
    transform: translateY(-1px) !important;
}

/* Botões adicionais (Google SSO, etc.) e Divisores */
.login-card-body .btn-default:not(.btn-register):not(.theme-toggle-pill),
.login-card-body a.btn:not(.btn-primary):not(.btn-register):not(.theme-toggle-pill) {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 12px !important;
    height: 42px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #334155 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    text-decoration: none !important;
}

.login-card-body .btn-default:not(.btn-register):not(.theme-toggle-pill):hover,
.login-card-body a.btn:not(.btn-primary):not(.btn-register):not(.theme-toggle-pill):hover {
    background: #f8fafc !important;
    border-color: #94a3b8 !important;
    color: #0f172a !important;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08) !important;
    transform: translateY(-1px) !important;
}

html.dark-theme .login-card-body .btn-default:not(.btn-register):not(.theme-toggle-pill),
body.dark-theme .login-card-body .btn-default:not(.btn-register):not(.theme-toggle-pill),
html.dark-theme .login-card-body a.btn:not(.btn-primary):not(.btn-register):not(.theme-toggle-pill),
body.dark-theme .login-card-body a.btn:not(.btn-primary):not(.btn-register):not(.theme-toggle-pill) {
    background: rgba(30, 41, 59, 0.7) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #f1f5f9 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
}

html.dark-theme .login-card-body .btn-default:not(.btn-register):not(.theme-toggle-pill):hover,
body.dark-theme .login-card-body .btn-default:not(.btn-register):not(.theme-toggle-pill):hover,
html.dark-theme .login-card-body a.btn:not(.btn-primary):not(.btn-register):not(.theme-toggle-pill):hover,
body.dark-theme .login-card-body a.btn:not(.btn-primary):not(.btn-register):not(.theme-toggle-pill):hover {
    background: rgba(51, 65, 85, 0.9) !important;
    border-color: rgba(255, 255, 255, 0.22) !important;
    color: #ffffff !important;
}

/* Divisores de texto como OU / OR */
.login-card-body .tw-text-center.tw-my-3,
.login-card-body .text-center.mtop15,
.login-card-body .tw-text-center.tw-my-4 {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8 !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    letter-spacing: 0.06em !important;
    text-transform: uppercase !important;
}

.login-card-body .tw-text-center.tw-my-3::before,
.login-card-body .tw-text-center.tw-my-3::after,
.login-card-body .text-center.mtop15::before,
.login-card-body .text-center.mtop15::after,
.login-card-body .tw-text-center.tw-my-4::before,
.login-card-body .tw-text-center.tw-my-4::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(203, 213, 225, 0.6);
}

.login-card-body .tw-text-center.tw-my-3::before,
.login-card-body .text-center.mtop15::before,
.login-card-body .tw-text-center.tw-my-4::before {
    margin-right: 12px;
}

.login-card-body .tw-text-center.tw-my-3::after,
.login-card-body .text-center.mtop15::after,
.login-card-body .tw-text-center.tw-my-4::after {
    margin-left: 12px;
}

html.dark-theme .login-card-body .tw-text-center.tw-my-3::before,
html.dark-theme .login-card-body .tw-text-center.tw-my-3::after,
html.dark-theme .login-card-body .text-center.mtop15::before,
html.dark-theme .login-card-body .text-center.mtop15::after,
body.dark-theme .login-card-body .tw-text-center.tw-my-3::before,
body.dark-theme .login-card-body .tw-text-center.tw-my-3::after,
body.dark-theme .login-card-body .text-center.mtop15::before,
body.dark-theme .login-card-body .text-center.mtop15::after {
    border-bottom-color: rgba(255, 255, 255, 0.12) !important;
}

/* ==========================================================================
   REGISTER GLASSMORPHISM CARD & SECTIONS
   ========================================================================== */

.register-center-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 10px 15px;
    box-sizing: border-box;
}

.register-glass-card {
    width: 100%;
    background: rgba(255, 255, 255, 0.38) !important;
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.9) !important;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.12), inset 0 1px 2px rgba(255, 255, 255, 0.95), 0 0 0 1px rgba(255, 255, 255, 0.4) !important;
    padding: 28px 32px !important;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

html:not(.dark-theme) .register-glass-card,
body:not(.dark-theme) .register-glass-card {
    background: rgba(255, 255, 255, 0.38) !important;
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.9) !important;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.12), inset 0 1px 2px rgba(255, 255, 255, 0.95), 0 0 0 1px rgba(255, 255, 255, 0.4) !important;
    color: #0f172a !important;
}

html.dark-theme .register-glass-card,
body.dark-theme .register-glass-card {
    background: rgba(15, 23, 42, 0.72) !important;
    backdrop-filter: blur(28px) saturate(200%);
    -webkit-backdrop-filter: blur(28px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 30px 80px -15px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.06) !important;
    color: #f1f5f9 !important;
}

.register-section-header {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.01em;
    padding-bottom: 8px;
    margin-bottom: 14px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.7);
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

html.dark-theme .register-section-header,
body.dark-theme .register-section-header {
    color: #f1f5f9;
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.register-glass-card label,
.register-glass-card .control-label {
    font-size: 12px !important;
    font-weight: 500 !important;
    margin-bottom: 4px !important;
    color: #334155 !important;
}

html.dark-theme .register-glass-card label,
html.dark-theme .register-glass-card .control-label,
body.dark-theme .register-glass-card label,
body.dark-theme .register-glass-card .control-label {
    color: #cbd5e1 !important;
}

.register-glass-card .form-control:not(.selectpicker) {
    background: rgba(255, 255, 255, 0.45) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.85) !important;
    border-radius: 10px !important;
    height: 38px;
    font-size: 13px;
    color: #0f172a !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03) !important;
}

.register-glass-card .form-control:not(.selectpicker):focus {
    background: rgba(255, 255, 255, 0.85) !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18) !important;
}

html.dark-theme .register-glass-card .form-control:not(.selectpicker),
body.dark-theme .register-glass-card .form-control:not(.selectpicker) {
    background: rgba(2, 6, 23, 0.55) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #f8fafc !important;
}

html.dark-theme .register-glass-card .form-control:not(.selectpicker):focus,
body.dark-theme .register-glass-card .form-control:not(.selectpicker):focus {
    background: rgba(15, 23, 42, 0.85) !important;
    border-color: #60a5fa !important;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.25) !important;
}

.register-glass-card .bootstrap-select > .btn {
    background: rgba(255, 255, 255, 0.45) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.85) !important;
    border-radius: 10px !important;
    height: 38px;
    color: #0f172a !important;
    font-size: 13px !important;
}

html.dark-theme .register-glass-card .bootstrap-select > .btn,
body.dark-theme .register-glass-card .bootstrap-select > .btn {
    background: rgba(2, 6, 23, 0.55) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #f8fafc !important;
}

/* Custom fields no registro: alinhamento perfeito sem margens negativas do Bootstrap */
.register-glass-card .custom-fields-form-row {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.register-glass-card .custom-fields-form-row > [class*="col-"] {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.register-glass-card .custom-fields-form-row .form-group {
    margin-bottom: 15px !important;
}

.register-glass-card .custom-fields-form-row label,
.register-glass-card .custom-fields-form-row .control-label {
    display: inline-block !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    margin-bottom: 4px !important;
    color: #334155 !important;
    text-transform: capitalize !important;
}

html.dark-theme .register-glass-card .custom-fields-form-row label,
html.dark-theme .register-glass-card .custom-fields-form-row .control-label,
body.dark-theme .register-glass-card .custom-fields-form-row label,
body.dark-theme .register-glass-card .custom-fields-form-row .control-label {
    color: #cbd5e1 !important;
}

.register-glass-card .custom-fields-form-row .form-control:not(.selectpicker) {
    background: rgba(255, 255, 255, 0.45) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.85) !important;
    border-radius: 10px !important;
    height: 38px !important;
    font-size: 13px !important;
    color: #0f172a !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03) !important;
}

.register-glass-card .custom-fields-form-row .form-control:not(.selectpicker):focus {
    background: rgba(255, 255, 255, 0.85) !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18) !important;
}

html.dark-theme .register-glass-card .custom-fields-form-row .form-control:not(.selectpicker),
body.dark-theme .register-glass-card .custom-fields-form-row .form-control:not(.selectpicker) {
    background: rgba(2, 6, 23, 0.55) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #f8fafc !important;
}

html.dark-theme .register-glass-card .custom-fields-form-row .form-control:not(.selectpicker):focus,
body.dark-theme .register-glass-card .custom-fields-form-row .form-control:not(.selectpicker):focus {
    background: rgba(15, 23, 42, 0.85) !important;
    border-color: #60a5fa !important;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.25) !important;
}



/* WhatsApp AI inbox dark theme. */

body.dark-theme #conversations_list .conv-item:not(.active) {
    background-color: #111827 !important;
    border-color: #2d3b55 !important;
    color: #e2e8f0 !important;
}
body.dark-theme #conversations_list .conv-item:not(.active) .list-group-item-heading,
body.dark-theme #conversations_list .conv-item:not(.active) strong {
    color: #f8fafc !important;
}
body.dark-theme #conversations_list .conv-item:not(.active) .text-muted,
body.dark-theme #conversations_list .conv-item:not(.active) small {
    color: #94a3b8 !important;
}
body.dark-theme #conversations_list .conv-item:not(.active):hover,
body.dark-theme #conversations_list .conv-item:not(.active):focus {
    background-color: #1e293b !important;
    color: #f8fafc !important;
}
body.dark-theme #conversations_list .conv-item.active,
body.dark-theme #conversations_list .conv-item.active:hover,
body.dark-theme #conversations_list .conv-item.active:focus {
    background-color: #1d4ed8 !important;
    border-color: #3b82f6 !important;
    color: #ffffff !important;
}
body.dark-theme #conversations_list .conv-item.active .text-muted,
body.dark-theme #conversations_list .conv-item.active small {
    color: #dbeafe !important;
}
body.dark-theme #conversations_list .conv-item .label-success {
    background-color: #14532d !important;
    color: #bbf7d0 !important;
}
body.dark-theme #conversations_list .conv-item .label-info {
    background-color: #0c4a6e !important;
    color: #bae6fd !important;
}
body.dark-theme #conversations_list .conv-item .label-default {
    background-color: #334155 !important;
    color: #e2e8f0 !important;
}
body.dark-theme #conversations_list .conv-item .label-warning {
    background-color: #713f12 !important;
    color: #fde68a !important;
}
body.dark-theme #conversations_list .conv-item .label-danger {
    background-color: #7f1d1d !important;
    color: #fecaca !important;
}

/* Dashboard activity widget navigation. */
.user-data .horizontal-scrollable-tabs {
    background-color: #f1f5f9 !important;
    border-bottom: 1px solid #dbe3ed !important;
    border-radius: 8px 8px 0 0;
}

.user-data .horizontal-scrollable-tabs .horizontal-tabs,
.user-data .horizontal-scrollable-tabs .nav-tabs-horizontal {
    background: transparent !important;
}

.user-data .horizontal-scrollable-tabs .nav-tabs-horizontal {
    border: 0 !important;
    margin-bottom: 0 !important;
}

.user-data .horizontal-scrollable-tabs .nav-tabs-horizontal > li > a {
    height: auto !important;
    min-height: 44px !important;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    margin: 4px 3px;
    padding: 9px 12px;
    border: 1px solid transparent !important;
    border-radius: 7px;
    background: transparent !important;
    color: #475569 !important;
    font-weight: 600;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.user-data .horizontal-scrollable-tabs .nav-tabs-horizontal > li > a:hover,
.user-data .horizontal-scrollable-tabs .nav-tabs-horizontal > li > a:focus {
    background: #e2e8f0 !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

.user-data .horizontal-scrollable-tabs .nav-tabs-horizontal > li.active > a,
.user-data .horizontal-scrollable-tabs .nav-tabs-horizontal > li.active > a:hover,
.user-data .horizontal-scrollable-tabs .nav-tabs-horizontal > li.active > a:focus {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
    color: #0369a1 !important;
}

.user-data .horizontal-scrollable-tabs .nav-tabs-horizontal > li > a > i {
    color: inherit !important;
}

.user-data .horizontal-scrollable-tabs .nav-tabs-horizontal .badge {
    margin-left: 4px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #334155;
    font-size: 10px;
}

.user-data .horizontal-scrollable-tabs .scroller {
    background: #f1f5f9 !important;
    border: 0 !important;
    color: #64748b !important;
}

.user-data .horizontal-scrollable-tabs .scroller:hover:not(.disabled) {
    background: #e2e8f0 !important;
    color: #0f172a !important;
}

.user-data .horizontal-scrollable-tabs .nav-tabs-horizontal > li > a:focus-visible {
    outline: 2px solid #2563eb !important;
    outline-offset: 2px !important;
}

body.dark-theme .user-data .horizontal-scrollable-tabs {
    background-color: #111827 !important;
    border-bottom-color: #2d3b55 !important;
}

body.dark-theme .user-data .horizontal-scrollable-tabs .nav-tabs-horizontal > li > a {
    background: transparent !important;
    border-color: transparent !important;
    color: #cbd5e1 !important;
}

body.dark-theme .user-data .horizontal-scrollable-tabs .nav-tabs-horizontal > li > a:hover,
body.dark-theme .user-data .horizontal-scrollable-tabs .nav-tabs-horizontal > li > a:focus {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

body.dark-theme .user-data .horizontal-scrollable-tabs .nav-tabs-horizontal > li.active > a,
body.dark-theme .user-data .horizontal-scrollable-tabs .nav-tabs-horizontal > li.active > a:hover,
body.dark-theme .user-data .horizontal-scrollable-tabs .nav-tabs-horizontal > li.active > a:focus {
    background: #1d4ed8 !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 1px 3px rgba(2, 6, 23, 0.35);
    color: #ffffff !important;
}

body.dark-theme .user-data .horizontal-scrollable-tabs .nav-tabs-horizontal .badge {
    background: #0f172a;
    color: #bfdbfe;
}

body.dark-theme .user-data .horizontal-scrollable-tabs .scroller {
    background: #111827 !important;
    color: #94a3b8 !important;
}

body.dark-theme .user-data .horizontal-scrollable-tabs .scroller:hover:not(.disabled) {
    background: #1e293b !important;
    color: #f8fafc !important;
}

body.dark-theme .user-data .horizontal-scrollable-tabs .nav-tabs-horizontal > li > a:focus-visible {
    outline: 2px solid #60a5fa !important;
    outline-offset: 2px !important;
}

@media (max-width: 767px) {
    .user-data .horizontal-scrollable-tabs .nav-tabs-horizontal > li > a {
        padding: 8px 10px;
        font-size: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .user-data .horizontal-scrollable-tabs .nav-tabs-horizontal > li > a {
        transition: none;
    }
}

/* ==========================================================================
   Listas/DataTables no dark: contraste alto do texto das celulas.
   Causa raiz: o nucleo pinta celulas com cinzas (td, .text-muted, a, classes
   tw-text-neutral-*, .text-dark) e a regra geral do tema usava #cbd5e1 em td
   mas deixava filhos (a, span, .text-*) herdarem cinzas escuros do nucleo.
   ========================================================================== */
body.dark-theme table.dataTable tbody td,
body.dark-theme .table > tbody > tr > td,
body.dark-theme .table > tbody > tr > th,
body.dark-theme .dataTables_wrapper tbody td {
    color: #f1f5f9 !important;
}

body.dark-theme table.dataTable tbody td span:not(.label):not(.badge):not(.btn):not(.onoffswitch-label):not(.slider),
body.dark-theme table.dataTable tbody td div:not(.onoffswitch):not(.btn):not(.progress):not(.progress-bar),
body.dark-theme table.dataTable tbody td p,
body.dark-theme table.dataTable tbody td small,
body.dark-theme table.dataTable tbody td .text-muted,
body.dark-theme table.dataTable tbody td .text-secondary,
body.dark-theme table.dataTable tbody td .text-dark,
body.dark-theme table.dataTable tbody td [class*="tw-text-neutral"],
body.dark-theme table.dataTable tbody td [class*="tw-text-gray"],
body.dark-theme .table > tbody > tr > td .text-muted,
body.dark-theme .table > tbody > tr > td .text-secondary,
body.dark-theme .table > tbody > tr > td .text-dark,
body.dark-theme .table > tbody > tr > td [class*="tw-text-neutral"] {
    color: #e5e7eb !important;
}

body.dark-theme table.dataTable tbody td a:not(.btn):not(.label):not(.badge),
body.dark-theme .table > tbody > tr > td a:not(.btn):not(.label):not(.badge) {
    color: #bfdbfe !important;
}

body.dark-theme table.dataTable tbody td a:not(.btn):not(.label):not(.badge):hover,
body.dark-theme table.dataTable tbody td a:not(.btn):not(.label):not(.badge):focus,
body.dark-theme .table > tbody > tr > td a:not(.btn):not(.label):not(.badge):hover {
    color: #ffffff !important;
    text-decoration: underline;
}

body.dark-theme table.dataTable tbody tr:hover > td,
body.dark-theme .table-striped > tbody > tr:nth-of-type(odd) > td,
body.dark-theme .table-hover > tbody > tr:hover > td {
    color: #f8fafc !important;
}

/* Linhas inativas/desabilitadas: ainda legiveis, levemente atenuadas */
body.dark-theme table.dataTable tbody tr.text-muted > td,
body.dark-theme table.dataTable tbody tr.disabled > td,
body.dark-theme table.dataTable tbody tr.inactive > td,
body.dark-theme table.dataTable tbody tr.text-muted > td * {
    color: #cbd5e1 !important;
}

body.dark-theme .dataTables_info,
body.dark-theme .dataTables_length,
body.dark-theme .dataTables_filter,
body.dark-theme .dataTables_length label,
body.dark-theme .dataTables_filter label {
    color: #e2e8f0 !important;
}

/* ==========================================================================
   Contraste alto global (todas as telas do tema dark).
   Causa raiz: o nucleo usa utilitarios tw-text-neutral-(300..900), .text-muted,
   .text-dark e cinzas hardcoded (#64748b/#475569/#334155) em cards, paineis,
   labels, linhas de detalhe e dropdowns; o tema so cobria 500..800 e nao
   400/300/900, nem .text-secondary, .control-label, .no-margin etc.
   Telas: leads (tabela + kanban + workspace), clientes, despesas, faturas,
   propostas, estimativas, contratos, projetos, tarefas, tickets, pagamentos,
   itens, contatos, relatorios, portal (app_customers_head), crm_kanban, perfex_saas.
   ========================================================================== */
body.dark-theme .tw-text-neutral-900,
body.dark-theme .tw-text-neutral-800,
body.dark-theme .tw-text-neutral-700,
body.dark-theme .tw-text-neutral-600,
body.dark-theme .tw-text-neutral-500,
body.dark-theme .tw-text-gray-900,
body.dark-theme .tw-text-gray-800,
body.dark-theme .tw-text-gray-700,
body.dark-theme .tw-text-gray-600,
body.dark-theme .tw-text-gray-500,
body.dark-theme .tw-text-slate-900,
body.dark-theme .tw-text-slate-800,
body.dark-theme .tw-text-slate-700,
body.dark-theme .tw-text-slate-600,
body.dark-theme .tw-text-slate-500,
body.dark-theme .text-dark,
body.dark-theme .text-muted,
body.dark-theme .text-secondary,
body.dark-theme .control-label,
body.dark-theme .form-group > label,
body.dark-theme .panel_s .panel-body,
body.dark-theme .panel-body .no-margin,
body.dark-theme .well,
body.dark-theme .list-group-item,
body.dark-theme dl dt,
body.dark-theme dl dd {
    color: #e5e7eb !important;
}

body.dark-theme .tw-text-neutral-400,
body.dark-theme .tw-text-neutral-300,
body.dark-theme .tw-text-gray-400,
body.dark-theme .tw-text-slate-400,
body.dark-theme .text-neutral-400 {
    color: #cbd5e1 !important;
}

/* Cards, paineis, labels de detalhe, kanban de leads e workspace do crm_kanban */
body.dark-theme .lead-kan-ban .text-muted,
body.dark-theme .lead-kan-ban .panel-body,
body.dark-theme .kan-ban-content-wrapper .text-muted,
body.dark-theme .panel_s .text-muted,
body.dark-theme .panel_s .tw-text-neutral-500,
body.dark-theme .panel_s .tw-text-neutral-400,
body.dark-theme .crm-lead-workspace__eyebrow,
body.dark-theme .crm-lead-workspace__subtitle,
body.dark-theme .crm-lead-workspace__close,
body.dark-theme .crm-lead-workspace__fact dt,
body.dark-theme .crm-lead-workspace__score-reason,
body.dark-theme .crm-lead-workspace__next-card span,
body.dark-theme .crm-lead-workspace__timeline-heading time,
body.dark-theme .crm-lead-workspace__timeline-meta,
body.dark-theme .crm-lead-workspace__timeline-body,
body.dark-theme .crm-lead-workspace__empty,
body.dark-theme .crm-overview-kpi-label,
body.dark-theme .crm-playbook-step {
    color: #e5e7eb !important;
}

/* Dropdowns */
body.dark-theme .dropdown-menu > li > a,
body.dark-theme .dropdown-menu .text-muted {
    color: #f1f5f9 !important;
}
body.dark-theme .dropdown-menu > li > a:hover,
body.dark-theme .dropdown-menu > li > a:focus {
    color: #ffffff !important;
}

/* Links gerais fora de botoes/abas/menus */
body.dark-theme .panel_s a:not(.btn):not(.label):not(.badge):not([class*="nav"]):not(.dropdown-toggle),
body.dark-theme .table a:not(.btn):not(.label):not(.badge) {
    color: #bfdbfe;
}
body.dark-theme .panel_s a:not(.btn):not(.label):not(.badge):not([class*="nav"]):not(.dropdown-toggle):hover,
body.dark-theme .table a:not(.btn):not(.label):not(.badge):hover {
    color: #ffffff !important;
}

/* Cores semanticas preservadas (badges/botoes/inputs nao sao alvo das regras acima) */
body.dark-theme .text-success { color: #86efac !important; }
body.dark-theme .text-danger { color: #fca5a5 !important; }
body.dark-theme .text-warning { color: #fcd34d !important; }
body.dark-theme .text-info { color: #7dd3fc !important; }
