/* ==========================================================================
   OmegaGestor - Tema Escuro Preto Real (Onyx / Obsidian) Padrão DistribuiPro
   Ativado via: html[data-theme="dark"]
   Cores extraídas fielmente de: Sistema_Distribuipro-17 (studio-v1.css & dash-pro-v1.css)
   ========================================================================== */

/* ─── TOKENS OFICIAIS DISTRIBUIPRO ESCURO ────────────────────── */
:root[data-theme="dark"],
html[data-theme="dark"] {
    --dp-bg-primary: #0b0d14;       /* Preto profundo de fundo da página */
    --dp-bg-secondary: #0d111c;     /* Sidebar e navbar */
    --dp-bg-card: #11141d;          /* Cards e painéis */
    --dp-bg-card-hover: #161a26;    /* Hover de cards */
    --dp-bg-surface: #181c29;       /* Superfícies elevadas */
    --dp-bg-input: #0e1119;         /* Inputs e campos */
    --dp-border: rgba(255, 255, 255, 0.07);
    --dp-border-hover: rgba(255, 255, 255, 0.14);
    --dp-text-primary: #e9ecf3;     /* Texto principal claro */
    --dp-text-secondary: #9aa3b5;   /* Texto secundário */
    --dp-text-muted: #64748b;       /* Textos de apoio e tags */
    --dp-text-heading: #ffffff;     /* Títulos e números em branco puro */
    --dp-accent: #6366f1;           /* Índigo DistribuiPro */
    --dp-accent-hover: #818cf8;
    --dp-accent-muted: rgba(99, 102, 241, 0.14);

    color-scheme: dark;
}

/* ─── CORPO DA PÁGINA (PRETO REAL COM AURORAS DISTRIBUIPRO) ─── */
html[data-theme="dark"],
html[data-theme="dark"] body {
    background-color: #0b0d14 !important;
    color: #e9ecf3 !important;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

/* Efeito Aurora sutil idêntico ao DistribuiPro Studio */
html[data-theme="dark"] body::before {
    content: '' !important;
    position: fixed !important;
    inset: 0 !important;
    pointer-events: none !important;
    z-index: 0 !important;
    background:
        radial-gradient(900px 520px at 8% -8%, rgba(99, 102, 241, 0.16), transparent 62%),
        radial-gradient(700px 480px at 100% 0%, rgba(168, 85, 247, 0.10), transparent 60%),
        radial-gradient(800px 600px at 90% 110%, rgba(34, 211, 238, 0.08), transparent 60%) !important;
}

html[data-theme="dark"] body::after {
    content: '' !important;
    position: fixed !important;
    inset: 0 !important;
    pointer-events: none !important;
    z-index: 0 !important;
    background-image: radial-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px) !important;
    background-size: 22px 22px !important;
    mask-image: linear-gradient(180deg, #000, transparent 75%) !important;
    -webkit-mask-image: linear-gradient(180deg, #000, transparent 75%) !important;
}

html[data-theme="dark"] .content-wrapper,
html[data-theme="dark"] .thetop,
html[data-theme="dark"] .wrapper,
html[data-theme="dark"] .main-content,
html[data-theme="dark"] .dp-home-container,
html[data-theme="dark"] .content {
    background-color: transparent !important;
    color: #e9ecf3 !important;
    position: relative !important;
    z-index: 1 !important;
}

html[data-theme="dark"] .content-header > h1,
html[data-theme="dark"] .content-header > h1 small {
    color: #f1f5f9 !important;
}

/* ─── NAVBAR FLUTUANTE DARK (DISTRIBUIPRO) ─────────────────── */
html[data-theme="dark"] .dp-navbar {
    background: #0d111c !important;
    border-color: rgba(255, 255, 255, 0.07) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
}

html[data-theme="dark"] .dp-search-capsule {
    background: #11141d !important;
    border-color: rgba(255, 255, 255, 0.07) !important;
    color: #e9ecf3 !important;
}

html[data-theme="dark"] .dp-search-capsule input {
    color: #e9ecf3 !important;
}

html[data-theme="dark"] .dp-search-capsule input::placeholder {
    color: #64748b !important;
}

html[data-theme="dark"] .dp-kbd {
    background: #181c29 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #8e9cb2 !important;
}

html[data-theme="dark"] .dp-header-icon-btn {
    background: #11141d !important;
    border-color: rgba(255, 255, 255, 0.07) !important;
    color: #9aa3b5 !important;
}

html[data-theme="dark"] .dp-header-icon-btn:hover {
    background: #161a26 !important;
    border-color: rgba(99, 102, 241, 0.4) !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .dp-header-avatar-btn {
    background: #11141d !important;
    border-color: rgba(255, 255, 255, 0.07) !important;
    color: #ffffff !important;
}

/* Botões especiais da navbar: Reparar e PDV sem alto-contraste */
html[data-theme="dark"] #btnRepairDatabase,
html[data-theme="dark"] a[href*="repair-database"] {
    background: rgba(37, 99, 235, 0.18) !important;
    border: 1px solid rgba(37, 99, 235, 0.4) !important;
    color: #60a5fa !important;
}

html[data-theme="dark"] a[href*="/pos/create"] {
    background: rgba(16, 185, 129, 0.18) !important;
    border: 1px solid rgba(16, 185, 129, 0.4) !important;
    color: #34d399 !important;
    font-weight: 600 !important;
}

html[data-theme="dark"] .dp-notif-menu,
html[data-theme="dark"] .dp-notif-dropdown {
    background: #11141d !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7) !important;
}

html[data-theme="dark"] .dp-notif-dropdown li a {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .dp-notif-dropdown li a:hover {
    background: #161a26 !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .dp-notif-header,
html[data-theme="dark"] .dp-notif-footer {
    border-color: rgba(255, 255, 255, 0.06) !important;
}

html[data-theme="dark"] .dp-notif-header span {
    color: #ffffff !important;
}

html[data-theme="dark"] .dp-notif-empty {
    color: #64748b !important;
}

html[data-theme="dark"] details.tw-dw-dropdown .tw-dw-dropdown-content {
    background-color: #11141d !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7) !important;
}

html[data-theme="dark"] details.tw-dw-dropdown .tw-dw-dropdown-content a {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] details.tw-dw-dropdown .tw-dw-dropdown-content a:hover {
    background-color: #161a26 !important;
    color: #ffffff !important;
}

/* ─── SIDEBAR FLUTUANTE DARK (DISTRIBUIPRO ONYX) ───────────── */
html[data-theme="dark"] aside.side-bar,
html[data-theme="dark"] .sidebar-distribuipro,
html[data-theme="dark"] .main-sidebar {
    background: #0d111c !important;
    border-right: 1px solid rgba(255, 255, 255, 0.07) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6) !important;
}

html[data-theme="dark"] .dp-brand-card {
    background: #0d111c !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07) !important;
}

html[data-theme="dark"] .dp-brand-title {
    color: #ffffff !important;
}

html[data-theme="dark"] .dp-brand-subtitle {
    color: #64748b !important;
}

html[data-theme="dark"] .dp-menu-header,
html[data-theme="dark"] .menu-section-title {
    color: #64748b !important;
    font-size: 10.5px !important;
    font-weight: 700 !important;
    letter-spacing: 0.1em !important;
    text-transform: uppercase !important;
}

html[data-theme="dark"] #side-bar a,
html[data-theme="dark"] #side-bar .drop_down,
html[data-theme="dark"] .sidebar-menu a {
    color: #9aa3b5 !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    letter-spacing: -0.01em !important;
}

html[data-theme="dark"] #side-bar a svg,
html[data-theme="dark"] #side-bar a i,
html[data-theme="dark"] #side-bar .drop_down svg,
html[data-theme="dark"] #side-bar .drop_down i {
    color: #64748b !important;
}

html[data-theme="dark"] #side-bar a:hover,
html[data-theme="dark"] #side-bar .drop_down:hover,
html[data-theme="dark"] .sidebar-menu a:hover {
    background-color: rgba(255, 255, 255, 0.04) !important;
    color: #ffffff !important;
}

html[data-theme="dark"] #side-bar a:hover svg,
html[data-theme="dark"] #side-bar a:hover i,
html[data-theme="dark"] #side-bar .drop_down:hover svg,
html[data-theme="dark"] #side-bar .drop_down:hover i {
    color: #818cf8 !important;
}

/* Item Ativo (Dashboard / Iniciar) */
html[data-theme="dark"] #side-bar a.theme-sidebar-active,
html[data-theme="dark"] #side-bar a.active,
html[data-theme="dark"] .sidebar-menu li.active > a {
    background: rgba(99, 102, 241, 0.16) !important;
    color: #818cf8 !important;
    border: none !important;
    border-radius: 12px !important;
    box-shadow: none !important;
}

html[data-theme="dark"] #side-bar a.theme-sidebar-active svg,
html[data-theme="dark"] #side-bar a.theme-sidebar-active i {
    color: #818cf8 !important;
}

html[data-theme="dark"] #side-bar .chiled {
    border-left-color: rgba(255, 255, 255, 0.06) !important;
}

html[data-theme="dark"] #side-bar .chiled a {
    color: #9aa3b5 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
}

html[data-theme="dark"] #side-bar .chiled a:hover {
    background-color: rgba(255, 255, 255, 0.03) !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .dp-search-input {
    background: #11141d !important;
    border-color: rgba(255, 255, 255, 0.07) !important;
    color: #e9ecf3 !important;
}

html[data-theme="dark"] .dp-toggle-btn {
    background: #11141d !important;
    border-color: rgba(255, 255, 255, 0.07) !important;
    color: #9aa3b5 !important;
}

html[data-theme="dark"] .dp-toggle-btn:hover {
    background: #161a26 !important;
    color: #ffffff !important;
    border-color: rgba(99, 102, 241, 0.4) !important;
}

/* ─── HERO BANNER VIBRANTE (IDÊNTICO AO DISTRIBUIPRO) ───────── */
html[data-theme="dark"] .dp-hero {
    background: linear-gradient(120deg, #1e1b4b 0%, #312e81 45%, #4f46e5 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 20px 40px -24px rgba(49, 46, 129, 0.7) !important;
    border-radius: 18px !important;
}

html[data-theme="dark"] .dp-hero-title {
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 24px !important;
    letter-spacing: -0.03em !important;
}

html[data-theme="dark"] .dp-hero-subtitle {
    color: rgba(255, 255, 255, 0.82) !important;
    font-size: 13.5px !important;
}

html[data-theme="dark"] .dp-hero-btn {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    border-radius: 12px !important;
    backdrop-filter: blur(8px) !important;
    transition: all 0.2s ease !important;
}

html[data-theme="dark"] .dp-hero-btn:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    color: #ffffff !important;
    transform: translateY(-1px) !important;
}

/* ─── TOOLBAR SUB-HEADER (DATA E FILTRO) ─────────────────────── */
html[data-theme="dark"] .dp-toolbar-date {
    color: #8e9cb2 !important;
    font-size: 13px !important;
}

html[data-theme="dark"] .dp-toolbar-date strong {
    color: #f1f5f9 !important;
    font-weight: 600 !important;
}

html[data-theme="dark"] .dp-live-badge {
    background: rgba(16, 185, 129, 0.12) !important;
    border: 1px solid rgba(16, 185, 129, 0.25) !important;
    color: #34d399 !important;
    border-radius: 999px !important;
    font-size: 11.5px !important;
    font-weight: 600 !important;
}

html[data-theme="dark"] .dp-live-dot {
    background: #22c55e !important;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6) !important;
}

/* Botão "Filtrar por data" - Preto Onyx, NUNCA branco */
html[data-theme="dark"] .dp-date-filter-btn,
html[data-theme="dark"] #dashboard_date_filter {
    background: #11141d !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #e9ecf3 !important;
    box-shadow: none !important;
    border-radius: 12px !important;
    font-weight: 600 !important;
}

html[data-theme="dark"] .dp-date-filter-btn:hover,
html[data-theme="dark"] #dashboard_date_filter:hover {
    background: #161a26 !important;
    border-color: rgba(99, 102, 241, 0.4) !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .dp-date-filter-btn i,
html[data-theme="dark"] #dashboard_date_filter i {
    color: #8e9cb2 !important;
}

/* ─── STAT CARDS (KPIS PRETO ONYX COM ÍCONES TRANSLÚCIDOS) ──── */
html[data-theme="dark"] .dp-stat-card,
html[data-theme="dark"] .dp-kpi-card,
html[data-theme="dark"] .stat-card {
    background: #11141d !important;
    border: 1px solid rgba(255, 255, 255, 0.07) !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35) !important;
    position: relative !important;
    overflow: hidden !important;
}

html[data-theme="dark"] .dp-stat-card:hover,
html[data-theme="dark"] .dp-kpi-card:hover,
html[data-theme="dark"] .stat-card:hover {
    background: #151924 !important;
    border-color: rgba(255, 255, 255, 0.14) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5) !important;
}

/* Linha sutil de destaque no topo de cada card */
html[data-theme="dark"] .dp-stat-card::before,
html[data-theme="dark"] .dp-kpi-card::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 2.5px !important;
    opacity: 0.85 !important;
}

html[data-theme="dark"] .dp-card-blue::before   { background: linear-gradient(90deg, #3b82f6, transparent 75%) !important; }
html[data-theme="dark"] .dp-card-green::before  { background: linear-gradient(90deg, #10b981, transparent 75%) !important; }
html[data-theme="dark"] .dp-card-yellow::before { background: linear-gradient(90deg, #f59e0b, transparent 75%) !important; }
html[data-theme="dark"] .dp-card-purple::before { background: linear-gradient(90deg, #a855f7, transparent 75%) !important; }
html[data-theme="dark"] .dp-card-red::before    { background: linear-gradient(90deg, #ef4444, transparent 75%) !important; }
html[data-theme="dark"] .dp-card-orange::before { background: linear-gradient(90deg, #f97316, transparent 75%) !important; }

/* Tipografia dos Cards */
html[data-theme="dark"] .dp-stat-label,
html[data-theme="dark"] .dp-kpi-label,
html[data-theme="dark"] .stat-label {
    color: #8e9cb2 !important;
    font-size: 13px !important;
    font-weight: 550 !important;
}

html[data-theme="dark"] .dp-stat-value,
html[data-theme="dark"] .dp-kpi-val,
html[data-theme="dark"] .stat-value {
    color: #ffffff !important;
    font-size: 26px !important;
    font-weight: 800 !important;
    letter-spacing: -0.03em !important;
}

html[data-theme="dark"] .dp-stat-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
}

/* Tag do Rodapé do Card - Preto sutil, NUNCA branca */
html[data-theme="dark"] .dp-stat-tag,
html[data-theme="dark"] .dp-kpi-sub {
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    color: #64748b !important;
    font-weight: 500 !important;
    font-size: 11px !important;
}

html[data-theme="dark"] .dp-stat-link {
    color: #818cf8 !important;
    font-weight: 600 !important;
    font-size: 11.5px !important;
}

html[data-theme="dark"] .dp-stat-link:hover {
    color: #a5b4fc !important;
}

/* ─── ÍCONES TRANSLÚCIDOS ELEGANTES (NUNCA FUNDO BRANCO!) ───── */
html[data-theme="dark"] .dp-stat-icon,
html[data-theme="dark"] .stat-icon {
    width: 36px !important;
    height: 36px !important;
    border-radius: 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 15px !important;
    border: 1px solid transparent !important;
}

html[data-theme="dark"] .dp-icon-blue,
html[data-theme="dark"] .stat-icon.blue {
    background: rgba(59, 130, 246, 0.12) !important;
    color: #60a5fa !important;
    border-color: rgba(59, 130, 246, 0.22) !important;
}

html[data-theme="dark"] .dp-icon-green,
html[data-theme="dark"] .stat-icon.green {
    background: rgba(16, 185, 129, 0.12) !important;
    color: #34d399 !important;
    border-color: rgba(16, 185, 129, 0.22) !important;
}

html[data-theme="dark"] .dp-icon-yellow,
html[data-theme="dark"] .stat-icon.yellow {
    background: rgba(245, 158, 11, 0.12) !important;
    color: #fbbf24 !important;
    border-color: rgba(245, 158, 11, 0.22) !important;
}

html[data-theme="dark"] .dp-icon-purple,
html[data-theme="dark"] .stat-icon.purple {
    background: rgba(168, 85, 247, 0.14) !important;
    color: #c084fc !important;
    border-color: rgba(168, 85, 247, 0.22) !important;
}

html[data-theme="dark"] .dp-icon-red,
html[data-theme="dark"] .stat-icon.red {
    background: rgba(239, 68, 68, 0.12) !important;
    color: #f87171 !important;
    border-color: rgba(239, 68, 68, 0.22) !important;
}

html[data-theme="dark"] .dp-icon-orange,
html[data-theme="dark"] .stat-icon.orange {
    background: rgba(249, 115, 22, 0.12) !important;
    color: #fb923c !important;
    border-color: rgba(249, 115, 22, 0.22) !important;
}

/* ─── BOTÃO FLUTUANTE DE NOVIDADES (BULLHORN) ──────────────── */
html[data-theme="dark"] .btn-floating-updates {
    background: #151924 !important;
    border: 1px solid rgba(99, 102, 241, 0.35) !important;
    color: #818cf8 !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6) !important;
}

html[data-theme="dark"] .btn-floating-updates:hover {
    background: #1e1b4b !important;
    color: #ffffff !important;
    border-color: #6366f1 !important;
}

/* ─── BOXES, CARDS & PAINÉIS (ADMINLTE & BOOTSTRAP) ────────── */
html[data-theme="dark"] .box,
html[data-theme="dark"] .card,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .tw-bg-white,
html[data-theme="dark"] .bg-white {
    background-color: #11141d !important;
    border: 1px solid rgba(255, 255, 255, 0.07) !important;
    color: #e9ecf3 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35) !important;
}

html[data-theme="dark"] .box-header,
html[data-theme="dark"] .card-header,
html[data-theme="dark"] .panel-heading {
    background-color: transparent !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07) !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .box-title,
html[data-theme="dark"] .card-title,
html[data-theme="dark"] .panel-title {
    color: #ffffff !important;
}

html[data-theme="dark"] .box-body,
html[data-theme="dark"] .card-body,
html[data-theme="dark"] .panel-body {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .box-footer,
html[data-theme="dark"] .card-footer,
html[data-theme="dark"] .panel-footer {
    background-color: #0d111c !important;
    border-top: 1px solid rgba(255, 255, 255, 0.07) !important;
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .box-solid {
    border-color: rgba(255, 255, 255, 0.07) !important;
}

/* ─── UTILITÁRIOS TAILWIND ──────────────────────────────────── */
html[data-theme="dark"] .tw-bg-white {
    background-color: #11141d !important;
}

html[data-theme="dark"] .tw-bg-gray-50 {
    background-color: #0b0d14 !important;
}

html[data-theme="dark"] .tw-bg-gray-100 {
    background-color: #0e1119 !important;
}

html[data-theme="dark"] .tw-bg-gray-200 {
    background-color: #161a26 !important;
}

html[data-theme="dark"] .tw-text-gray-900,
html[data-theme="dark"] .tw-text-gray-800 {
    color: #ffffff !important;
}

html[data-theme="dark"] .tw-text-gray-700,
html[data-theme="dark"] .tw-text-gray-600 {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .tw-text-gray-500 {
    color: #9aa3b5 !important;
}

html[data-theme="dark"] .tw-text-gray-400 {
    color: #64748b !important;
}

html[data-theme="dark"] .tw-border-gray-200,
html[data-theme="dark"] .tw-border-gray-300 {
    border-color: rgba(255, 255, 255, 0.07) !important;
}

html[data-theme="dark"] .tw-ring-gray-200,
html[data-theme="dark"] .tw-ring-gray-300 {
    --tw-ring-color: rgba(255, 255, 255, 0.07) !important;
    border-color: rgba(255, 255, 255, 0.07) !important;
}

html[data-theme="dark"] .tw-divide-gray-200 > :not([hidden]) ~ :not([hidden]) {
    border-color: rgba(255, 255, 255, 0.07) !important;
}

/* ─── FORMULÁRIOS & INPUTS (PRETO SUAVE ONYX) ───────────────── */
html[data-theme="dark"] .form-control,
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="search"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
    background-color: #0e1119 !important;
    border: 1px solid rgba(255, 255, 255, 0.09) !important;
    color: #e9ecf3 !important;
}

html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus {
    border-color: #6366f1 !important;
    background-color: #12151f !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25) !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .input-group-addon {
    background-color: #11141d !important;
    border: 1px solid rgba(255, 255, 255, 0.09) !important;
    color: #9aa3b5 !important;
}

html[data-theme="dark"] label {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .help-block,
html[data-theme="dark"] .text-muted {
    color: #64748b !important;
}

/* ─── SELECT2 DARK ──────────────────────────────────────────── */
html[data-theme="dark"] .select2-container--default .select2-selection--single,
html[data-theme="dark"] .select2-container--default .select2-selection--multiple {
    background-color: #0e1119 !important;
    border: 1px solid rgba(255, 255, 255, 0.09) !important;
    color: #e9ecf3 !important;
}

html[data-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #e9ecf3 !important;
}

html[data-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #9aa3b5 transparent transparent transparent !important;
}

html[data-theme="dark"] .select2-dropdown {
    background-color: #11141d !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #e9ecf3 !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7) !important;
}

html[data-theme="dark"] .select2-search--dropdown .select2-search__field {
    background-color: #0e1119 !important;
    border: 1px solid rgba(255, 255, 255, 0.09) !important;
    color: #e9ecf3 !important;
}

html[data-theme="dark"] .select2-results__option {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .select2-results__option--highlighted {
    background-color: #6366f1 !important;
    color: #ffffff !important;
}

/* ─── TABELAS & DATATABLES ──────────────────────────────────── */
html[data-theme="dark"] .table {
    color: #cbd5e1 !important;
    border-color: rgba(255, 255, 255, 0.07) !important;
}

html[data-theme="dark"] .table > thead > tr > th {
    background-color: #0e1119 !important;
    color: #9aa3b5 !important;
    font-size: 11.5px !important;
    font-weight: 600 !important;
    letter-spacing: 0.04em !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-top: none !important;
}

html[data-theme="dark"] .table > tbody > tr > td {
    border-top: 1px solid rgba(255, 255, 255, 0.04) !important;
    color: #e9ecf3 !important;
}

html[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) {
    background-color: rgba(255, 255, 255, 0.015) !important;
}

html[data-theme="dark"] .table-hover > tbody > tr:hover {
    background-color: rgba(99, 102, 241, 0.05) !important;
}

html[data-theme="dark"] .dataTables_wrapper {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .dataTables_wrapper .dataTables_length select {
    background-color: #0e1119 !important;
    border: 1px solid rgba(255, 255, 255, 0.09) !important;
    color: #e9ecf3 !important;
}

html[data-theme="dark"] .dataTables_wrapper .dataTables_filter input {
    background-color: #0e1119 !important;
    border: 1px solid rgba(255, 255, 255, 0.09) !important;
    color: #e9ecf3 !important;
}

html[data-theme="dark"] .dataTables_wrapper .dataTables_info {
    color: #64748b !important;
}

html[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button {
    color: #9aa3b5 !important;
    background: transparent !important;
    border: 1px solid transparent !important;
}

html[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.current,
html[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: #6366f1 !important;
    color: #ffffff !important;
    border-color: #6366f1 !important;
    border-radius: 8px !important;
}

html[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #161a26 !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* ─── BOTÕES & BADGES ───────────────────────────────────────── */
html[data-theme="dark"] .btn-default {
    background-color: #11141d !important;
    color: #cbd5e1 !important;
    border: 1px solid rgba(255, 255, 255, 0.09) !important;
}

html[data-theme="dark"] .btn-default:hover,
html[data-theme="dark"] .btn-default:focus {
    background-color: #161a26 !important;
    color: #ffffff !important;
    border-color: rgba(99, 102, 241, 0.4) !important;
}

html[data-theme="dark"] .dt-buttons .btn {
    background-color: #11141d !important;
    border: 1px solid rgba(255, 255, 255, 0.09) !important;
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .dt-buttons .btn:hover {
    background-color: #161a26 !important;
    color: #ffffff !important;
    border-color: rgba(99, 102, 241, 0.4) !important;
}

/* ─── MODAIS (BOOTSTRAP & SWEETALERT) ───────────────────────── */
html[data-theme="dark"] .modal-content {
    background-color: #11141d !important;
    border: 1px solid rgba(255, 255, 255, 0.09) !important;
    color: #e9ecf3 !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7) !important;
}

html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer {
    border-color: rgba(255, 255, 255, 0.07) !important;
}

html[data-theme="dark"] .modal-title {
    color: #ffffff !important;
}

html[data-theme="dark"] .close {
    color: #9aa3b5 !important;
    opacity: 0.8 !important;
}

html[data-theme="dark"] .close:hover {
    color: #ffffff !important;
    opacity: 1 !important;
}

html[data-theme="dark"] .swal2-popup {
    background-color: #11141d !important;
    color: #e9ecf3 !important;
    border: 1px solid rgba(255, 255, 255, 0.09) !important;
}

html[data-theme="dark"] .swal2-title {
    color: #ffffff !important;
}

html[data-theme="dark"] .swal2-html-container {
    color: #cbd5e1 !important;
}

/* ─── DATERANGEPICKER POPUP ─────────────────────────────────── */
html[data-theme="dark"] .daterangepicker {
    background-color: #11141d !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7) !important;
}

html[data-theme="dark"] .daterangepicker:before,
html[data-theme="dark"] .daterangepicker:after {
    border-bottom-color: #11141d !important;
}

html[data-theme="dark"] .daterangepicker .calendar-table {
    background-color: #11141d !important;
    border-color: transparent !important;
}

html[data-theme="dark"] .daterangepicker td.available:hover,
html[data-theme="dark"] .daterangepicker th.available:hover {
    background-color: #181c29 !important;
}

html[data-theme="dark"] .daterangepicker td.active,
html[data-theme="dark"] .daterangepicker td.active:hover {
    background-color: #6366f1 !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .daterangepicker td.in-range {
    background-color: rgba(99, 102, 241, 0.18) !important;
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .daterangepicker .ranges li {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .daterangepicker .ranges li:hover {
    background-color: #181c29 !important;
}

html[data-theme="dark"] .daterangepicker .ranges li.active {
    background-color: #6366f1 !important;
    color: #ffffff !important;
}

/* ─── MOBILE DARK (PADRÃO DISTRIBUIPRO) ─────────────────────── */
html[data-theme="dark"] .dp-mobile-overlay {
    background: rgba(0, 0, 0, 0.72) !important;
}

html[data-theme="dark"] .dp-mobile-menu-btn {
    background: #11141d !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    color: #e9ecf3 !important;
}

html[data-theme="dark"] .dp-mobile-menu-btn:hover {
    background: #161a26 !important;
    border-color: rgba(99, 102, 241, 0.4) !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .dp-mobile-close-btn {
    background: #181c29 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #9aa3b5 !important;
}

html[data-theme="dark"] .dp-mobile-close-btn:hover {
    background: #202637 !important;
    color: #ffffff !important;
}

html[data-theme="dark"] aside.side-bar::-webkit-scrollbar-thumb,
html[data-theme="dark"] #side-bar::-webkit-scrollbar-thumb,
html[data-theme="dark"] .dp-menu-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.14) !important;
}

html[data-theme="dark"] aside.side-bar.dp-mobile-open,
html[data-theme="dark"] .sidebar-distribuipro.dp-mobile-open {
    box-shadow: 14px 0 50px rgba(0, 0, 0, 0.8) !important;
}

/* ─── TABBAR MOBILE DARK (PADRÃO DISTRIBUIPRO) ─────────────── */
html[data-theme="dark"] .st-tabbar,
html[data-theme="dark"] .dp-tabbar {
    background: rgba(17, 20, 29, 0.88) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7) !important;
}

html[data-theme="dark"] .st-tabbar a,
html[data-theme="dark"] .dp-tabbar a {
    color: #64748b !important;
}

html[data-theme="dark"] .st-tabbar a.st-on,
html[data-theme="dark"] .dp-tabbar a.st-on {
    color: #818cf8 !important;
    background: rgba(99, 102, 241, 0.16) !important;
}

html[data-theme="dark"] .st-tabbar a.st-tab-pdv span,
html[data-theme="dark"] .dp-tabbar a.st-tab-pdv span {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .dp-header-mobile-title h2 {
    color: #ffffff !important;
}

html[data-theme="dark"] .dp-period-btn {
    background: #11141d !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    color: #9aa3b5 !important;
}

html[data-theme="dark"] .dp-period-btn:hover {
    background: #161a26 !important;
    border-color: rgba(99, 102, 241, 0.4) !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .dp-period-btn.active {
    background: #6366f1 !important;
    border-color: #6366f1 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35) !important;
}

/* ─── TRANSIÇÃO SUAVE ───────────────────────────────────────── */
body,
aside.side-bar,
.dp-navbar,
.dp-brand-card,
.box,
.card,
.dp-stat-card,
.form-control {
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
