:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --surface: #ffffff;
    --bg: #f1f5f9;
    --text: #1e293b;
    --text-muted: #64748b;
    --muted: #64748b;          /* alias for --text-muted */
    --border: #e2e8f0;
    --primary-rgb: 99, 102, 241;
    --surface-rgb: 255, 255, 255;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #eab308;
    --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(0, 0, 0, 0.1);
    /* Semantic color shortcuts */
    --green:      #10b981;
    --green-glow: rgba(16,185,129,0.25);
    --blue:       #3b82f6;
    --blue-glow:  rgba(59,130,246,0.25);
    --gold:       #f59e0b;
    --gold-glow:  rgba(245,158,11,0.25);
    --red:        #ef4444;
    /* Card aliases */
    --bg-card:    #ffffff;
    --border-color: #e2e8f0;
    /* WhatsApp motor vars */
    --accent:      #25d366;
    --accent-dark: #128c7e;
    --accent-glow: rgba(37,211,102,0.3);
    --text-primary: #1e293b;
}

[data-bs-theme="dark"], [data-theme="dark"] {
    --primary: #818cf8;
    --primary-hover: #6366f1;
    --surface: #1e293b;
    --primary-rgb: 129, 140, 248;
    --surface-rgb: 30, 41, 59;
    --bg: #0f172a;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --muted: #94a3b8;
    --border: #334155;
    --card-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.4);
    --glass-bg: rgba(15, 23, 42, 0.85);
    --glass-border: rgba(255, 255, 255, 0.08);
    /* Semantic color shortcuts */
    --green:      #34d399;
    --green-glow: rgba(52,211,153,0.25);
    --blue:       #60a5fa;
    --blue-glow:  rgba(96,165,250,0.25);
    --gold:       #fbbf24;
    --gold-glow:  rgba(251,191,36,0.25);
    --red:        #f87171;
    /* Card aliases */
    --bg-card:    #1e293b;
    --border-color: #334155;
    /* WhatsApp motor vars */
    --accent:      #34d399;
    --accent-dark: #059669;
    --accent-glow: rgba(52,211,153,0.3);
    --text-primary: #f1f5f9;
}

* {
    scrollbar-width: thin;
    scrollbar-color: #10b981 rgba(15, 23, 42, 0.4);
}
[data-bs-theme="light"] * {
    scrollbar-color: #10b981 rgba(0, 0, 0, 0.08);
}

/* CUSTOM SCROLLBAR ULTRA-CLEAN */
::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}
::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 10px;
}
[data-bs-theme="light"] ::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.06);
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #10b981, #3b82f6);
    border-radius: 10px;
    border: 1px solid transparent;
    background-clip: padding-box;
    transition: background 0.3s;
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #059669, #2563eb);
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.bg-surface {
    background-color: var(--surface) !important;
}

.card {
    border: 1px solid var(--border);
    background-color: var(--surface) !important;
    color: var(--text) !important;
    border-radius: 1.25rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--card-shadow);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow);
}

.card-dashboard {
    border: 1px solid var(--border) !important;
    background: var(--surface) !important;
    color: var(--text) !important;
    position: relative;
    overflow: hidden;
}

/* ==========================================================================
   COMPLETE THEME INTEGRATION (DARK & LIGHT MODE)
   ========================================================================== */

.glass, .tree-wrap, .prog-card, .kpi-card, .stat-card {
    background-color: var(--surface) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

/* Fix Tables across all pages */
.table, table {
    --bs-table-bg: var(--surface) !important;
    --bs-table-color: var(--text) !important;
    --bs-table-border-color: var(--border) !important;
    --bs-table-hover-bg: rgba(var(--primary-rgb), 0.08) !important;
    --bs-table-hover-color: var(--text) !important;
    background-color: var(--surface) !important;
    color: var(--text) !important;
}

.table th, .table td, table th, table td {
    background-color: transparent !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

.table thead th, table thead th {
    background-color: var(--surface) !important;
    color: var(--text) !important;
    border-bottom: 2px solid var(--border) !important;
}

.table-hover > tbody > tr:hover > * {
    background-color: rgba(var(--primary-rgb), 0.08) !important;
    color: var(--text) !important;
}

/* Fix Text & Headings */
h1, h2, h3, h4, h5, h6, .card-title, .modal-title {
    color: var(--text);
}

.text-muted, .small.text-muted, .extra-small {
    color: var(--muted) !important;
}

/* Fix Forms, Controls, Inputs & Selects */
.form-control, .form-select {
    background-color: var(--bg) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

.form-control::placeholder {
    color: var(--muted) !important;
    opacity: 0.75;
}

.form-control:focus, .form-select:focus {
    background-color: var(--surface) !important;
    color: var(--text) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 0.25rem rgba(var(--primary-rgb), 0.25) !important;
}

.form-check-input {
    background-color: var(--bg) !important;
    border-color: var(--border) !important;
}

.form-check-input:checked {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
}

/* Fix Modals */
.modal-content {
    background-color: var(--surface) !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
}

.modal-header, .modal-footer {
    border-color: var(--border) !important;
}

/* Fix Dropdowns & Popovers */
.dropdown-menu {
    background-color: var(--surface) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
    box-shadow: var(--card-shadow) !important;
}

.dropdown-item {
    color: var(--text) !important;
}

.dropdown-item:hover, .dropdown-item:focus {
    background-color: rgba(var(--primary-rgb), 0.12) !important;
    color: var(--primary) !important;
}

/* Accent Bars for Dashboard Stats */
.col-md:nth-child(1) .card-dashboard { border-top: 4px solid #10b981; } /* Sucesso */
.col-md:nth-child(2) .card-dashboard { border-top: 4px solid #ef4444; } /* Urgente */
.col-md:nth-child(3) .card-dashboard { border-top: 4px solid #0ea5e9; } /* Info */
.col-md:nth-child(4) .card-dashboard { border-top: 4px solid #25d366; } /* WhatsApp */

.icon-box {
    width: 52px;
    height: 52px;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.icon-box.bg-secondary-subtle { background: rgba(148, 163, 184, 0.15) !important; color: #cbd5e1 !important; border: 1px solid rgba(148, 163, 184, 0.25) !important; }
.icon-box.bg-success-subtle   { background: rgba(16, 185, 129, 0.15) !important; color: #34d399 !important; border: 1px solid rgba(16, 185, 129, 0.25) !important; }
.icon-box.bg-primary-subtle   { background: rgba(59, 130, 246, 0.15) !important; color: #60a5fa !important; border: 1px solid rgba(59, 130, 246, 0.25) !important; }
.icon-box.bg-info-subtle      { background: rgba(14, 165, 233, 0.15) !important; color: #38bdf8 !important; border: 1px solid rgba(14, 165, 233, 0.25) !important; }

.card-dashboard:hover .icon-box {
    transform: scale(1.15) rotate(-8deg);
    filter: brightness(1.1);
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* FullCalendar Customization */
#calendar {
    min-height: 500px;
}

.fc {
    --fc-border-color: var(--border);
    --fc-button-bg-color: var(--primary);
    --fc-button-border-color: var(--primary);
    --fc-button-hover-bg-color: var(--primary-hover);
    --fc-button-active-bg-color: var(--primary-hover);
}

.fc .fc-toolbar-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.fc-theme-standard td, .fc-theme-standard th {
    border-color: var(--border);
}

/* Lists */
.list-group-item {
    background-color: transparent;
    border-color: var(--border);
    padding: 1rem;
    color: var(--text);
    transition: background-color 0.2s;
}

.list-group-item:hover {
    background-color: rgba(var(--primary-rgb), 0.05);
}

.bg-indigo-purple {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%) !important;
    color: white !important;
}

.bg-private-green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: white !important;
}

.circle {
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.circle:hover {
    transform: scale(1.1);
}

.max-h-400 {
    max-height: 400px;
}

/* GUT Badges */
.gut-badge {
    padding: 0.25rem 0.6rem;
    border-radius: 2rem;
    font-weight: 600;
    font-size: 0.75rem;
}

/* Theme Toggle Button */
.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid var(--border);
    color: var(--text);
}

/* Premium Layout Overhaul */
.navbar {
    background: rgba(var(--surface-rgb), 0.8) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1rem 0;
}

.search-box input {
    background-color: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: 100px !important;
    padding: 0.6rem 1.5rem 0.6rem 3rem !important;
    transition: all 0.3s ease;
}

.search-box input:focus {
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15) !important;
    border-color: var(--primary) !important;
    width: 105%;
}

/* Modern Tables */
.custom-hub-table {
    border-collapse: separate;
    border-spacing: 0 8px;
}

.custom-hub-table thead th {
    background: transparent;
    border: none;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 15px 20px;
}

.custom-hub-table tbody tr {
    background-color: var(--surface);
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    border-radius: 1rem;
    transition: all 0.2s ease;
}

.custom-hub-table tbody tr:hover {
    transform: scale(1.01);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.custom-hub-table td {
    border: none;
    padding: 18px 20px;
}

.custom-hub-table td:first-child { border-radius: 12px 0 0 12px; }
.custom-hub-table td:last-child { border-radius: 0 12px 12px 0; }

/* Global Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Restoring Missing UI Components */
.interest-stars {
    color: #fbbf24;
    font-size: 0.8rem;
    cursor: pointer;
}

.interest-star.active { color: #fbbf24; }
.interest-star.inactive { color: var(--border); }
.interest-star:hover {
    transform: scale(1.2);
    transition: transform 0.1s ease;
}

.badge-date {
    font-size: 0.65rem;
    padding: 0.2rem 0.4rem;
    border-radius: 0.5rem;
    background-color: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
}

.funnel-dots {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}

.funnel-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--border);
}

.funnel-dot.active { background-color: var(--primary); }

.stage-badge-interactive { cursor: pointer; transition: filter 0.2s; }
.stage-badge-interactive:hover { filter: brightness(1.1); }

.max-h-400 {
    max-height: 400px;
    overflow-y: auto;
}

/* Funnel Stage Badges - Modern Colors */
.stage-Novo { background-color: #94a3b8 !important; color: white !important; }
.stage-Contatado { background-color: #0ea5e9 !important; color: white !important; }
.stage-Proposta { background-color: #f59e0b !important; color: white !important; }
.stage-Negociação { background-color: #8b5cf6 !important; color: white !important; }
.stage-Fechado { background-color: #10b981 !important; color: white !important; }

/* Enhanced Buttons - High Contrast & Visibility */
.btn-primary,
button.btn-primary,
a.btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    color: #ffffff !important;
    border: none;
    border-radius: 100px;
    padding: 0.6rem 1.5rem;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
    transition: all 0.2s ease;
}

.btn-primary, 
.btn-primary *, 
.btn-primary i, 
.btn-primary span,
button.btn-primary *,
a.btn-primary * {
    color: #ffffff !important;
}

.btn-primary:hover, 
.btn-primary:focus, 
.btn-primary:active,
.btn-primary.active {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%) !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover *, 
.btn-primary:focus *, 
.btn-primary:active *,
.btn-primary.active * {
    color: #ffffff !important;
}

.btn-outline-primary {
    color: #2563eb !important;
    border-color: #2563eb !important;
    font-weight: 700;
}

[data-bs-theme="dark"] .btn-outline-primary,
[data-theme="dark"] .btn-outline-primary {
    color: #60a5fa !important;
    border-color: #3b82f6 !important;
}

.btn-outline-primary:hover, 
.btn-outline-primary:active, 
.btn-outline-primary.active {
    background: #2563eb !important;
    color: #ffffff !important;
    border-color: #2563eb !important;
}

.btn-outline-primary:hover *, 
.btn-outline-primary:active *, 
.btn-outline-primary.active * {
    color: #ffffff !important;
}

/* Ghost Button System */
.btn-ghost {
    background: transparent;
    color: var(--text) !important;
    border: 1px solid var(--border);
    font-weight: 600;
    transition: all 0.2s ease;
}
.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text) !important;
    border-color: var(--border);
}

/* Nav Pills Active High Contrast */
.nav-pills .nav-link {
    color: var(--text) !important;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    font-weight: 700;
    transition: all 0.2s ease;
}

.nav-pills .nav-link:hover:not(.active) {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb !important;
}

[data-bs-theme="dark"] .nav-pills .nav-link:hover:not(.active) {
    color: #60a5fa !important;
}

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    background: #2563eb !important;
    color: #ffffff !important;
    border-color: #2563eb !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.nav-pills .nav-link.active *,
.nav-pills .nav-link.active i,
.nav-pills .nav-link.active span,
.nav-pills .show > .nav-link *,
.nav-pills .show > .nav-link i,
.nav-pills .show > .nav-link span {
    color: #ffffff !important;
}

/* Hierarchical Selection Cards */
.bloco-card {
    border: 1px solid var(--border) !important;
    background: var(--surface) !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.bloco-card.selected-coord {
    background: rgba(37, 99, 235, 0.10) !important;
    border: 2px solid #2563eb !important;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.15) !important;
}
.bloco-card.selected-lider {
    background: rgba(16, 185, 129, 0.10) !important;
    border: 2px solid #10b981 !important;
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.15) !important;
}/* Daily Focus Panel */
.daily-focus-card {
    border-left: 4px solid var(--primary);
    background: linear-gradient(to right, rgba(99, 102, 241, 0.05), transparent);
}

.btn-done-big {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border);
    background: transparent;
    color: var(--border);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-done-big:hover {
    border-color: #10b981;
    color: #10b981;
    transform: scale(1.15);
}

/* Mobile Table Optimization */
.table-responsive {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--border);
    border-radius: 12px;
    -webkit-overflow-scrolling: touch;
}

.table-responsive::-webkit-scrollbar {
    height: 6px;
}

.table-responsive::-webkit-scrollbar-track {
    background: var(--surface);
    border-radius: 10px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

.custom-hub-table {
    min-width: 1000px; /* Forces horizontal scroll room on mobile */
    border-collapse: separate;
    border-spacing: 0;
}

/* Sticky Column Logic */
.custom-hub-table thead th:first-child,
.custom-hub-table tbody td:first-child {
    position: sticky;
    left: 0;
    z-index: 10;
    background-color: inherit;
    box-shadow: 4px 0 8px -4px rgba(0,0,0,0.1);
}

[data-bs-theme="dark"] .custom-hub-table thead th:first-child,
[data-bs-theme="dark"] .custom-hub-table tbody td:first-child {
    box-shadow: 4px 0 12px -4px rgba(0,0,0,0.5);
    background-color: var(--surface);
}

.custom-hub-table thead th {
    position: sticky;
    top: 0;
    z-index: 11;
    background-color: var(--surface);
}

.custom-hub-table tbody tr {
    transition: all 0.2s ease;
}

.hub-tab {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    border: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hub-tab.active {
    background: var(--primary) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.search-box input {
    background-color: var(--bg);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.search-box input:focus {
    background-color: var(--surface);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    border-color: var(--primary);
}

.pagination-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    font-weight: bold;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Funnel Progress */
.funnel-stage {
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
}

.stage-Novo { background-color: #cbd5e1; color: #1e293b; }
.stage-Contatado { background-color: #93c5fd; color: #1e3a8a; }
.stage-Proposta { background-color: #fde047; color: #713f12; }
.stage-Negociação { background-color: #c084fc; color: #4c1d95; }
.stage-Fechado { background-color: #4ade80; color: #064e3b; }

.funnel-dots {
    display: flex;
    gap: 3px;
    margin-top: 4px;
}

.funnel-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--border);
}

.funnel-dot.active {
    background-color: var(--primary);
}

.btn-seed {
    background-color: transparent;
    border: 1px dashed var(--text-muted);
    color: var(--text-muted);
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-seed:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Floating Action Button */
.fa-fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    z-index: 1000;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Campaign Bar - Flutuante e Moderna no Rodapé */
.campaign-bar {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 750px;
    height: 75px;
    background: rgba(15, 23, 42, 0.85); /* Tom escuro profundo */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 100px; /* Estilo pílula moderna */
    z-index: 2000;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 0 10px;
}

.campaign-bar.d-none {
    display: none !important;
    transform: translateX(-50%) translateY(100px); /* Animação ao sumir */
    opacity: 0;
}

.campaign-bar .selection-count {
    display: flex;
    align-items: center;
    border-right: 1px solid rgba(255,255,255,0.1);
    padding-right: 20px;
    margin-right: 20px;
    height: 40px;
}

.campaign-bar .form-control-sm {
    background: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.campaign-bar .form-control-sm:focus {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: var(--primary) !important;
}

@media (max-width: 600px) {
    .campaign-bar {
        height: auto;
        padding: 15px;
        flex-direction: column;
        border-radius: 20px;
        bottom: 10px;
        gap: 10px;
    }
    .campaign-bar .selection-count {
        border-right: none;
        padding-right: 0;
        margin-right: 0;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        padding-bottom: 10px;
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Floating Campaign Resume Button - Premium Pill */
#btnResumeCampaign {
    position: fixed !important;
    bottom: 30px !important;
    right: 30px !important;
    z-index: 2500 !important;
    padding: 12px 25px !important;
    font-weight: 600 !important;
    font-family: 'Outfit', sans-serif !important;
    color: white !important;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%) !important;
    border: none !important;
    border-radius: 100px !important;
    box-shadow: 0 10px 25px -5px rgba(34, 197, 94, 0.4) !important;
    backdrop-filter: blur(10px) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    animation: pulse-green-glow 2s infinite !important;
    display: flex;
    align-items: center !important;
    gap: 8px;
}

#btnResumeCampaign:hover {
    transform: translateY(-5px) scale(1.05) !important;
    box-shadow: 0 15px 30px -5px rgba(34, 197, 94, 0.6) !important;
    filter: brightness(1.1) !important;
}

@keyframes pulse-green-glow {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* =========================================
   CENTRAL DE ARQUIVOS - PREMIUM UI
   ========================================= */
.drag-drop-zone {
    border: 2px dashed rgba(var(--primary-rgb), 0.5);
    border-radius: 1rem;
    padding: 3rem 2rem;
    text-align: center;
    background: rgba(var(--primary-rgb), 0.03);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.drag-drop-zone.dragover {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.08);
    transform: scale(1.02);
}

.drag-drop-zone i.upload-icon {
    font-size: 3.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}

.file-icon {
    font-size: 1.8rem;
    color: var(--primary);
}

.file-row {
    transition: background 0.2s ease;
}

.file-row:hover {
    background: rgba(var(--primary-rgb), 0.05);
}

.progress-bar-animated {
    transition: width 0.3s ease;
}

.file-card {
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

/* =========================================
   CENTRAL DE NEWSLETTERS - PREMIUM UI
   ========================================= */
.status-badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
    border-radius: 100px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-draft { background-color: rgba(148, 163, 184, 0.2); color: #64748b; border: 1px solid rgba(148, 163, 184, 0.4); }
.status-scheduled { background-color: rgba(245, 158, 11, 0.2); color: #d97706; border: 1px solid rgba(245, 158, 11, 0.4); }
.status-sending { background-color: rgba(14, 165, 233, 0.2); color: #0284c7; border: 1px solid rgba(14, 165, 233, 0.4); animation: pulse-blue 2s infinite; }
.status-completed { background-color: rgba(16, 185, 129, 0.2); color: #059669; border: 1px solid rgba(16, 185, 129, 0.4); }

[data-bs-theme="dark"] .status-draft { color: #94a3b8; }
[data-bs-theme="dark"] .status-scheduled { color: #fbbf24; }
[data-bs-theme="dark"] .status-sending { color: #38bdf8; }
[data-bs-theme="dark"] .status-completed { color: #34d399; }

@keyframes pulse-blue {
    0% { box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(14, 165, 233, 0); }
    100% { box-shadow: 0 0 0 0 rgba(14, 165, 233, 0); }
}

.newsletter-progress {
    height: 8px;
    border-radius: 4px;
    background-color: var(--border);
    overflow: hidden;
    margin-top: 5px;
}

.newsletter-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, #a855f7 100%);
    transition: width 0.5s ease;
}

/* =========================================
   PREMIUM FORM CONTROLS & THEME OVERRIDES
   ========================================= */
.form-control, .form-select, textarea {
    border-radius: 0.75rem !important;
    padding: 0.6rem 1rem !important;
    font-size: 0.9rem !important;
    background-color: var(--surface) !important;
    border: 1px solid var(--border) !important;
    color: var(--text) !important;
    transition: all 0.3s ease-in-out !important;
}

.form-control:focus, .form-select:focus, textarea:focus {
    background-color: var(--surface) !important;
    border-color: var(--primary) !important;
    color: var(--text) !important;
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.15) !important;
    outline: none !important;
}

[data-bs-theme="dark"] .form-control, 
[data-bs-theme="dark"] .form-select, 
[data-bs-theme="dark"] textarea {
    background: rgba(15, 23, 42, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .form-control:focus, 
[data-bs-theme="dark"] .form-select:focus, 
[data-bs-theme="dark"] textarea:focus {
    background: rgba(15, 23, 42, 0.7) !important;
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15) !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .form-control::placeholder,
[data-bs-theme="dark"] textarea::placeholder {
    color: #64748b !important;
}

/* File selector button styling */
.form-control[type="file"] {
    background-color: rgba(30, 41, 59, 0.7) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

[data-bs-theme="dark"] .form-control[type="file"] {
    background-color: rgba(30, 41, 59, 0.5) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.form-control[type="file"]::file-selector-button {
    background-color: var(--primary) !important;
    color: white !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 0.3rem 0.75rem !important;
    margin-right: 1rem !important;
    transition: background-color 0.2s ease-in-out !important;
}

.form-control[type="file"]::file-selector-button:hover {
    background-color: var(--primary-hover) !important;
}

/* Nested alerts and card backgrounds inside dark modals */
[data-bs-theme="dark"] .modal-content .bg-light,
[data-bs-theme="dark"] .modal-content .bg-body-secondary,
[data-bs-theme="dark"] #omni_email_section.bg-light {
    background-color: rgba(30, 41, 59, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: var(--text) !important;
}

[data-bs-theme="dark"] .modal-content .bg-success-subtle,
[data-bs-theme="dark"] #omni_whatsapp_section.bg-success-subtle {
    background-color: rgba(16, 185, 129, 0.08) !important;
    border: 1px solid rgba(16, 185, 129, 0.2) !important;
    color: #34d399 !important;
}

[data-bs-theme="dark"] .modal-content .alert-info,
[data-bs-theme="dark"] #omni_target_info.alert-info {
    background-color: rgba(99, 102, 241, 0.08) !important;
    border: 1px solid rgba(99, 102, 241, 0.2) !important;
    color: #818cf8 !important;
}

/* ==========================================
   PREMIUM KPI & DASHBOARD CARD SYSTEM
   ========================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--surface, #ffffff);
  border-radius: 14px;
  padding: 18px 20px;
  border: 1px solid var(--border, rgba(226, 232, 240, 0.8));
  box-shadow: var(--card-shadow, 0 4px 15px rgba(0, 0, 0, 0.03));
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}
.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.kpi-title {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted, #64748b);
}
.kpi-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}
.kpi-val {
  font-size: 1.85rem;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.5px;
}

/* Color Variants for KPI Cards */
.kpi-pendente { border-top: 4px solid #f59e0b; }
.kpi-pendente .kpi-icon-wrap { background: rgba(245,158,11,0.14); color: #d97706; }
.kpi-pendente .kpi-val { color: #d97706; }

.kpi-processando { border-top: 4px solid #3b82f6; }
.kpi-processando .kpi-icon-wrap { background: rgba(59,130,246,0.14); color: #2563eb; }
.kpi-processando .kpi-val { color: #2563eb; }

.kpi-enviado { border-top: 4px solid #10b981; }
.kpi-enviado .kpi-icon-wrap { background: rgba(16,185,129,0.14); color: #059669; }
.kpi-enviado .kpi-val { color: #059669; }

.kpi-erro { border-top: 4px solid #ef4444; }
.kpi-erro .kpi-icon-wrap { background: rgba(239,68,68,0.14); color: #dc2626; }
.kpi-erro .kpi-val { color: #dc2626; }

.kpi-respostas { border-top: 4px solid #8b5cf6; }
.kpi-respostas .kpi-icon-wrap { background: rgba(139,92,246,0.14); color: #7c3aed; }
.kpi-respostas .kpi-val { color: #7c3aed; }

.kpi-optout { border-top: 4px solid #64748b; }
.kpi-optout .kpi-icon-wrap { background: rgba(100,116,139,0.14); color: #475569; }
.kpi-optout .kpi-val { color: #475569; }

.kpi-fila { border-top: 4px solid #6366f1; }
.kpi-fila .kpi-icon-wrap { background: rgba(99,102,241,0.14); color: #6366f1; }
.kpi-fila .kpi-val { color: #6366f1; }

.kpi-taxa { border-top: 4px solid #f59e0b; }
.kpi-taxa .kpi-icon-wrap { background: rgba(245,158,11,0.14); color: #d97706; }
.kpi-taxa .kpi-val { color: #d97706; }

/* Status Badges */
.fila-status { padding: 4px 12px; border-radius: 20px; font-size: .70rem; font-weight: 800; text-transform: uppercase; display: inline-flex; align-items: center; gap: 5px; }
.st-pendente { background: rgba(245,158,11,.14); color: #b45309; border: 1px solid rgba(245,158,11,.3); }
.st-processando { background: rgba(59,130,246,.14); color: #1d4ed8; border: 1px solid rgba(59,130,246,.3); }
.st-enviado { background: rgba(16,185,129,.14); color: #047857; border: 1px solid rgba(16,185,129,.3); }
.st-erro { background: rgba(239,68,68,.14); color: #b91c1c; border: 1px solid rgba(239,68,68,.3); }
.st-opt_out, .st-cancelado, .st-pausado { background: rgba(100,116,139,.14); color: #475569; border: 1px solid rgba(100,116,139,.3); }

/* Progress Card */
.prog-card { background: var(--surface, #ffffff); border-radius: 14px; padding: 20px 24px; border: 1px solid var(--border, rgba(226, 232, 240, 0.8)); box-shadow: var(--card-shadow, 0 4px 15px rgba(0,0,0,0.03)); margin-bottom: 24px; }
.prog-bar { height: 10px; background: rgba(226, 232, 240, 0.6); border-radius: 10px; overflow: hidden; margin: 10px 0; }
[data-bs-theme="dark"] .prog-bar { background: rgba(255, 255, 255, 0.08); }
.prog-fill { height: 100%; background: linear-gradient(90deg, #10b981, #3b82f6); border-radius: 10px; transition: width .4s ease; }

/* Tree Wrap Card Container */
.tree-wrap {
  background: var(--surface, #ffffff);
  border-radius: 14px;
  padding: 24px;
  border: 1px solid var(--border, rgba(226, 232, 240, 0.8));
  box-shadow: var(--card-shadow, 0 4px 15px rgba(0, 0, 0, 0.03));
  margin-bottom: 24px;
}

/* Custom Pagination Buttons */
.pagination-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--border, #e2e8f0);
  background: var(--surface, #ffffff);
  color: var(--text, #334155);
  font-weight: 700;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}
.pagination-btn:hover:not(.active):not([style*="not-allowed"]) {
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--primary, #6366f1);
  color: var(--primary, #6366f1);
  transform: translateY(-1px);
}
.pagination-btn.active {
  background: var(--primary, #6366f1) !important;
  border-color: var(--primary, #6366f1) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}
[data-bs-theme="dark"] .pagination-btn {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
}
[data-bs-theme="dark"] .pagination-btn:hover:not(.active):not([style*="not-allowed"]) {
  background: rgba(129, 140, 248, 0.2);
  border-color: #818cf8;
  color: #818cf8;
}

/* ==========================================================================
   DARK & CLEAN DESIGN SYSTEM: TOASTS & ALERTS
   ========================================================================== */
.toast-container {
    z-index: 10900 !important;
}

.toast, #toast {
    background: var(--surface, #1e293b) !important;
    color: var(--text, #f8fafc) !important;
    border: 1px solid var(--border, rgba(255,255,255,.12)) !important;
    border-radius: 14px !important;
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 0, 0, 0.2) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    font-weight: 600 !important;
    font-size: 0.88rem !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.toast.bg-success, #toast.toast-success, .toast-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.18) 0%, var(--surface, #1e293b) 100%) !important;
    border: 1px solid rgba(16, 185, 129, 0.4) !important;
    color: var(--text, #f8fafc) !important;
}
.toast.bg-success i, #toast.toast-success i { color: #34d399 !important; }

.toast.bg-danger, .toast.bg-error, #toast.toast-error, .toast-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.18) 0%, var(--surface, #1e293b) 100%) !important;
    border: 1px solid rgba(239, 68, 68, 0.4) !important;
    color: var(--text, #f8fafc) !important;
}
.toast.bg-danger i, #toast.toast-error i { color: #f87171 !important; }

.toast.bg-warning, #toast.toast-warning, .toast-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.18) 0%, var(--surface, #1e293b) 100%) !important;
    border: 1px solid rgba(245, 158, 11, 0.4) !important;
    color: var(--text, #f8fafc) !important;
}
.toast.bg-warning i, #toast.toast-warning i { color: #fbbf24 !important; }

.toast.bg-info, .toast.bg-primary, #toast.toast-info, .toast-info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.18) 0%, var(--surface, #1e293b) 100%) !important;
    border: 1px solid rgba(59, 130, 246, 0.4) !important;
    color: var(--text, #f8fafc) !important;
}
.toast.bg-info i, .toast.bg-primary i, #toast.toast-info i { color: #60a5fa !important; }

.toast .btn-close, #toast .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%) !important;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.toast .btn-close:hover, #toast .btn-close:hover {
    opacity: 1;
}

/* BOOTSTRAP ALERTS (Alert Banners) */
.alert {
    border-radius: 14px !important;
    font-weight: 600 !important;
    font-size: 0.88rem !important;
    border: 1px solid var(--border) !important;
    backdrop-filter: blur(12px) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15) !important;
}

.alert-success {
    background: rgba(16, 185, 129, 0.12) !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
    color: #34d399 !important;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.12) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
    color: #f87171 !important;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.12) !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
    color: #fbbf24 !important;
}

.alert-info {
    background: rgba(59, 130, 246, 0.12) !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
    color: #60a5fa !important;
}

/* ==========================================================================
   HIGH-CONTRAST BADGES, TAGS & OPACITY FIX
   ========================================================================== */
.bg-opacity-5  { --bs-bg-opacity: 0.05 !important; }
.bg-opacity-10 { --bs-bg-opacity: 0.10 !important; }
.bg-opacity-15 { --bs-bg-opacity: 0.15 !important; }
.bg-opacity-20 { --bs-bg-opacity: 0.20 !important; }
.bg-opacity-25 { --bs-bg-opacity: 0.25 !important; }
.bg-opacity-30 { --bs-bg-opacity: 0.30 !important; }

.badge.bg-warning.text-warning,
.badge.bg-warning[class*="bg-opacity-"],
.badge.text-warning,
.badge-tree-coord {
  background-color: rgba(245, 158, 11, 0.18) !important;
  color: #fbbf24 !important;
  border: 1px solid rgba(245, 158, 11, 0.45) !important;
}
.badge.bg-success.text-success,
.badge.bg-success[class*="bg-opacity-"],
.badge.text-success,
.badge-tree-lider {
  background-color: rgba(16, 185, 129, 0.18) !important;
  color: #34d399 !important;
  border: 1px solid rgba(16, 185, 129, 0.45) !important;
}
.badge.bg-primary.text-primary,
.badge.bg-primary[class*="bg-opacity-"],
.badge.text-primary,
.badge-tree-sub1 {
  background-color: rgba(59, 130, 246, 0.18) !important;
  color: #60a5fa !important;
  border: 1px solid rgba(59, 130, 246, 0.45) !important;
}
.badge.bg-info.text-info,
.badge.bg-info[class*="bg-opacity-"],
.badge.text-info,
.badge-tree-sub2 {
  background-color: rgba(14, 165, 233, 0.18) !important;
  color: #38bdf8 !important;
  border: 1px solid rgba(14, 165, 233, 0.45) !important;
}
.badge.bg-purple.text-purple,
.badge.bg-purple[class*="bg-opacity-"],
.badge.text-purple,
.badge-tree-sub3 {
  background-color: rgba(168, 85, 247, 0.18) !important;
  color: #c084fc !important;
  border: 1px solid rgba(168, 85, 247, 0.45) !important;
}
.badge.bg-danger.text-danger,
.badge.bg-danger[class*="bg-opacity-"],
.badge.text-danger {
  background-color: rgba(239, 68, 68, 0.18) !important;
  color: #f87171 !important;
  border: 1px solid rgba(239, 68, 68, 0.45) !important;
}
.badge.bg-secondary.text-secondary,
.badge.bg-secondary[class*="bg-opacity-"],
.badge-tree-pessoas {
  background-color: rgba(148, 163, 184, 0.18) !important;
  color: #f1f5f9 !important;
  border: 1px solid rgba(148, 163, 184, 0.35) !important;
}


