/* ============================================================
   style.css — HUB de Ideias
   Identidade visual: Dark mode, roxo #9900CC, glassmorphism
   ============================================================ */

/* ============================================================
   [1] VARIÁVEIS CSS (TOKENS)
   ============================================================ */
:root {
    --primary:        #9900CC;
    --primary-light:  #BB33FF;
    --primary-dark:   #6600AA;
    --primary-glow:   rgba(153, 0, 204, 0.4);

    --bg-dark:        #121212;
    --bg-dark-2:      #1a1a2e;
    --bg-card:        rgba(255, 255, 255, 0.04);
    --bg-card-hover:  rgba(153, 0, 204, 0.08);
    --bg-input:       rgba(255, 255, 255, 0.07);

    --text-primary:   #f0f0f0;
    --text-secondary: #aaaaaa;
    --text-muted:     #666666;

    --border-color:   rgba(255, 255, 255, 0.08);
    --border-primary:  rgba(153, 0, 204, 0.3);

    --success:        #00CC66;
    --warning:        #FFAA00;
    --danger:         #FF3355;
    --info:           #0099FF;

    --header-height:  70px;
    --menu-width:     280px;
    --border-radius:  10px;
    --transition:     0.25s ease;
}

/* Light mode */
[data-theme="light"] {
    --bg-dark:        #f4f4f8;
    --bg-dark-2:      #e8e8f0;
    --bg-card:        rgba(255, 255, 255, 0.85);
    --bg-card-hover:  rgba(153, 0, 204, 0.06);
    --bg-input:       rgba(0, 0, 0, 0.05);
    --text-primary:   #1a1a2e;
    --text-secondary: #444444;
    --text-muted:     #888888;
    --border-color:   rgba(0, 0, 0, 0.1);
}

/* ── Força Bootstrap 5.3 a usar fundo correto nas tabelas por tema ────────
   Bootstrap 5.3 calcula o bg das células via:
     --bs-table-bg + --bs-table-bg-state + --bs-table-striped-bg
   Precisamos sobrescrever TODAS essas variáveis por tema.
   Também forçamos via seletor direto em tbody tr > * para cobrir
   o caso em que Bootstrap injeta inline style nas células. */

html[data-theme="dark"] {
    --bs-body-bg:              #1a1a2e;
    --bs-body-color:           #f0f0f0;
    --bs-table-bg:             #1a1a2e;
    --bs-table-color:          #f0f0f0;
    --bs-table-border-color:   rgba(255,255,255,0.08);
    --bs-table-striped-bg:     rgba(255,255,255,0.03);
    --bs-table-striped-color:  #f0f0f0;
    --bs-table-active-bg:      rgba(153,0,204,0.15);
    --bs-table-active-color:   #f0f0f0;
    --bs-table-hover-bg:       rgba(153,0,204,0.08);
    --bs-table-hover-color:    #f0f0f0;
    color-scheme: dark;
}

html[data-theme="light"] {
    --bs-body-bg:              #ffffff;
    --bs-body-color:           #1a1a2e;
    --bs-table-bg:             #ffffff;
    --bs-table-color:          #1a1a2e;
    --bs-table-border-color:   rgba(0,0,0,0.1);
    --bs-table-striped-bg:     rgba(0,0,0,0.025);
    --bs-table-striped-color:  #1a1a2e;
    --bs-table-active-bg:      rgba(153,0,204,0.10);
    --bs-table-active-color:   #1a1a2e;
    --bs-table-hover-bg:       rgba(153,0,204,0.06);
    --bs-table-hover-color:    #1a1a2e;
    color-scheme: light;
}

/* ============================================================
   [2] RESET E BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Titillium Web', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    padding-top: var(--header-height);
    transition: background-color var(--transition), color var(--transition);
}

a { color: var(--primary-light); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary); }

h1, h2, h3, h4, h5, h6 {
    font-family: 'Titillium Web', sans-serif;
    font-weight: 700;
    color: var(--text-primary);
}

/* ============================================================
   [3] HEADER FIXO
   ============================================================ */
#mainHeader {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-height);
    background: rgba(18, 18, 18, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1030;
    display: flex;
    flex-direction: column;
}

[data-theme="light"] #mainHeader {
    background: rgba(255, 255, 255, 0.95);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: calc(var(--header-height) - 4px);
    gap: 16px;
}

.header-line {
    height: 3px;
    background: linear-gradient(90deg, #9900CC, #FF3399, #FF6600, #FFCC00, #00CC66, #0099FF, #9900CC);
    background-size: 200% 100%;
    animation: rainbowMove 4s linear infinite;
}

@keyframes rainbowMove {
    0%   { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

/* Logo */
.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-icon {
    width: 36px; height: 36px;
    background: var(--primary);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: white;
    font-size: 1rem;
    box-shadow: 0 0 12px var(--primary-glow);
}

.logo-text {
    font-family: 'Titillium Web', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}

.logo-accent { color: var(--primary); }

/* Busca */


/* Ações do header */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.btn-icon {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 36px; height: 36px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    font-size: 0.9rem;
}

.btn-icon:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
    color: var(--primary);
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.2;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-badge {
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 10px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
}

.badge-tipo-1 { background: var(--primary); color: white; }
.badge-tipo-2 { background: var(--info); color: white; }
.badge-tipo-3 { background: var(--success); color: white; }
.badge-tipo-5 { background: var(--warning); color: #1a1a2e; }

/* ============================================================
   [4] MENU LATERAL (abre pela direita)
   ============================================================ */
.side-menu {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: var(--menu-width);
    background: #0d0d1a;
    border-left: 1px solid var(--border-color);
    z-index: 2000;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}

[data-theme="light"] .side-menu {
    background: #ffffff;
    border-left-color: var(--border-color);
}

.side-menu.open { transform: translateX(0); }

.menu-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1999;
    backdrop-filter: blur(2px);
}

.menu-backdrop.show { display: block; }

.side-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 16px 16px;
    border-bottom: 1px solid var(--border-color);
}

.side-menu-logo {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
}

.close-menu {
    width: 32px; height: 32px;
    border-radius: 6px;
}

.side-menu-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-card);
    margin: 12px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-primary);
    position: relative;
}

.user-avatar { font-size: 2rem; color: var(--primary); }

.user-details { display: flex; flex-direction: column; }

.user-fullname {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.75rem;
    color: var(--primary-light);
    font-family: 'Poppins', sans-serif;
}

.side-menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 16px;
}

.side-menu-nav {
    list-style: none;
    padding: 8px 0;
    flex: 1;
}

.menu-section-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    padding: 12px 16px 4px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
}

.menu-item { position: relative; }

.menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition);
    border-radius: 0;
    font-size: 0.9rem;
    position: relative;
}

.menu-link:hover {
    background: var(--bg-card-hover);
    color: var(--primary-light);
    padding-left: 20px;
}

.menu-item.active .menu-link {
    background: var(--bg-card-hover);
    color: var(--primary);
    border-right: 3px solid var(--primary);
}

.menu-icon {
    width: 18px;
    text-align: center;
    font-size: 0.85rem;
    filter: drop-shadow(0 0 4px var(--primary-glow));
}

.menu-active-dot {
    width: 6px; height: 6px;
    background: var(--primary);
    border-radius: 50%;
    margin-left: auto;
    box-shadow: 0 0 6px var(--primary);
}

.side-menu-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
}

.version-info {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: 'Poppins', sans-serif;
}

/* Logout no menu lateral */
.side-menu-logout {
    padding: 4px 0;
}
.side-menu-logout .logout-link {
    color: var(--danger) !important;
    transition: background 0.2s ease, padding-left 0.2s ease;
}
.side-menu-logout .logout-link:hover {
    background: rgba(220, 53, 69, 0.1) !important;
    color: var(--danger) !important;
    padding-left: 20px;
}
.side-menu-logout .menu-icon {
    filter: none;
}

/* ============================================================
   [5] LAYOUT PRINCIPAL
   ============================================================ */
.main-content {
    padding: 24px 20px;
    max-width: 1400px;
    margin: 0 auto;
    min-height: calc(100vh - var(--header-height) - 60px);
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-title-icon {
    color: var(--primary);
    font-size: 1.3rem;
}

/* ============================================================
   [6] CARDS GLASSMORPHISM
   ============================================================ */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all var(--transition);
    overflow: hidden;
}

.glass-card:hover {
    border-color: var(--border-primary);
    box-shadow: 0 4px 20px var(--primary-glow);
    transform: translateY(-2px);
}

/* KPI Cards */
.kpi-card {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.kpi-icon {
    width: 52px; height: 52px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.kpi-icon.purple { background: rgba(153, 0, 204, 0.2); color: var(--primary); }
.kpi-icon.green  { background: rgba(0, 204, 102, 0.2); color: var(--success); }
.kpi-icon.blue   { background: rgba(0, 153, 255, 0.2); color: var(--info); }
.kpi-icon.orange { background: rgba(255, 170, 0, 0.2); color: var(--warning); }
.kpi-icon.red    { background: rgba(255, 51, 85, 0.2);  color: var(--danger); }

.kpi-info { flex: 1; }

.kpi-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
}

.kpi-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: 'Poppins', sans-serif;
}

.kpi-trend {
    font-size: 0.75rem;
    font-family: 'Poppins', sans-serif;
    margin-top: 4px;
}

.kpi-trend.up   { color: var(--success); }
.kpi-trend.down { color: var(--danger); }

/* Platform Cards */
.platform-card {
    padding: 0;
    cursor: default;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.platform-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(153, 0, 204, 0.25);
}

.platform-card-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: var(--bg-dark-2);
    display: flex; align-items: center; justify-content: center;
    font-size: 3rem;
    color: var(--primary);
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.platform-card-img .card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(153, 0, 204, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.platform-card:hover .card-overlay {
    opacity: 1;
}

.platform-card-body { padding: 16px; }

.platform-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.platform-card-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.platform-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
}

.platform-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.platform-tag {
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(153, 0, 204, 0.15);
    color: var(--primary-light);
    font-family: 'Poppins', sans-serif;
    border: 1px solid var(--border-primary);
}

/* ============================================================
   [7] BOTÕES
   ============================================================ */
.btn-primary-hub {
    background: var(--primary);
    border: none;
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary-hub:hover {
    background: var(--primary-light);
    box-shadow: 0 4px 16px var(--primary-glow);
    transform: translateY(-1px);
    color: white;
}

.btn-success-hub {
    background: var(--success);
    border: none;
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-success-hub:hover {
    background: #00e078;
    box-shadow: 0 4px 16px rgba(0, 204, 102, 0.4);
    transform: translateY(-1px);
    color: white;
}

.btn-outline-hub {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-outline-hub:hover {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 16px var(--primary-glow);
}

/* ============================================================
   [8] TABELAS — override do Bootstrap 5.3 + DataTables Bootstrap5
   ================================================================
   Bootstrap 5.3 aplica fundo nas células via DOIS mecanismos:
     1) background-color: var(--bs-table-bg)  ← resolve para --bs-body-bg
     2) box-shadow: inset 0 0 0 9999px var(--bs-table-bg-state, ...)  ← hover/stripe
   DataTables define: table.dataTable > tbody > tr { background: transparent }
   A solução: sobrescrever --bs-table-bg e --bs-body-bg no escopo da tabela,
   e zerar o box-shadow inset que o Bootstrap usa para colorir células.
   ================================================================ */

/* ── Zera o box-shadow inset do Bootstrap (hover/stripe usam isso) ── */
.table > :not(caption) > * > * {
    box-shadow: none !important;
}

/* ── DARK ─────────────────────────────────────────────────────────── */
html[data-theme="dark"] .table,
html[data-theme="dark"] table.dataTable {
    --bs-table-bg:           #1a1a2e;
    --bs-table-color:        #f0f0f0;
    --bs-table-border-color: rgba(255,255,255,0.08);
    --bs-table-striped-bg:   rgba(255,255,255,0.03);
    --bs-table-hover-bg:     rgba(153,0,204,0.10);
    --bs-table-bg-state:     transparent;
    --bs-table-bg-type:      transparent;
    --bs-table-accent-bg:    transparent;
    --bs-body-bg:            #1a1a2e;
    color: #f0f0f0;
}
html[data-theme="dark"] .table > :not(caption) > * > *,
html[data-theme="dark"] table.dataTable > :not(caption) > * > * {
    background-color: #1a1a2e !important;
    color: #f0f0f0 !important;
    border-color: rgba(255,255,255,0.08) !important;
}
html[data-theme="dark"] .table-hover > tbody > tr:hover > *,
html[data-theme="dark"] table.dataTable.table-hover > tbody > tr:hover > * {
    background-color: rgba(153,0,204,0.10) !important;
}

/* ── LIGHT ────────────────────────────────────────────────────────── */
html[data-theme="light"] .table,
html[data-theme="light"] table.dataTable {
    --bs-table-bg:           #ffffff;
    --bs-table-color:        #1a1a2e;
    --bs-table-border-color: rgba(0,0,0,0.10);
    --bs-table-striped-bg:   rgba(0,0,0,0.025);
    --bs-table-hover-bg:     rgba(153,0,204,0.06);
    --bs-table-bg-state:     transparent;
    --bs-table-bg-type:      transparent;
    --bs-table-accent-bg:    transparent;
    --bs-body-bg:            #ffffff;
    color: #1a1a2e;
}
html[data-theme="light"] .table > :not(caption) > * > *,
html[data-theme="light"] table.dataTable > :not(caption) > * > * {
    background-color: #ffffff !important;
    color: #1a1a2e !important;
    border-color: rgba(0,0,0,0.10) !important;
}
html[data-theme="light"] .table-hover > tbody > tr:hover > *,
html[data-theme="light"] table.dataTable.table-hover > tbody > tr:hover > * {
    background-color: rgba(153,0,204,0.06) !important;
}

/* ── Thead ────────────────────────────────────────────────────────── */

html[data-theme="dark"] .table thead td,
html[data-theme="dark"] .table thead th,
html[data-theme="dark"] table.dataTable thead td,
html[data-theme="dark"] table.dataTable thead th,
html[data-theme="dark"] table.dataTable thead th.sorting,
html[data-theme="dark"] table.dataTable thead th.sorting_asc,
html[data-theme="dark"] table.dataTable thead th.sorting_desc {
    background-color: #1a1a2e !important;
    color: var(--primary) !important;
    border-color: rgba(255,255,255,0.08) !important;
    border-bottom: 2px solid var(--primary) !important;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

html[data-theme="light"] .table thead td,
html[data-theme="light"] .table thead th,
html[data-theme="light"] table.dataTable thead td,
html[data-theme="light"] table.dataTable thead th,
html[data-theme="light"] table.dataTable thead th.sorting,
html[data-theme="light"] table.dataTable thead th.sorting_asc,
html[data-theme="light"] table.dataTable thead th.sorting_desc {
    background-color: #f0f0f5 !important;
    color: var(--primary) !important;
    border-color: rgba(0,0,0,0.10) !important;
    border-bottom: 2px solid var(--primary) !important;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── Containers do DataTables ─────────────────────────────────────── *//* ── LIGHT: striped ── */
html[data-theme="light"] .table-striped tbody tr:nth-of-type(even) td,
html[data-theme="light"] .table-striped tbody tr:nth-of-type(even) th,
html[data-theme="light"] table.dataTable.table-striped tbody tr:nth-of-type(even) td {
    background-color: rgba(0,0,0,0.025) !important;
}

/* ── LIGHT: hover ── */
html[data-theme="light"] .table-hover tbody tr:hover td,
html[data-theme="light"] .table-hover tbody tr:hover th,
html[data-theme="light"] table.dataTable tbody tr:hover td,
html[data-theme="light"] table.dataTable tbody tr:hover th {
    background-color: rgba(153,0,204,0.06) !important;
    color: #1a1a2e !important;
}

/* ── LIGHT: rodapé ── */
html[data-theme="light"] .table tfoot td,
html[data-theme="light"] .table tfoot th,
html[data-theme="light"] table.dataTable tfoot td,
html[data-theme="light"] table.dataTable tfoot th {
    background-color: rgba(153,0,204,0.05) !important;
    color: #444444 !important;
    border-color: rgba(0,0,0,0.1) !important;
}

/* ── Selecionada ── */
table.dataTable tbody tr.selected > td,
table.dataTable tbody tr.selected > th {
    background-color: rgba(153,0,204,0.18) !important;
    color: var(--text-primary) !important;
}

/* ── Responsive child rows ── */
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control::before,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control::before {
    background-color: var(--primary) !important;
    color: #fff !important;
}
tr.child td.child,
tr.child ul.dtr-details {
    background-color: rgba(153,0,204,0.06) !important;
    color: var(--text-primary) !important;
}
tr.child ul.dtr-details li {
    border-bottom-color: var(--border-color) !important;
}
tr.child ul.dtr-details .dtr-title {
    color: var(--primary-light) !important;
}

/* ── Bordered ── */
.table-bordered > :not(caption) > * > * {
    border-color: var(--border-color) !important;
}

/* ── Controles DataTables ── */
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    background: var(--bg-input) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    border-radius: 6px !important;
    padding: 6px 10px !important;
}
.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--primary) !important;
    outline: none !important;
    box-shadow: 0 0 0 2px var(--primary-glow) !important;
}
.dataTables_wrapper .dataTables_filter label,
.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_info {
    color: var(--text-secondary) !important;
}

/* ── Paginação ── */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    color: var(--text-secondary) !important;
    background: transparent !important;
    border-color: transparent !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
    border-radius: 6px !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--bg-card-hover) !important;
    border-color: var(--primary) !important;
    color: var(--primary) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
    color: var(--text-muted) !important;
    background: transparent !important;
    border-color: transparent !important;
}

/* ── Botões exportação ── */
.dt-buttons .btn {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-secondary) !important;
    font-size: 0.8rem !important;
    border-radius: 6px !important;
    transition: all var(--transition) !important;
}
.dt-buttons .btn:hover {
    border-color: var(--primary) !important;
    color: var(--primary) !important;
    background: var(--bg-card-hover) !important;
}

/* ============================================================
   [9] MODAIS
   ============================================================ */
.modal-content {
    background: #1a1a2e !important;
    border: 1px solid var(--border-primary) !important;
    border-radius: 12px !important;
    color: var(--text-primary) !important;
}

[data-theme="light"] .modal-content {
    background: #ffffff !important;
}

.modal-header {
    border-bottom: 1px solid var(--border-color) !important;
    padding: 16px 20px !important;
}

.modal-title {
    color: var(--primary) !important;
    font-weight: 700 !important;
}

.modal-footer {
    border-top: 1px solid var(--border-color) !important;
}

.btn-close {
    filter: invert(1) !important;
}

[data-theme="light"] .btn-close {
    filter: none !important;
}

/* ============================================================
   [10] FORMULÁRIOS
   ============================================================ */
.form-control, .form-select {
    background: var(--bg-input) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    border-radius: 8px !important;
    transition: all var(--transition) !important;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px var(--primary-glow) !important;
    background: var(--bg-input) !important;
    color: var(--text-primary) !important;
}

.form-label {
    color: var(--text-secondary) !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    margin-bottom: 6px !important;
}

.form-control::placeholder { color: var(--text-muted) !important; }

/* ============================================================
   [11] GRÁFICOS
   ============================================================ */
.chart-container {
    position: relative;
    padding: 20px;
    min-height: 320px;
}
.chart-container canvas {
    display: block;
    max-width: 100%;
}

.chart-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-family: 'Poppins', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================================
   [12] BADGES E STATUS
   ============================================================ */
.badge {
    font-family: 'Poppins', sans-serif !important;
    font-size: 0.7rem !important;
    padding: 4px 10px !important;
    border-radius: 10px !important;
}

.status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

.status-dot.online {
    background: var(--success);
    box-shadow: 0 0 6px var(--success);
    animation: pulse 2s infinite;
}

.status-dot.offline { background: var(--text-muted); }

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.6; transform: scale(1.3); }
}

/* ============================================================
   [13] TOASTR CUSTOMIZADO
   ============================================================ */
#toast-container > .toast {
    border-radius: 8px !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4) !important;
    font-family: 'Titillium Web', sans-serif !important;
}

#toast-container > .toast-success { background: #1a3a2a !important; border-left: 4px solid var(--success) !important; }
#toast-container > .toast-error   { background: #3a1a1a !important; border-left: 4px solid var(--danger) !important; }
#toast-container > .toast-warning { background: #3a2a1a !important; border-left: 4px solid var(--warning) !important; }
#toast-container > .toast-info    { background: #1a2a3a !important; border-left: 4px solid var(--info) !important; }

/* ============================================================
   [14] FOOTER
   ============================================================ */
.main-footer {
    background: var(--bg-dark);
    border-top: 1px solid var(--border-color);
    padding: 16px 20px;
    margin-top: 40px;
}

.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ============================================================
   [15] RESPONSIVIDADE
   ============================================================ */
@media (max-width: 768px) {
    .user-info { display: none; }
    .main-content { padding: 16px 12px; }
    .kpi-value { font-size: 1.4rem; }
}

@media (max-width: 576px) {
    .page-header { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   [16] UTILITÁRIOS
   ============================================================ */
.text-purple { color: var(--primary) !important; }
.bg-purple   { background: var(--primary) !important; }
.border-purple { border-color: var(--border-primary) !important; }

.fade-in {
    animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.loading-spinner {
    display: inline-block;
    width: 20px; height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Scrollbar customizada */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--primary-dark); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* Select2 dark */
.select2-container--bootstrap-5 .select2-selection {
    background: var(--bg-input) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

.select2-dropdown {
    background: #1a1a2e !important;
    border-color: var(--border-primary) !important;
}

.select2-results__option {
    color: var(--text-primary) !important;
}

.select2-results__option--highlighted {
    background: var(--bg-card-hover) !important;
    color: var(--primary-light) !important;
}

/* Flatpickr dark */
.flatpickr-calendar {
    background: #1a1a2e !important;
    border-color: var(--border-primary) !important;
    box-shadow: 0 8px 30px rgba(0,0,0,0.5) !important;
}

.flatpickr-day {
    color: var(--text-primary) !important;
}

.flatpickr-day.selected {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
}

/* Preview de imagem no formulário */
.img-preview-wrapper {
    width: 100%;
    height: 160px;
    background: var(--bg-input);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: border-color var(--transition);
    cursor: pointer;
}

.img-preview-wrapper:hover { border-color: var(--primary); }

.img-preview-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.img-preview-placeholder {
    text-align: center;
    color: var(--text-muted);
}

.img-preview-placeholder i { font-size: 2rem; margin-bottom: 8px; }
.img-preview-placeholder p { font-size: 0.8rem; margin: 0; }

/* Credenciais (ocultas por padrão) */
.credential-field {
    position: relative;
}

.credential-toggle {
    background: none !important;
    border-color: var(--border-color) !important;
    color: var(--text-muted);
    cursor: pointer;
    pointer-events: auto;
    transition: color var(--transition);
    z-index: 10;
    position: relative;
}

.credential-toggle:hover { color: var(--primary); }

/* Linha decorativa arco-íris */
.rainbow-line {
    height: 2px;
    background: linear-gradient(90deg, #9900CC, #FF3399, #FF6600, #FFCC00, #00CC66, #0099FF);
    border-radius: 2px;
    margin: 16px 0;
}

/* Cards de plataforma no grid */
.platforms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* Filtros de tag */
.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.filter-tag {
    padding: 4px 14px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all var(--transition);
}

.filter-tag:hover,
.filter-tag.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 0 10px var(--primary-glow);
}

/* Ações na tabela */
.action-btns { display: flex; gap: 6px; align-items: center; }

.btn-action {
    width: 30px; height: 30px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    font-size: 0.75rem;
    text-decoration: none;
}

.btn-action:hover { border-color: var(--primary); color: var(--primary); }
.btn-action.danger:hover { border-color: var(--danger); color: var(--danger); }
.btn-action.success:hover { border-color: var(--success); color: var(--success); }

/* Página de login */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, #1a0033 0%, #121212 70%);
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-primary);
    border-radius: 16px;
    padding: 40px;
    backdrop-filter: blur(20px);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo-icon {
    width: 64px; height: 64px;
    background: var(--primary);
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem;
    color: white;
    margin: 0 auto 12px;
    box-shadow: 0 0 30px var(--primary-glow);
}

.login-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

.login-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ============================================================
   ADIÇÕES — Configurações, Cadastro, Google Auth
   ============================================================ */

/* Botão secundário (cadastro) */
.btn-secondary-hub {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: 'Titillium Web', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}
.btn-secondary-hub:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--bg-card-hover);
}

/* Botão Google */
.btn-google {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 20px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: 'Titillium Web', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}
.btn-google:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.25);
    color: var(--text-primary);
}

/* Loading spinner */
.loading-spinner {
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Estilos para Foto de Perfil e Botão de Editar */
.user-avatar-container {
    position: relative;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.user-avatar-img-REMOVED {

.user-avatar-placeholder {
    width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-edit-profile-avatar {
    position: absolute;
    bottom: 6px;
    right: 8px;
    background: none;
    border: none;
    padding: 2px;
    cursor: pointer;
    color: var(--primary);
    font-size: 0.85rem;
    filter: drop-shadow(0 0 4px var(--primary-glow));
    transition: opacity 0.2s ease;
    z-index: 5;
}

.btn-edit-profile-avatar:hover {
    background: none;
    border: none;
    opacity: 0.75;
    transform: none;
    filter: drop-shadow(0 0 6px var(--primary-glow));
}

/* Modal de Perfil */
.profile-preview-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

/* profile-img-preview rules moved to bottom */

/* Modal de perfil — acima de qualquer máscara/overlay do sidebar */
.modal { z-index: 10500 !important; }
.modal-backdrop { z-index: 10490 !important; }
#modalMeuPerfil { z-index: 10600 !important; }
.btn-change-photo {
    background-color: var(--primary) !important;
    color: white !important;
    border: none !important;
}
.btn-change-photo:hover {
    background-color: var(--primary-light) !important;
}

/* Foto de perfil — lateral */
.user-avatar-img {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    max-width: 48px !important;
    max-height: 48px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
    overflow: hidden !important;
    border: 2px solid var(--primary);
}

/* Foto de perfil — modal preview */
.profile-img-preview {
    width: 80px !important;
    height: 80px !important;
    min-width: 80px !important;
    min-height: 80px !important;
    max-width: 80px !important;
    max-height: 80px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
    overflow: hidden !important;
    border: 3px solid var(--primary);
    cursor: pointer;
    transition: opacity 0.2s;
}

.profile-img-preview:hover { opacity: 0.8; }/* --- ESTILIZAÇÃO DA FOTO DE PERFIL --- */
./* Variáveis de Cor - Ajuste conforme seu hub.sql */
:root {
    --primary-color: #28a745; /* Exemplo de verde, altere se necessário */
    --primary-hover: #218838;
}

/* Container da Foto de Perfil (Página Salvar Perfil) */
.profile-photo-container {
    width: 160px;
    height: 160px;
    margin: 0 auto 20px;
    position: relative;
    border-radius: 50%;
    border: 4px solid var(--primary-color);
    overflow: hidden;
    background-color: #eee;
}

.profile-photo-container img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Recorta a imagem para preencher o círculo sem distorcer */
    display: block;
}

/* Foto no Menu Lateral (Miniatura) */
.sidebar-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.2);
}

/* Botão Editar (Lápis) - Delicado e Inline */
.btn-edit-pencil {
    background: none;
    border: none;
    color: var(--primary-color);
    padding: 0;
    margin-left: 10px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
}

.btn-edit-pencil:hover {
    transform: scale(1.1);
    opacity: 0.8;
}

/* CORREÇÃO CRÍTICA: Z-INDEX DO MODAL */
.modal {
    z-index: 9999 !important; /* Garante que fique acima de tudo */
}
.modal-backdrop {
    z-index: 9998 !important;
}

/* Botão do Modal com Cor Primária */
.btn-confirm-upload {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #fff !important;
    font-weight: 600;
}

.btn-confirm-upload:hover {
    background-color: var(--primary-hover) !important;
}
/* ============================================================
   [SELECT / OPTION] Tema dark e light
   NOTA: Chrome/Edge ignoram background-color em <option> via CSS.
   O estilo real das options é aplicado via JS no footer.php.
   Aqui ficam apenas os estilos do wrapper <select> e Select2.
   ============================================================ */

/* color-scheme: instrui o browser a usar a paleta do OS correta */
html[data-theme="dark"]  select { color-scheme: dark; }
html[data-theme="light"] select { color-scheme: light; }

/* ── Wrapper do select: dark ────────────────────────────────── */
html[data-theme="dark"] select:not([class*="select2"]) {
    background-color: #1e1e35 !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: #f0f0f0 !important;
}
html[data-theme="dark"] select:not([class*="select2"]):focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(153, 0, 204, 0.2) !important;
    background-color: #211e3a !important;
    outline: none;
}

/* ── Wrapper do select: light ───────────────────────────────── */
html[data-theme="light"] select:not([class*="select2"]) {
    background-color: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.15) !important;
    color: #1a1a2e !important;
}
html[data-theme="light"] select:not([class*="select2"]):focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(153, 0, 204, 0.15) !important;
    background-color: #faf8ff !important;
    outline: none;
}

/* ── Select2: dark ──────────────────────────────────────────── */
html[data-theme="dark"] .select2-dropdown {
    background: #1e1e35 !important;
    border-color: rgba(153, 0, 204, 0.3) !important;
}
html[data-theme="dark"] .select2-results__option {
    background: #1e1e35 !important;
    color: #f0f0f0 !important;
}
html[data-theme="dark"] .select2-results__option--highlighted {
    background: #2d1a4a !important;
    color: #cc66ff !important;
}

/* ── Select2: light ─────────────────────────────────────────── */
html[data-theme="light"] .select2-dropdown {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.12) !important;
    color: #1a1a2e !important;
}
html[data-theme="light"] .select2-results__option {
    background: #ffffff !important;
    color: #1a1a2e !important;
}
html[data-theme="light"] .select2-results__option--highlighted {
    background: #f0e6ff !important;
    color: #6600aa !important;
}
html[data-theme="light"] .select2-container--bootstrap-5 .select2-selection {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.15) !important;
    color: #1a1a2e !important;
}

/* ── Bootstrap form-select: seta por tema ───────────────────── */
html[data-theme="dark"] .form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23aaaaaa' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
}
html[data-theme="light"] .form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23444444' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
}