/**
 * Overrides para tema escuro — layout, topbar e bridge inverso
 */

[data-theme="dark"] body {
    background-color: var(--color-bg);
    color: var(--color-text-secondary);
}

[data-theme="dark"] .content-wrapper {
    background: var(--color-bg);
    color: var(--color-text-secondary);
}

[data-theme="dark"] .content-wrapper h1,
[data-theme="dark"] .content-wrapper h2,
[data-theme="dark"] .content-wrapper h3,
[data-theme="dark"] .content-wrapper h4,
[data-theme="dark"] .content-wrapper h5,
[data-theme="dark"] .content-wrapper h6 {
    color: var(--color-text);
}

[data-theme="dark"] .topbar-menu {
    background: var(--topbar-bg) !important;
    border-bottom-color: var(--topbar-border) !important;
    box-shadow: var(--shadow-sm) !important;
}

[data-theme="dark"] .topbar-menu-item {
    color: var(--topbar-text) !important;
}

[data-theme="dark"] .topbar-menu-item:hover {
    background: var(--color-border-light) !important;
    color: var(--color-text) !important;
}

[data-theme="dark"] .topbar-menu-item.active {
    background: var(--color-accent-soft) !important;
    color: var(--color-accent) !important;
}

[data-theme="dark"] .topbar-user-name {
    color: var(--color-text) !important;
}

[data-theme="dark"] .topbar-toggle-btn {
    color: var(--color-text-secondary) !important;
}

[data-theme="dark"] .content-wrapper footer {
    color: var(--color-muted);
    border-top-color: var(--color-border);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #475569;
}

[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #1e293b;
}

/* Bridge inverso — classes legacy mantêm aparência escura */
[data-theme="dark"] .content-wrapper .table-dark {
    --bs-table-bg: var(--color-surface-raised);
    --bs-table-color: var(--color-text-secondary);
    --bs-table-border-color: var(--color-border);
    --bs-table-striped-bg: rgba(15, 23, 42, 0.6);
    --bs-table-hover-bg: var(--color-accent-soft);
    --bs-table-hover-color: var(--color-text);
    background: var(--color-surface-raised);
    color: var(--color-text-secondary);
}

[data-theme="dark"] .content-wrapper .table-dark thead th,
[data-theme="dark"] .content-wrapper .table-dark thead td {
    background: var(--color-border-light) !important;
    color: var(--color-text) !important;
    border-color: var(--color-border) !important;
}

[data-theme="dark"] .content-wrapper .bg-dark,
[data-theme="dark"] .content-wrapper .card.bg-dark,
[data-theme="dark"] .content-wrapper .modal-content.bg-dark {
    background-color: var(--color-surface-raised) !important;
    color: var(--color-text-secondary) !important;
    border-color: var(--color-border) !important;
}

[data-theme="dark"] .content-wrapper .text-light,
[data-theme="dark"] .content-wrapper .text-white {
    color: var(--color-text) !important;
}

[data-theme="dark"] .content-wrapper .text-muted {
    color: var(--color-muted) !important;
}

[data-theme="dark"] .content-wrapper .card {
    background: var(--color-surface);
    border-color: var(--color-border);
    color: var(--color-text-secondary);
}

[data-theme="dark"] .content-wrapper .card-header {
    background: var(--color-surface-raised);
    border-bottom-color: var(--color-border);
    color: var(--color-text);
}

[data-theme="dark"] .content-wrapper .form-control,
[data-theme="dark"] .content-wrapper .form-select {
    background: var(--color-surface-raised);
    border-color: var(--color-border);
    color: var(--color-text);
}

[data-theme="dark"] .content-wrapper .form-control:focus,
[data-theme="dark"] .content-wrapper .form-select:focus {
    background: var(--color-surface-raised);
    border-color: var(--color-accent);
}

[data-theme="dark"] .content-wrapper .dropdown-menu {
    background: var(--color-surface-raised);
    border-color: var(--color-border);
}

[data-theme="dark"] .content-wrapper .dropdown-item {
    color: var(--color-text-secondary);
}

[data-theme="dark"] .content-wrapper .dropdown-item:hover {
    background: var(--color-border-light);
    color: var(--color-text);
}

[data-theme="dark"] .content-wrapper .btn-secondary {
    background: var(--color-surface-raised);
    border-color: var(--color-border);
    color: var(--color-text-secondary);
}

[data-theme="dark"] .content-wrapper .list-group-item {
    background: var(--color-surface);
    border-color: var(--color-border);
    color: var(--color-text-secondary);
}

[data-theme="dark"] .content-wrapper .modal-content {
    background: var(--color-surface);
    border-color: var(--color-border);
    color: var(--color-text-secondary);
}

[data-theme="dark"] .toggle-btn {
    background: var(--color-surface-raised);
    border-color: var(--color-border);
    color: var(--color-text);
}

[data-theme="dark"] .bottom-nav {
    background: var(--color-surface);
    border-top-color: var(--color-border);
}

[data-theme="dark"] .bottom-nav-item.active {
    color: var(--color-accent);
}
