/* Portal ComoFazIA - CSS Global */
:root {
    --cf-bg: #f3f6fb;
    --cf-surface: #ffffff;
    --cf-surface-2: #f8fafc;
    --cf-surface-3: #eef2f7;
    --cf-text: #1e293b;
    --cf-muted: #64748b;
    --cf-border: #e2e8f0;
    --cf-primary: #1a56db;
    --cf-primary-2: #3b82f6;
    --cf-primary-soft: #eff6ff;
    --cf-success: #059669;
    --cf-danger: #dc2626;
    --cf-warning: #d97706;
    --cf-link: #2563eb;
    --cf-sidebar-bg: linear-gradient(180deg, #0f3b8c 0%, #1a56db 58%, #2563eb 100%);
    --cf-sidebar-text: #f8fafc;
    --cf-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    --cf-sidebar-width: 272px;
}

html[data-theme="dark"], html[data-theme="escuro"], html[data-bs-theme="dark"] {
    color-scheme: dark;
    --cf-bg: #0b1220;
    --cf-surface: #111827;
    --cf-surface-2: #162235;
    --cf-surface-3: #1f2f46;
    --cf-text: #e5edf8;
    --cf-muted: #9fb0c7;
    --cf-border: #24364d;
    --cf-primary: #60a5fa;
    --cf-primary-2: #93c5fd;
    --cf-primary-soft: #17263b;
    --cf-success: #34d399;
    --cf-danger: #f87171;
    --cf-warning: #fbbf24;
    --cf-link: #93c5fd;
    --cf-sidebar-bg: linear-gradient(180deg, #08101c 0%, #0d1728 55%, #13243a 100%);
    --cf-sidebar-text: #f1f5f9;
    --cf-shadow: 0 12px 34px rgba(0, 0, 0, 0.45);

    --bs-body-bg: #0b1220;
    --bs-body-bg-rgb: 11,18,32;
    --bs-body-color: #e5edf8;
    --bs-body-color-rgb: 229,237,248;
    --bs-border-color: #24364d;
    --bs-secondary-bg: #162235;
    --bs-tertiary-bg: #162235;
    --bs-emphasis-color: #f8fafc;
    --bs-secondary-color: #9fb0c7;
    --bs-link-color: #93c5fd;
    --bs-link-hover-color: #bfdbfe;
    --bs-card-bg: #111827;
    --bs-card-color: #e5edf8;
    --bs-card-border-color: #24364d;
    --bs-modal-bg: #111827;
    --bs-modal-color: #e5edf8;
    --bs-dropdown-bg: #111827;
    --bs-dropdown-color: #e5edf8;
    --bs-dropdown-border-color: #24364d;
    --bs-dropdown-link-color: #e5edf8;
    --bs-dropdown-link-hover-bg: #162235;
    --bs-dropdown-link-hover-color: #f8fafc;
    --bs-table-bg: #111827;
    --bs-table-color: #e5edf8;
    --bs-table-border-color: #24364d;
    --bs-table-striped-bg: #162235;
    --bs-table-striped-color: #e5edf8;
    --bs-table-hover-bg: #1b2b40;
    --bs-table-hover-color: #f8fafc;
}

body {
    background: var(--cf-bg);
    color: var(--cf-text);
}

body.cf-has-panel {
    padding-left: 0;
    transition: padding-left 0.25s ease;
}

body.cf-has-panel.cf-sidebar-open {
    padding-left: 0;
}
@media (min-width: 1200px) {
    body.cf-has-panel.cf-sidebar-open {
        padding-left: var(--cf-sidebar-width);
    }
}

.main-content, main.container {
    padding-top: 3.6rem !important;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-right: 0.5rem !important;
}

.topo, .top-bar {
    background: linear-gradient(135deg, #1a56db, #3b82f6);
    padding: 0.45rem 0;
    color: #fff;
}

.topo > .container, .top-bar > .container {
    padding-right: 0.75rem !important;
    padding-left: 3.1rem !important;
}

.topo a, .top-bar a {
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
}

.topo a:hover, .top-bar a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.cf-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: auto;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    width: min(var(--cf-sidebar-width), 86vw);
    max-width: 320px;
    background: var(--cf-sidebar-bg);
    color: var(--cf-sidebar-text);
    box-shadow: 12px 0 35px rgba(15, 23, 42, 0.16);
    transform: translateX(-105%);
    visibility: hidden;
    transition: transform 0.25s ease, visibility 0.25s ease;
    overflow-y: auto;
}

body.cf-sidebar-open .cf-sidebar {
    transform: translateX(0) !important;
    visibility: visible;
}
body:not(.cf-sidebar-open) .cf-sidebar {
    transform: translateX(-105%) !important;
    visibility: hidden;
}

.cf-sidebar-toggle {
    position: fixed;
    top: 0.55rem;
    left: 0.75rem;
    z-index: 1055;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    padding: 0;
    border: 1px solid var(--cf-border);
    border-radius: 0.6rem;
    background: var(--cf-surface);
    color: var(--cf-text);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: var(--cf-shadow);
    transition: left 0.25s ease, background 0.2s ease;
    pointer-events: auto;
    touch-action: manipulation;
}

.cf-sidebar-toggle:hover {
    background: var(--cf-surface-2);
}

body.cf-sidebar-open .cf-sidebar-toggle {
    left: calc(var(--cf-sidebar-width) + 0.6rem);
}

.cf-sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 1035;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

body.cf-sidebar-open .cf-sidebar-overlay {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

@media (min-width: 769px) {
    .cf-sidebar-overlay { display: none !important; }
}

@media (max-width: 768px) {
    body.cf-has-panel,
    body.cf-has-panel.cf-sidebar-open {
        padding-left: 0 !important;
    }
    .cf-sidebar {
        width: min(86vw, 320px) !important;
        max-width: 86vw !important;
    }
    body.cf-sidebar-open .cf-sidebar-toggle {
        left: 0.6rem;
        z-index: 1046;
    }
    body.cf-sidebar-open .cf-sidebar-overlay {
        display: block !important;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
}

.cf-brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 1.15rem 1.25rem;
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
    text-decoration: none;
}

.cf-brand strong { color: #fbbf24; }
.cf-brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.8rem;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.cf-sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 0.25rem 0.85rem 1rem;
}

.cf-nav-section {
    margin: 1rem 0.65rem 0.4rem;
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.cf-nav-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-height: 2.55rem;
    margin-bottom: 0.2rem;
    padding: 0.6rem 0.75rem;
    border-radius: 0.75rem;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.92rem;
    font-weight: 500;
    text-decoration: none;
}

.cf-nav-link:hover, .cf-nav-link.active {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.cf-sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.9rem 1.15rem;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(0, 0, 0, 0.12);
}

.cf-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1f2937;
    font-weight: 800;
}

.cf-user-chip {
    position: fixed;
    top: 0.45rem;
    right: 0.6rem;
    z-index: 1045;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    max-width: calc(100vw - 4rem);
    padding: 0.25rem 0.35rem;
    border: 1px solid var(--cf-border);
    border-radius: 999px;
    background: var(--cf-surface);
    box-shadow: var(--cf-shadow);
}

.cf-user-chip-text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.cf-user-chip-text strong { color: var(--cf-text); font-size: 0.74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 10rem; }
.cf-user-chip-text small { color: var(--cf-muted); font-size: 0.64rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 10rem; }

@media (max-width: 991.98px) {
    .cf-user-chip-text { display: none; }
    .cf-user-chip { padding: 0.2rem; gap: 0.15rem; top: 0.4rem; right: 0.4rem; }
}
@media (max-width: 575.98px) {
    .cf-user-chip { max-width: calc(100vw - 3.2rem); }
}

body.cf-has-panel { --cf-panel-offset: 3.5rem; }
body.cf-has-panel > *:not(.cf-sidebar):not(.cf-sidebar-toggle):not(.cf-sidebar-overlay):not(.cf-user-chip) {
    margin-top: 0;
}

html[data-theme="dark"] body.cf-page-noticias-index,
html[data-theme="escuro"] body.cf-page-noticias-index,
html[data-bs-theme="dark"] body.cf-page-noticias-index {
    background: var(--cf-bg) !important;
    color: var(--cf-text) !important;
}
html[data-theme="dark"] body.cf-page-noticias-index .header-principal,
html[data-theme="escuro"] body.cf-page-noticias-index .header-principal,
html[data-bs-theme="dark"] body.cf-page-noticias-index .header-principal,
html[data-theme="dark"] body.cf-page-noticias-index .news-card,
html[data-theme="escuro"] body.cf-page-noticias-index .news-card,
html[data-bs-theme="dark"] body.cf-page-noticias-index .news-card,
html[data-theme="dark"] body.cf-page-noticias-index .featured-card,
html[data-theme="escuro"] body.cf-page-noticias-index .featured-card,
html[data-bs-theme="dark"] body.cf-page-noticias-index .featured-card,
html[data-theme="dark"] body.cf-page-noticias-index .card,
html[data-theme="escuro"] body.cf-page-noticias-index .card,
html[data-bs-theme="dark"] body.cf-page-noticias-index .card {
    background: var(--cf-surface) !important;
    color: var(--cf-text) !important;
    border-color: var(--cf-border) !important;
}
html[data-theme="dark"] body.cf-page-noticias-index .featured-section,
html[data-theme="escuro"] body.cf-page-noticias-index .featured-section,
html[data-bs-theme="dark"] body.cf-page-noticias-index .featured-section {
    background: linear-gradient(135deg, var(--cf-surface-2), var(--cf-bg)) !important;
    border-color: var(--cf-border) !important;
}
html[data-theme="dark"] body.cf-page-noticias-index .search-box input,
html[data-theme="escuro"] body.cf-page-noticias-index .search-box input,
html[data-bs-theme="dark"] body.cf-page-noticias-index .search-box input {
    background: var(--cf-surface-2) !important;
    color: var(--cf-text) !important;
    border-color: var(--cf-border) !important;
}

.cf-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    color: var(--cf-muted);
    text-decoration: none;
}

.cf-icon-btn:hover { background: var(--cf-surface-3); color: var(--cf-primary); }

html[data-theme="dark"] body, html[data-theme="escuro"] body, html[data-bs-theme="dark"] body {
    background-color: var(--cf-bg) !important;
    color: var(--cf-text) !important;
}

html[data-theme="dark"] .card-carteira, html[data-theme="escuro"] .card-carteira, html[data-bs-theme="dark"] .card-carteira,
html[data-theme="dark"] .card-admin, html[data-theme="escuro"] .card-admin, html[data-bs-theme="dark"] .card-admin,
html[data-theme="dark"] .tabela-mercado, html[data-theme="escuro"] .tabela-mercado, html[data-bs-theme="dark"] .tabela-mercado,
html[data-theme="dark"] .table-admin, html[data-theme="escuro"] .table-admin, html[data-bs-theme="dark"] .table-admin,
html[data-theme="dark"] .cabecalho, html[data-theme="escuro"] .cabecalho, html[data-bs-theme="dark"] .cabecalho,
html[data-theme="dark"] .card, html[data-theme="escuro"] .card, html[data-bs-theme="dark"] .card,
html[data-theme="dark"] .modal-content, html[data-theme="escuro"] .modal-content, html[data-bs-theme="dark"] .modal-content,
html[data-theme="dark"] .offcanvas, html[data-theme="escuro"] .offcanvas, html[data-bs-theme="dark"] .offcanvas,
html[data-theme="dark"] .accordion-item, html[data-theme="escuro"] .accordion-item, html[data-bs-theme="dark"] .accordion-item,
html[data-theme="dark"] .accordion-button, html[data-theme="escuro"] .accordion-button, html[data-bs-theme="dark"] .accordion-button {
    background-color: var(--cf-surface) !important;
    color: var(--cf-text) !important;
    border-color: var(--cf-border) !important;
}
html[data-theme="dark"] .bg-white, html[data-theme="escuro"] .bg-white, html[data-bs-theme="dark"] .bg-white,
html[data-theme="dark"] .bg-light, html[data-theme="escuro"] .bg-light, html[data-bs-theme="dark"] .bg-light {
    background-color: var(--cf-surface) !important;
    color: var(--cf-text) !important;
}
html[data-theme="dark"] main, html[data-theme="escuro"] main, html[data-bs-theme="dark"] main,
html[data-theme="dark"] .container, html[data-theme="escuro"] .container, html[data-bs-theme="dark"] .container,
html[data-theme="dark"] .container-fluid, html[data-theme="escuro"] .container-fluid, html[data-bs-theme="dark"] .container-fluid {
    color: var(--cf-text);
}

html[data-theme="dark"] .card-resumo, html[data-bs-theme="dark"] .card-resumo {
    background-color: var(--cf-surface-2) !important;
}

html[data-theme="dark"] table, html[data-bs-theme="dark"] table,
html[data-theme="dark"] th, html[data-bs-theme="dark"] th,
html[data-theme="dark"] td, html[data-bs-theme="dark"] td {
    color: var(--cf-text) !important;
    border-color: var(--cf-border) !important;
}

html[data-theme="dark"] thead th,
html[data-theme="dark"] .tabela-carteira th,
html[data-theme="dark"] .table-admin th,
html[data-theme="dark"] .tabela-mercado th,
html[data-bs-theme="dark"] thead th,
html[data-bs-theme="dark"] .tabela-carteira th,
html[data-bs-theme="dark"] .table-admin th,
html[data-bs-theme="dark"] .tabela-mercado th {
    background-color: #1e293b !important;
    color: #60a5fa !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .form-control, html[data-bs-theme="dark"] .form-control,
html[data-theme="dark"] .form-select, html[data-bs-theme="dark"] .form-select {
    background-color: var(--cf-surface-2) !important;
    color: var(--cf-text) !important;
    border-color: var(--cf-border) !important;
}

:root {
    --cf-public-logo-accent: #6b4423;
    --cf-public-heading: #6b4423;
    --cf-public-featured: linear-gradient(135deg, #eff6ff, #ffffff);
    --cf-public-ad-bg: #f5f0eb;
    --cf-public-ad-border: #d4c5b5;
    --cf-public-footer: #6b4423;
}

html[data-theme="dark"], html[data-theme="escuro"], html[data-bs-theme="dark"] {
    --cf-public-logo-accent: #f59e0b;
    --cf-public-heading: #fbbf24;
    --cf-public-featured: var(--cf-surface-2);
    --cf-public-ad-bg: var(--cf-surface-2);
    --cf-public-ad-border: var(--cf-border);
    --cf-public-footer: #0b1220;
    --bs-dropdown-bg: var(--cf-surface);
    --bs-dropdown-border-color: var(--cf-border);
    --bs-dropdown-link-color: var(--cf-text);
    --bs-dropdown-link-hover-bg: var(--cf-surface-2);
    --bs-dropdown-link-hover-color: var(--cf-text);
}

body:not(.cf-has-panel) .page-header,
body:not(.cf-has-panel) .topo > .container,
body:not(.cf-has-panel) .top-bar > .container {
    padding-right: 0.75rem !important;
}

.header-principal,
.header-noticia {
    background: var(--cf-surface);
    border-color: var(--cf-border);
    color: var(--cf-text);
}

.header-principal .logo,
.header-noticia .logo,
.logo {
    color: var(--cf-primary);
}

.logo span,
.header-principal .logo span,
.header-noticia .logo span {
    color: var(--cf-public-logo-accent);
}

.featured-section {
    background: var(--cf-public-featured);
    border-color: var(--cf-border);
}

.featured-card,
.news-card {
    background: var(--cf-surface);
    border-color: var(--cf-border);
    color: var(--cf-text);
}

.featured-card .card-title,
.news-card .news-title,
.btn-ler-mais,
.article-header h1,
.btn-voltar,
.page-header h1,
.error-card h1 {
    color: var(--cf-primary);
}

.section-title {
    color: var(--cf-public-heading);
}

.featured-card .card-text,
.news-card .news-summary,
.news-card .news-meta,
.featured-card .card-date,
.article-meta,
.article-body blockquote,
.ad-label,
.no-results,
.empty-state,
.error-card p,
.login-footer,
.register-footer {
    color: var(--cf-muted);
}

.article-meta {
    border-color: var(--cf-border);
}

.article-body,
.article-footer {
    color: var(--cf-text);
    border-color: var(--cf-border);
}

.article-body blockquote {
    border-color: var(--cf-primary);
}

.search-box input,
.input-group-text {
    background-color: var(--cf-surface);
    color: var(--cf-text);
    border-color: var(--cf-border);
}

.input-group-text {
    background-color: var(--cf-surface-2);
    color: var(--cf-muted);
}

.ad-container {
    background: var(--cf-public-ad-bg);
    border-color: var(--cf-public-ad-border);
    color: var(--cf-muted);
}

.footer {
    background: var(--cf-public-footer);
    color: rgba(255, 255, 255, 0.85);
}

.card,
.featured-card,
.news-card,
.login-card,
.register-card,
.error-card,
.table-admin,
.cabecalho,
.card-carteira,
.card-admin,
.tabela-mercado,
.tabela-carteira {
    border-color: var(--cf-border);
}

.login-card,
.register-card,
.error-card,
.table-admin {
    background: var(--cf-surface);
    color: var(--cf-text);
}

.form-label,
.login-body .form-label,
.register-body .form-label {
    color: var(--cf-text);
}

.login-footer a,
.register-footer a {
    color: var(--cf-primary);
}

.pagination .page-link {
    background: var(--cf-surface);
    color: var(--cf-primary);
    border-color: var(--cf-border);
}

.pagination .page-item.active .page-link {
    background: var(--cf-primary);
    color: #ffffff;
    border-color: var(--cf-primary);
}

.pagination .page-link:hover {
    background: var(--cf-surface-2);
    color: var(--cf-primary);
}

.table-admin {
    background: var(--cf-surface);
}

.table-admin th {
    background: var(--cf-surface-2);
    color: var(--cf-muted);
}

.table-admin tr:hover {
    background: var(--cf-surface-2);
}

html[data-theme="dark"] body,
html[data-theme="escuro"] body,
html[data-bs-theme="dark"] body {
    background: var(--cf-bg) !important;
    background-image: none !important;
}

html[data-theme="dark"] .search-active,
html[data-theme="escuro"] .search-active,
html[data-bs-theme="dark"] .search-active {
    background: var(--cf-surface-2) !important;
    border-color: var(--cf-warning) !important;
}

html[data-theme="dark"] .badge-destaque,
html[data-theme="escuro"] .badge-destaque,
html[data-bs-theme="dark"] .badge-destaque {
    background: #78350f !important;
    color: #fde68a !important;
}

html[data-theme="dark"] .btn-outline-secondary,
html[data-theme="escuro"] .btn-outline-secondary,
html[data-bs-theme="dark"] .btn-outline-secondary {
    color: var(--cf-text);
    border-color: var(--cf-border);
}

html[data-theme="dark"] .btn-outline-secondary:hover,
html[data-theme="escuro"] .btn-outline-secondary:hover,
html[data-bs-theme="dark"] .btn-outline-secondary:hover {
    background: var(--cf-surface-3);
    color: var(--cf-text);
    border-color: var(--cf-border);
}

html[data-theme="dark"] .text-dark,
html[data-theme="escuro"] .text-dark,
html[data-bs-theme="dark"] .text-dark {
    color: var(--cf-text) !important;
}

html[data-theme="dark"] .text-muted,
html[data-theme="escuro"] .text-muted,
html[data-bs-theme="dark"] .text-muted {
    color: var(--cf-muted) !important;
}

html[data-theme="dark"] .form-control::placeholder,
html[data-theme="escuro"] .form-control::placeholder,
html[data-bs-theme="dark"] .form-control::placeholder {
    color: var(--cf-muted);
}

html[data-theme="dark"] .table,
html[data-theme="escuro"] .table,
html[data-bs-theme="dark"] .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--cf-text);
    --bs-table-border-color: var(--cf-border);
    --bs-table-hover-bg: var(--cf-surface-2);
    --bs-table-hover-color: var(--cf-text);
}

/* --- Cobertura adicional do tema escuro (páginas com cores fixas) --- */
html[data-theme="dark"],
html[data-theme="escuro"],
html[data-bs-theme="dark"] {
    --bs-card-bg: var(--cf-surface);
    --bs-card-color: var(--cf-text);
    --bs-card-border-color: var(--cf-border);
    --bs-modal-bg: var(--cf-surface);
    --bs-modal-color: var(--cf-text);
    --bs-modal-border-color: var(--cf-border);
    --bs-modal-header-border-color: var(--cf-border);
    --bs-modal-footer-border-color: var(--cf-border);
    --bs-list-group-bg: var(--cf-surface);
    --bs-list-group-color: var(--cf-text);
    --bs-list-group-border-color: var(--cf-border);
    --bs-list-group-action-hover-bg: var(--cf-surface-2);
    --bs-dropdown-bg: var(--cf-surface);
    --bs-dropdown-color: var(--cf-text);
    --bs-dropdown-link-color: var(--cf-text);
    --bs-dropdown-link-hover-bg: var(--cf-surface-2);
    --bs-dropdown-link-hover-color: var(--cf-text);
    --bs-dropdown-border-color: var(--cf-border);
    background-color: var(--cf-bg);
}

html[data-theme="dark"] .form-card,
html[data-theme="escuro"] .form-card,
html[data-bs-theme="dark"] .form-card {
    background: var(--cf-surface) !important;
    border: 1px solid var(--cf-border) !important;
    color: var(--cf-text) !important;
    box-shadow: var(--cf-shadow) !important;
}

html[data-theme="dark"] .article-origem,
html[data-theme="escuro"] .article-origem,
html[data-bs-theme="dark"] .article-origem {
    background: var(--cf-primary-soft) !important;
    border-color: var(--cf-border) !important;
    color: var(--cf-text) !important;
}

html[data-theme="dark"] .article-lead,
html[data-theme="escuro"] .article-lead,
html[data-bs-theme="dark"] .article-lead {
    color: var(--cf-muted) !important;
}

html[data-theme="dark"] .login-body .input-group-text,
html[data-theme="escuro"] .login-body .input-group-text,
html[data-bs-theme="dark"] .login-body .input-group-text,
html[data-theme="dark"] .register-body .input-group-text,
html[data-theme="escuro"] .register-body .input-group-text,
html[data-bs-theme="dark"] .register-body .input-group-text {
    background: var(--cf-surface-2) !important;
    border-color: var(--cf-border) !important;
    color: var(--cf-muted) !important;
}

html[data-theme="dark"] .bg-light,
html[data-theme="escuro"] .bg-light,
html[data-bs-theme="dark"] .bg-light,
html[data-theme="dark"] .bg-white,
html[data-theme="escuro"] .bg-white,
html[data-bs-theme="dark"] .bg-white,
html[data-theme="dark"] .bg-body-tertiary,
html[data-theme="escuro"] .bg-body-tertiary,
html[data-bs-theme="dark"] .bg-body-tertiary {
    background-color: var(--cf-surface-2) !important;
    color: var(--cf-text) !important;
}

html[data-theme="dark"] .modal-content,
html[data-theme="escuro"] .modal-content,
html[data-bs-theme="dark"] .modal-content {
    background-color: var(--cf-surface) !important;
    color: var(--cf-text) !important;
    border-color: var(--cf-border) !important;
}

html[data-theme="dark"] .modal-header,
html[data-theme="escuro"] .modal-header,
html[data-bs-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer,
html[data-theme="escuro"] .modal-footer,
html[data-bs-theme="dark"] .modal-footer {
    background-color: var(--cf-surface) !important;
    color: var(--cf-text) !important;
    border-color: var(--cf-border) !important;
}

html[data-theme="dark"] .modal-body,
html[data-theme="escuro"] .modal-body,
html[data-bs-theme="dark"] .modal-body {
    background-color: var(--cf-surface) !important;
    color: var(--cf-text) !important;
}

html[data-theme="dark"] .list-group-item,
html[data-theme="escuro"] .list-group-item,
html[data-bs-theme="dark"] .list-group-item {
    background-color: var(--cf-surface) !important;
    color: var(--cf-text) !important;
    border-color: var(--cf-border) !important;
}

html[data-theme="dark"] .list-group-item.active,
html[data-theme="escuro"] .list-group-item.active,
html[data-bs-theme="dark"] .list-group-item.active {
    background-color: var(--cf-primary) !important;
    border-color: var(--cf-primary) !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .dropdown-menu,
html[data-theme="escuro"] .dropdown-menu,
html[data-bs-theme="dark"] .dropdown-menu {
    background-color: var(--cf-surface) !important;
    border-color: var(--cf-border) !important;
}

html[data-theme="dark"] .dropdown-item,
html[data-theme="escuro"] .dropdown-item,
html[data-bs-theme="dark"] .dropdown-item {
    color: var(--cf-text) !important;
}

html[data-theme="dark"] .dropdown-item:hover,
html[data-theme="escuro"] .dropdown-item:hover,
html[data-bs-theme="dark"] .dropdown-item:hover,
html[data-theme="dark"] .dropdown-item:focus,
html[data-theme="escuro"] .dropdown-item:focus,
html[data-bs-theme="dark"] .dropdown-item:focus {
    background-color: var(--cf-surface-2) !important;
    color: var(--cf-text) !important;
}

html[data-theme="dark"] .breadcrumb,
html[data-theme="escuro"] .breadcrumb,
html[data-bs-theme="dark"] .breadcrumb {
    background-color: transparent !important;
}

/* Tabela responsiva de noticias agregadas */
.news-table-wrap {
    background: var(--cf-surface);
    border: 1px solid var(--cf-border);
    border-radius: 0.75rem;
    overflow: hidden;
}

.news-table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--cf-text);
    --bs-table-border-color: var(--cf-border);
    --bs-table-hover-bg: var(--cf-surface-2);
    --bs-table-hover-color: var(--cf-text);
    color: var(--cf-text);
    margin-bottom: 0;
}

.news-table thead th {
    background: var(--cf-surface-2);
    color: var(--cf-muted);
    border-color: var(--cf-border);
    font-size: 0.76rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.news-table tbody td {
    border-color: var(--cf-border);
    vertical-align: top;
}

.news-table .news-title {
    color: var(--cf-primary);
    font-weight: 600;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.news-table .news-title:hover {
    text-decoration: underline;
}

.news-table .news-summary {
    color: var(--cf-muted);
    font-size: 0.88rem;
    margin-top: 0.35rem;
    overflow-wrap: anywhere;
}

.news-table .news-text {
    color: var(--cf-text);
    font-size: 0.9rem;
    max-width: 34rem;
    overflow-wrap: anywhere;
}

.news-table .news-meta-cell {
    color: var(--cf-muted);
    font-size: 0.8rem;
    white-space: nowrap;
}

.news-table .news-date,
.news-table .news-autor {
    display: block;
}

.news-table .news-fonte,
.news-fonte.badge,
.badge.news-fonte {
    margin-top: 0.35rem;
    background: #dbeafe !important;
    color: #1e3a8a !important;
    border: 1px solid #60a5fa !important;
    font-weight: 700;
}
html[data-theme="dark"] .news-table .news-fonte,
html[data-theme="dark"] .news-fonte.badge,
html[data-theme="dark"] .badge.news-fonte,
html[data-theme="escuro"] .news-table .news-fonte,
html[data-theme="escuro"] .news-fonte.badge,
html[data-theme="escuro"] .badge.news-fonte,
html[data-bs-theme="dark"] .news-table .news-fonte,
html[data-bs-theme="dark"] .news-fonte.badge,
html[data-bs-theme="dark"] .badge.news-fonte {
    background: #17263b !important;
    color: #93c5fd !important;
    border-color: #2b4b73 !important;
}

.news-table .news-text-mobile {
    margin-top: 0.5rem;
}

.news-table .news-text-col {
    display: none;
}

@media (min-width: 1200px) {
    .news-table .news-text-col {
        display: table-cell;
    }
}

@media (max-width: 767.98px) {
    .news-table-wrap {
        background: transparent;
        border: 0;
        border-radius: 0;
        overflow: visible;
    }

    .news-table,
    .news-table tbody,
    .news-table tr,
    .news-table td {
        display: block;
        width: 100%;
    }

    .news-table thead {
        display: none;
    }

    .news-table tr {
        margin-bottom: 0.75rem;
        padding: 0.75rem 0.85rem;
        background: var(--cf-surface);
        border: 1px solid var(--cf-border);
        border-radius: 0.75rem;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    }

    .news-table tbody td,
    .news-table tbody tr:hover > * {
        --bs-table-bg-state: transparent;
        padding: 0.15rem 0 !important;
        border: 0 !important;
        background: transparent !important;
        text-align: left !important;
    }

    .news-table .news-meta-cell {
        white-space: normal;
        min-width: 0;
        margin-bottom: 0.25rem;
    }

    .news-table .news-date,
    .news-table .news-autor {
        display: inline-block;
        margin-right: 0.5rem;
    }

    .news-table .news-fonte.badge {
        margin-top: 0;
    }

    .news-table .news-title-cell {
        margin-top: 0.25rem;
    }

    .news-table .news-title {
        font-size: 1.05rem;
    }

    .news-table .news-text-col {
        display: block !important;
        margin-top: 0.5rem;
    }

    .news-table .news-text {
        max-width: none;
    }

    .news-table .news-link-cell {
        margin-top: 0.65rem;
        padding-top: 0.55rem !important;
        border-top: 1px solid var(--cf-border) !important;
    }

    .news-table .news-link-cell .btn-ler-mais {
        display: inline-flex;
    }
}

@media (max-width: 575.98px) {
    .news-table .news-meta-cell {
        white-space: normal;
        min-width: 0;
    }
    .news-table td, .news-table th {
        padding: 0.55rem 0.5rem;
        font-size: 0.88rem;
    }
    .cf-sidebar-toggle {
        width: 2.5rem;
        height: 2.5rem;
    }
}

html[data-theme="dark"] .header-principal, html[data-theme="escuro"] .header-principal, html[data-bs-theme="dark"] .header-principal {
    border-color: var(--cf-border);
}

.ad-block { display: block; }
.text-accent { color: var(--cafe-secundario); }
.text-primary-cafe { color: var(--cafe-primario); font-weight: 700; }
.btn-cafe-bg { background: var(--cafe-primario) !important; }
.icon-accent-lg { color: var(--cafe-primario); }
.admin-meta-small { font-size: 0.65rem; line-height: 1.2; }
.input-w-140 { width: 140px; }
.td-min-260 { min-width: 260px; }
.cf-hide { display: none !important; }
.cf-inline-block { display: inline-block; }
.cf-text-right { text-align: right; }


.bg-light-page { background-color: var(--cf-bg); }
.img-logo-40 { width: 40px; height: 40px; object-fit: contain; }
.link-plain { text-decoration: none; color: inherit; }
.min-h-300 { min-height: 300px; }
.d-block-force { display: block; }
.mt-page-top { margin-top: 100px; }
.table-row-highlight { background: var(--cf-primary-soft); }
.table-row-separator { background: rgba(251,191,36,0.12); font-weight: 700; }
.back-link-muted { color: var(--cf-muted); text-decoration: none; font-size: 0.9rem; }
.badge-tipo-modal { font-size: 0.7rem; padding: 3px 10px; }
.cf-error-page { font-family: system-ui,-apple-system,sans-serif; padding: 2rem; background: #f8fafc; color: #1e293b; }
.cf-error-box, .cf-error-page .card { background:#fff; padding:1.5rem; border-radius:8px; border:1px solid #e2e8f0; box-shadow:0 4px 6px -1px rgba(0,0,0,0.1); max-width:800px; margin:0 auto; }
.cf-error-box h1 { color:#dc2626; margin-top:0; }
.cf-error-box h1.cf-info { color:#2563eb; }
.cf-debug-section { margin-top:1.5rem; padding-top:1rem; border-top:1px solid #e2e8f0; }
.cf-debug-box, .debug-box { background:#1e293b; color:#f8fafc; padding:1rem; border-radius:8px; font-family:monospace; font-size:0.875rem; overflow-x:auto; margin-top:1rem; }
.tag { background:#ef4444; color:#fff; padding:2px 8px; border-radius:4px; font-size:0.75rem; font-weight:bold; text-transform:uppercase; }
.cf-debug-title { margin-top:0.75rem; font-weight:600; color:#0f172a; }
.cf-debug-note { font-size:0.875rem; color:#64748b; margin-top:0.75rem; }
.tab-panel { display:none; }
.tab-panel.active { display:block; }

.w-100{width:100%}.m-0{margin:0}.modal-preso{width:100%;max-width:800px;border:none;border-radius:12px;box-shadow:0 10px 30px rgba(0,0,0,.3);padding:0}.modal-header-border{border-bottom:1px solid #dee2e6}.modal-footer-border{border-top:1px solid #dee2e6}.overflow-x-auto{overflow-x:auto}.text-center-empty{text-align:center;color:#999}.fs-072{font-size:.72rem}.border-left-success{border-left-color:var(--mk-success,#16a34a)!important}.border-left-warning{border-left-color:var(--mk-warning,#d97706)!important}.scroll-y-250{max-height:250px;overflow:auto}


/* ===== Tema escuro global: fundo, contraste e conforto de leitura ===== */
html[data-theme="dark"],
html[data-theme="escuro"],
html[data-bs-theme="dark"] {
    background-color: var(--cf-bg) !important;
}
html[data-theme="dark"] body,
html[data-theme="escuro"] body,
html[data-bs-theme="dark"] body {
    background: var(--cf-bg) !important;
    background-color: var(--cf-bg) !important;
    color: var(--cf-text) !important;
}
/* Mercados (variáveis locais das views) */
html[data-theme="dark"], html[data-theme="escuro"], html[data-bs-theme="dark"] {
    --mk-bg: #0b1220; --mk-surface: #111827; --mk-surface-2: #162235;
    --mk-text: #e5edf8; --mk-muted: #9fb0c7; --mk-border: #24364d;
    --mk-primary: #60a5fa; --mk-primary-2: #93c5fd; --mk-success: #34d399;
    --mk-danger: #f87171; --mk-warning: #fbbf24; --mk-shadow: 0 12px 34px rgba(0,0,0,.45);
    --azul-primario: #60a5fa; --azul-secundario: #93c5fd; --azul-claro: #17263b;
    --cafe-primario: #f59e0b; --cafe-secundario: #fbbf24; --cafe-claro: #1f2f46;
}
/* Superfícies e containers */
html[data-theme="dark"] .header-principal, html[data-theme="escuro"] .header-principal, html[data-bs-theme="dark"] .header-principal,
html[data-theme="dark"] .header-noticia, html[data-theme="escuro"] .header-noticia, html[data-bs-theme="dark"] .header-noticia,
html[data-theme="dark"] .top-bar, html[data-theme="escuro"] .top-bar, html[data-bs-theme="dark"] .top-bar,
html[data-theme="dark"] .cabecalho, html[data-theme="escuro"] .cabecalho, html[data-bs-theme="dark"] .cabecalho,
html[data-theme="dark"] .featured-card, html[data-theme="escuro"] .featured-card, html[data-bs-theme="dark"] .featured-card,
html[data-theme="dark"] .news-card, html[data-theme="escuro"] .news-card, html[data-bs-theme="dark"] .news-card,
html[data-theme="dark"] .admin-card, html[data-theme="escuro"] .admin-card, html[data-bs-theme="dark"] .admin-card,
html[data-theme="dark"] .error-card, html[data-theme="escuro"] .error-card, html[data-bs-theme="dark"] .error-card,
html[data-theme="dark"] .login-card, html[data-theme="escuro"] .login-card, html[data-bs-theme="dark"] .login-card,
html[data-theme="dark"] .register-card, html[data-theme="escuro"] .register-card, html[data-bs-theme="dark"] .register-card,
html[data-theme="dark"] .usuario-card, html[data-theme="escuro"] .usuario-card, html[data-bs-theme="dark"] .usuario-card,
html[data-theme="dark"] .mk-card, html[data-theme="escuro"] .mk-card, html[data-bs-theme="dark"] .mk-card,
html[data-theme="dark"] .card-carteira, html[data-theme="escuro"] .card-carteira, html[data-bs-theme="dark"] .card-carteira,
html[data-theme="dark"] .summary-card, html[data-theme="escuro"] .summary-card, html[data-bs-theme="dark"] .summary-card,
html[data-theme="dark"] .filter-card, html[data-theme="escuro"] .filter-card, html[data-bs-theme="dark"] .filter-card,
html[data-theme="dark"] .table-wrap, html[data-theme="escuro"] .table-wrap, html[data-bs-theme="dark"] .table-wrap,
html[data-theme="dark"] .chart-card, html[data-theme="escuro"] .chart-card, html[data-bs-theme="dark"] .chart-card,
html[data-theme="dark"] .meta-card, html[data-theme="escuro"] .meta-card, html[data-bs-theme="dark"] .meta-card,
html[data-theme="dark"] .indicador-card, html[data-theme="escuro"] .indicador-card, html[data-bs-theme="dark"] .indicador-card,
html[data-theme="dark"] .alerta-card, html[data-theme="escuro"] .alerta-card, html[data-bs-theme="dark"] .alerta-card,
html[data-theme="dark"] .pagination-wrap, html[data-theme="escuro"] .pagination-wrap, html[data-bs-theme="dark"] .pagination-wrap,
html[data-theme="dark"] .page-link, html[data-theme="escuro"] .page-link, html[data-bs-theme="dark"] .page-link,
html[data-theme="dark"] .list-group-item, html[data-theme="escuro"] .list-group-item, html[data-bs-theme="dark"] .list-group-item {
    background-color: var(--cf-surface) !important;
    color: var(--cf-text) !important;
    border-color: var(--cf-border) !important;
}
html[data-theme="dark"] .featured-section, html[data-theme="escuro"] .featured-section, html[data-bs-theme="dark"] .featured-section,
html[data-theme="dark"] .search-active, html[data-theme="escuro"] .search-active, html[data-bs-theme="dark"] .search-active,
html[data-theme="dark"] .admin-shell, html[data-theme="escuro"] .admin-shell, html[data-bs-theme="dark"] .admin-shell {
    background: linear-gradient(135deg, var(--cf-surface-2), var(--cf-bg)) !important;
    border-color: var(--cf-border) !important;
    color: var(--cf-text) !important;
}
/* Tipografia e contraste confortável */
html[data-theme="dark"] h1, html[data-theme="dark"] h2, html[data-theme="dark"] h3, html[data-theme="dark"] h4, html[data-theme="dark"] h5, html[data-theme="dark"] h6,
html[data-theme="escuro"] h1, html[data-theme="escuro"] h2, html[data-theme="escuro"] h3, html[data-theme="escuro"] h4, html[data-theme="escuro"] h5, html[data-theme="escuro"] h6,
html[data-bs-theme="dark"] h1, html[data-bs-theme="dark"] h2, html[data-bs-theme="dark"] h3, html[data-bs-theme="dark"] h4, html[data-bs-theme="dark"] h5, html[data-bs-theme="dark"] h6 {
    color: #f1f5f9;
}
html[data-theme="dark"] p, html[data-theme="dark"] li, html[data-theme="dark"] td, html[data-theme="dark"] th, html[data-theme="dark"] label, html[data-theme="dark"] span, html[data-theme="dark"] div,
html[data-theme="escuro"] p, html[data-theme="escuro"] li, html[data-theme="escuro"] td, html[data-theme="escuro"] th, html[data-theme="escuro"] label,
html[data-bs-theme="dark"] p, html[data-bs-theme="dark"] li, html[data-bs-theme="dark"] label {
    color: inherit;
}
html[data-theme="dark"] .text-muted, html[data-theme="escuro"] .text-muted, html[data-bs-theme="dark"] .text-muted,
html[data-theme="dark"] .form-text, html[data-theme="escuro"] .form-text, html[data-bs-theme="dark"] .form-text,
html[data-theme="dark"] small, html[data-theme="escuro"] small, html[data-bs-theme="dark"] small {
    color: var(--cf-muted) !important;
}
html[data-theme="dark"] a, html[data-theme="escuro"] a, html[data-bs-theme="dark"] a { color: var(--cf-link); }
html[data-theme="dark"] a:hover, html[data-theme="escuro"] a:hover, html[data-bs-theme="dark"] a:hover { color: #bfdbfe; }
/* Tabelas, inputs e controles */
html[data-theme="dark"] .table, html[data-theme="escuro"] .table, html[data-bs-theme="dark"] .table {
    --bs-table-bg: var(--cf-surface);
    --bs-table-color: var(--cf-text);
    --bs-table-border-color: var(--cf-border);
    --bs-table-striped-bg: var(--cf-surface-2);
    --bs-table-hover-bg: var(--cf-surface-3);
    color: var(--cf-text) !important;
}
html[data-theme="dark"] .table thead th, html[data-theme="escuro"] .table thead th, html[data-bs-theme="dark"] .table thead th,
html[data-theme="dark"] .admin-table th, html[data-theme="escuro"] .admin-table th, html[data-bs-theme="dark"] .admin-table th,
html[data-theme="dark"] .mk-table thead th, html[data-theme="escuro"] .mk-table thead th, html[data-bs-theme="dark"] .mk-table thead th {
    background: var(--cf-surface-2) !important;
    color: var(--cf-primary-2) !important;
    border-color: var(--cf-border) !important;
}
html[data-theme="dark"] .table td, html[data-theme="escuro"] .table td, html[data-bs-theme="dark"] .table td,
html[data-theme="dark"] .table th, html[data-theme="escuro"] .table th, html[data-bs-theme="dark"] .table th {
    border-color: var(--cf-border) !important;
}
html[data-theme="dark"] .form-control, html[data-theme="escuro"] .form-control, html[data-bs-theme="dark"] .form-control,
html[data-theme="dark"] .form-select, html[data-theme="escuro"] .form-select, html[data-bs-theme="dark"] .form-select,
html[data-theme="dark"] input, html[data-theme="escuro"] input, html[data-bs-theme="dark"] input,
html[data-theme="dark"] textarea, html[data-theme="escuro"] textarea, html[data-bs-theme="dark"] textarea,
html[data-theme="dark"] select, html[data-theme="escuro"] select, html[data-bs-theme="dark"] select {
    background-color: var(--cf-surface-2) !important;
    color: var(--cf-text) !important;
    border-color: var(--cf-border) !important;
}
html[data-theme="dark"] .form-control::placeholder, html[data-theme="escuro"] .form-control::placeholder, html[data-bs-theme="dark"] .form-control::placeholder,
html[data-theme="dark"] input::placeholder, html[data-theme="escuro"] input::placeholder, html[data-bs-theme="dark"] input::placeholder {
    color: #7f93aa !important;
}
html[data-theme="dark"] .input-group-text, html[data-theme="escuro"] .input-group-text, html[data-bs-theme="dark"] .input-group-text {
    background: var(--cf-surface-3) !important;
    color: var(--cf-muted) !important;
    border-color: var(--cf-border) !important;
}
/* Navbar/topo em dark (mantém identidade, mais profundo) */
html[data-theme="dark"] .top-bar, html[data-theme="escuro"] .top-bar, html[data-bs-theme="dark"] .top-bar,
html[data-theme="dark"] .topo, html[data-theme="escuro"] .topo, html[data-bs-theme="dark"] .topo {
    background: linear-gradient(135deg, #0b1f3a, #12315c 55%, #1a4b8c) !important;
}
/* Footer e misc */
html[data-theme="dark"] .footer, html[data-theme="escuro"] .footer, html[data-bs-theme="dark"] .footer {
    background: #0b1220 !important;
    color: #cbd5e1 !important;
    border-top: 1px solid var(--cf-border);
}
html[data-theme="dark"] hr, html[data-theme="escuro"] hr, html[data-bs-theme="dark"] hr { border-color: var(--cf-border) !important; opacity: 1; }
html[data-theme="dark"] .dropdown-menu, html[data-theme="escuro"] .dropdown-menu, html[data-bs-theme="dark"] .dropdown-menu {
    background: var(--cf-surface) !important;
    border-color: var(--cf-border) !important;
}
html[data-theme="dark"] .dropdown-item, html[data-theme="escuro"] .dropdown-item, html[data-bs-theme="dark"] .dropdown-item { color: var(--cf-text) !important; }
html[data-theme="dark"] .dropdown-item:hover, html[data-theme="escuro"] .dropdown-item:hover, html[data-bs-theme="dark"] .dropdown-item:hover { background: var(--cf-surface-2) !important; }
html[data-theme="dark"] .page-item .page-link, html[data-theme="escuro"] .page-item .page-link, html[data-bs-theme="dark"] .page-item .page-link { background: var(--cf-surface); color: var(--cf-text); border-color: var(--cf-border); }
html[data-theme="dark"] .page-item.active .page-link, html[data-theme="escuro"] .page-item.active .page-link, html[data-bs-theme="dark"] .page-item.active .page-link { background: var(--cf-primary) !important; border-color: var(--cf-primary) !important; color: #ffffff !important; }
html[data-theme="dark"] .page-item .page-link, html[data-theme="escuro"] .page-item .page-link, html[data-bs-theme="dark"] .page-item .page-link { background: var(--cf-surface); color: var(--cf-text) !important; border-color: var(--cf-border); }
html[data-theme="dark"] .page-item.disabled .page-link, html[data-theme="escuro"] .page-item.disabled .page-link, html[data-bs-theme="dark"] .page-item.disabled .page-link { background: var(--cf-surface-2); color: var(--cf-muted) !important; }
html[data-theme="dark"] .alert, html[data-theme="escuro"] .alert, html[data-bs-theme="dark"] .alert { border-color: var(--cf-border); }
html[data-theme="dark"] .modal-content, html[data-theme="escuro"] .modal-content, html[data-bs-theme="dark"] .modal-content { background: var(--cf-surface) !important; color: var(--cf-text) !important; }
html[data-theme="dark"] .btn-close, html[data-theme="escuro"] .btn-close, html[data-bs-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
/* Login/registro/admin específicos */
html[data-theme="dark"] .login-header, html[data-theme="escuro"] .login-header, html[data-bs-theme="dark"] .login-header,
html[data-theme="dark"] .register-header, html[data-theme="escuro"] .register-header, html[data-bs-theme="dark"] .register-header {
    background: linear-gradient(135deg, #0b1f3a, #12315c) !important;
}
html[data-theme="dark"] .login-footer, html[data-theme="escuro"] .login-footer, html[data-bs-theme="dark"] .login-footer,
html[data-theme="dark"] .register-footer, html[data-theme="escuro"] .register-footer, html[data-bs-theme="dark"] .register-footer {
    background: var(--cf-surface-2) !important; border-color: var(--cf-border) !important;
}
html[data-theme="dark"] .badge-suave, html[data-theme="escuro"] .badge-suave, html[data-bs-theme="dark"] .badge-suave {
    background: var(--cf-surface-2) !important; color: var(--cf-text) !important; border-color: var(--cf-border) !important;
}


/* Compactação geral e responsividade (telas pequenas) */
:root { --cf-gap-sm: 0.5rem; }
.container, .container-fluid { padding-left: 0.75rem; padding-right: 0.75rem; }
.card-body, .featured-card .card-body, .news-card, .mk-card .card-body { padding: 0.85rem; }
.table > :not(caption) > * > * { padding: 0.45rem 0.5rem; }
.form-control, .form-select, .btn { padding-top: 0.35rem; padding-bottom: 0.35rem; }
h1 { font-size: clamp(1.35rem, 2.5vw, 1.8rem); }
h2 { font-size: clamp(1.15rem, 2vw, 1.4rem); }
h3 { font-size: clamp(1.02rem, 1.8vw, 1.2rem); }

@media (max-width: 991.98px) {
  .topo > .container, .top-bar > .container { padding-left: 2.9rem !important; gap: 0.35rem; }
  .main-content, main.container { padding-top: 3.2rem !important; }
  .page-header { padding-right: 0 !important; margin-bottom: 0.75rem; }
}
@media (max-width: 768px) {
  .container, .container-fluid { padding-left: 0.6rem; padding-right: 0.6rem; }
  .row { --bs-gutter-x: 0.75rem; --bs-gutter-y: 0.75rem; }
  .card-body, .featured-card .card-body { padding: 0.75rem; }
  .news-card { padding: 0.7rem; margin-bottom: 0.6rem; }
  .table-responsive { font-size: 0.9rem; }
  .topo a, .top-bar a { font-size: 0.82rem; }
  .cf-sidebar { width: min(86vw, 290px); }
}
@media (max-width: 575.98px) {
  body { font-size: 0.95rem; }
  .container, .container-fluid { padding-left: 0.5rem; padding-right: 0.5rem; }
  .header-principal .logo, .header-noticia .logo { font-size: 1.15rem; }
  .search-box .input-group { flex-wrap: nowrap; }
  .search-box input { min-width: 0; }
  .btn, .form-control, .form-select { font-size: 0.92rem; }
  .table > :not(caption) > * > * { padding: 0.35rem 0.4rem; }
  .featured-section { padding: 0.85rem 0; }
  .ad-container { margin-bottom: 0.75rem; }
}

/* Reforço: dark em elementos comuns de notícias que usam classes locais */
html[data-theme="dark"] body.cf-page-noticias-index, html[data-theme="escuro"] body.cf-page-noticias-index, html[data-bs-theme="dark"] body.cf-page-noticias-index,
html[data-theme="dark"] body.cf-page-noticias-ver, html[data-theme="escuro"] body.cf-page-noticias-ver, html[data-bs-theme="dark"] body.cf-page-noticias-ver {
  background: var(--cf-bg) !important; color: var(--cf-text) !important;
}
html[data-theme="dark"] .news-card .news-summary, html[data-theme="escuro"] .news-card .news-summary, html[data-bs-theme="dark"] .news-card .news-summary,
html[data-theme="dark"] .featured-card .card-text, html[data-theme="escuro"] .featured-card .card-text, html[data-bs-theme="dark"] .featured-card .card-text,
html[data-theme="dark"] .featured-card .card-date, html[data-theme="escuro"] .featured-card .card-date, html[data-bs-theme="dark"] .featured-card .card-date,
html[data-theme="dark"] .news-card .news-meta, html[data-theme="escuro"] .news-card .news-meta, html[data-bs-theme="dark"] .news-card .news-meta {
  color: var(--cf-muted) !important;
}
html[data-theme="dark"] .section-title, html[data-theme="escuro"] .section-title, html[data-bs-theme="dark"] .section-title { color: var(--cf-primary-2) !important; border-left-color: var(--cf-primary); }

/* Paginação: contraste garantido (claro/escuro) */
.pagination .page-item.active .page-link { color: #fff !important; background-color: var(--cf-primary, #1a56db); border-color: var(--cf-primary, #1a56db); }
.pagination .page-link { color: var(--cf-primary, #1a56db); }
