
/* Seletor de tema */

#tatami-tema {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #151515;
    color: #ffffff;
    border: 1px solid #444;
    border-radius: 30px;
    padding: 12px 18px;
    font: 600 13px Arial, sans-serif;
    cursor: pointer;
    box-shadow: 0 4px 15px #00000025;
}

#tatami-tema:hover {
    background: #e30613;
}

#tatami-tema:focus-visible {
    outline: 3px solid #e30613;
    outline-offset: 3px;
}

/* Modo escuro */

html[data-tema="escuro"] {
    color-scheme: dark;
    background: #111827;
}

html[data-tema="escuro"] body,
html[data-tema="escuro"] main,
html[data-tema="escuro"] .content,
html[data-tema="escuro"] .main-content,
html[data-tema="escuro"] .conteudo {
    background: #111827 !important;
    color: #f1f5f9 !important;
}

html[data-tema="escuro"] .card,
html[data-tema="escuro"] .filtros,
html[data-tema="escuro"] .panel,
html[data-tema="escuro"] .stat-card,
html[data-tema="escuro"] .summary-card {
    background: #1e293b !important;
    color: #f1f5f9 !important;
    border-color: #334155 !important;
    box-shadow: none;
}

html[data-tema="escuro"] h1,
html[data-tema="escuro"] h2,
html[data-tema="escuro"] h3,
html[data-tema="escuro"] label {
    color: #f1f5f9 !important;
}

html[data-tema="escuro"] .legenda,
html[data-tema="escuro"] .nota,
html[data-tema="escuro"] .muted,
html[data-tema="escuro"] small {
    color: #aebed0 !important;
}

html[data-tema="escuro"] input,
html[data-tema="escuro"] select,
html[data-tema="escuro"] textarea {
    background: #111827 !important;
    color: #f1f5f9 !important;
    border-color: #475569 !important;
}

html[data-tema="escuro"] input::placeholder,
html[data-tema="escuro"] textarea::placeholder {
    color: #94a3b8;
}

html[data-tema="escuro"] table {
    background: #1e293b !important;
    color: #f1f5f9 !important;
}

html[data-tema="escuro"] th {
    background: #0f172a !important;
    color: #ffffff !important;
}

html[data-tema="escuro"] tbody tr,
html[data-tema="escuro"] td {
    background: #1e293b !important;
    color: #f1f5f9;
    border-color: #334155 !important;
}

html[data-tema="escuro"] tbody tr:hover td {
    background: #273449 !important;
}

html[data-tema="escuro"] .barra {
    background: #334155 !important;
}

html[data-tema="escuro"] .verde {
    color: #4ade80 !important;
}

html[data-tema="escuro"] .vermelho:not(.btn):not(button):not(a),
html[data-tema="escuro"] .erro,
html[data-tema="escuro"] .errorlist {
    color: #f87171 !important;
}

html[data-tema="escuro"] .amarelo {
    color: #fbbf24 !important;
}

html[data-tema="escuro"] .aviso {
    background: #422b15 !important;
    color: #fde68a !important;
}

html[data-tema="escuro"] .btn.cinza {
    background: #475569 !important;
    color: #ffffff !important;
}

html[data-tema="escuro"] #tatami-tema {
    background: #f1f5f9;
    color: #151515;
    border-color: #cbd5e1;
}

@media (max-width: 600px) {
    #tatami-tema {
        bottom: 12px;
        right: 12px;
        padding: 11px 14px;
    }

    body {
        padding-bottom: 70px;
    }
}


/* Ajuste do modo claro - tons menos agressivos */
html[data-tema="claro"] body,
html:not([data-tema]) body {
    background: #eef1f4 !important;
    color: #151515 !important;
}

html[data-tema="claro"] main,
html:not([data-tema]) main,
html[data-tema="claro"] .content,
html:not([data-tema]) .content,
html[data-tema="claro"] .main-content,
html:not([data-tema]) .main-content,
html[data-tema="claro"] .conteudo,
html:not([data-tema]) .conteudo {
    background: #eef1f4 !important;
}

html[data-tema="claro"] .card,
html:not([data-tema]) .card,
html[data-tema="claro"] .filtros,
html:not([data-tema]) .filtros,
html[data-tema="claro"] .panel,
html:not([data-tema]) .panel,
html[data-tema="claro"] .stat-card,
html:not([data-tema]) .stat-card,
html[data-tema="claro"] .summary-card,
html:not([data-tema]) .summary-card {
    background: #f8f9fb !important;
    border: 1px solid #e5e7eb !important;
}

/* Ajuste do modo claro - tons menos agressivos */
html[data-tema="claro"] body,
html:not([data-tema]) body {
    background: #eef1f4 !important;
    color: #151515 !important;
}

html[data-tema="claro"] main,
html:not([data-tema]) main,
html[data-tema="claro"] .content,
html:not([data-tema]) .content,
html[data-tema="claro"] .main-content,
html:not([data-tema]) .main-content,
html[data-tema="claro"] .conteudo,
html:not([data-tema]) .conteudo {
    background: #eef1f4 !important;
}

html[data-tema="claro"] .card,
html:not([data-tema]) .card,
html[data-tema="claro"] .filtros,
html:not([data-tema]) .filtros,
html[data-tema="claro"] .panel,
html:not([data-tema]) .panel,
html[data-tema="claro"] .stat-card,
html:not([data-tema]) .stat-card,
html[data-tema="claro"] .summary-card,
html:not([data-tema]) .summary-card {
    background: #f8f9fb !important;
    border: 1px solid #e5e7eb !important;
}

/* TATAMI - Paleta de conforto visual */

html[data-tema="claro"] {
    --fundo: #e5e7e9;
    --superficie: #f0f1f2;
    --texto: #343434;
    --secundario: #626262;
    --borda: #d5d7da;
    --campo: #f5f5f5;
    --verde: #287849;
    --vermelho: #bd2530;
    --amarelo: #94651c;
    --tabela: #dedfe1;
    --hover: #e6e7e9;
}

html[data-tema="escuro"] {
    --fundo: #1c1c1e;
    --superficie: #29292c;
    --texto: #dedede;
    --secundario: #b5b5b5;
    --borda: #3b3b3e;
    --campo: #222224;
    --verde: #81c99b;
    --vermelho: #ef858c;
    --amarelo: #dbb574;
    --tabela: #343437;
    --hover: #323235;
}

/* Fundo geral */

html[data-tema],
html[data-tema] body,
html[data-tema] main,
html[data-tema] .content,
html[data-tema] .main-content,
html[data-tema] .conteudo {
    background: var(--fundo) !important;
    color: var(--texto) !important;
}

/* Cartoes e paineis */

html[data-tema] .card,
html[data-tema] .filtros,
html[data-tema] .panel,
html[data-tema] .stat-card,
html[data-tema] .summary-card {
    background: var(--superficie) !important;
    color: var(--texto) !important;
    border-color: var(--borda) !important;
    box-shadow: 0 2px 8px #00000008;
}

/* Titulos e textos */

html[data-tema] h1,
html[data-tema] h2,
html[data-tema] h3,
html[data-tema] label {
    color: var(--texto) !important;
}

html[data-tema] .legenda,
html[data-tema] .nota,
html[data-tema] .muted,
html[data-tema] small {
    color: var(--secundario) !important;
}

/* Campos de preenchimento */

html[data-tema] input,
html[data-tema] select,
html[data-tema] textarea {
    background: var(--campo) !important;
    color: var(--texto) !important;
    border-color: var(--borda) !important;
}

/* Tabelas */

html[data-tema] table,
html[data-tema] tbody tr,
html[data-tema] td {
    background: var(--superficie) !important;
    color: var(--texto) !important;
    border-color: var(--borda) !important;
}

html[data-tema] th {
    background: #303033 !important;
    color: #e8e8e8 !important;
}

html[data-tema] tbody tr:hover td {
    background: var(--hover) !important;
}

/* Indicadores financeiros */

html[data-tema] .verde {
    color: var(--verde) !important;
}

html[data-tema] .vermelho:not(.btn):not(a):not(button),
html[data-tema] .erro {
    color: var(--vermelho) !important;
}

html[data-tema] .amarelo {
    color: var(--amarelo) !important;
}

html[data-tema] .barra {
    background: var(--tabela) !important;
}

/* Menu lateral */

html[data-tema] .sidebar {
    background: #171719 !important;
}

html[data-tema] [data-tatami-menu-item="true"]:is(a) {
    background: #ce202b !important;
    color: #ffffff !important;
}

html[data-tema] [data-tatami-menu-item="true"]:is(a):hover {
    background: #b81c26 !important;
}

/* Seletor de tema */

html[data-tema="escuro"] #tatami-tema {
    background: #363639 !important;
    color: #dedede !important;
    border-color: #505053 !important;
}


/* TATAMI - Paleta de conforto visual */

html[data-tema="claro"] {
    --fundo: #e5e7e9;
    --superficie: #f0f1f2;
    --texto: #343434;
    --secundario: #626262;
    --borda: #d5d7da;
    --campo: #f5f5f5;
    --verde: #287849;
    --vermelho: #bd2530;
    --amarelo: #94651c;
    --tabela: #dedfe1;
    --hover: #e6e7e9;
}

html[data-tema="escuro"] {
    --fundo: #1c1c1e;
    --superficie: #29292c;
    --texto: #dedede;
    --secundario: #b5b5b5;
    --borda: #3b3b3e;
    --campo: #222224;
    --verde: #81c99b;
    --vermelho: #ef858c;
    --amarelo: #dbb574;
    --tabela: #343437;
    --hover: #323235;
}

/* Fundo geral */

html[data-tema],
html[data-tema] body,
html[data-tema] main,
html[data-tema] .content,
html[data-tema] .main-content,
html[data-tema] .conteudo {
    background: var(--fundo) !important;
    color: var(--texto) !important;
}

/* Cartoes e paineis */

html[data-tema] .card,
html[data-tema] .filtros,
html[data-tema] .panel,
html[data-tema] .stat-card,
html[data-tema] .summary-card {
    background: var(--superficie) !important;
    color: var(--texto) !important;
    border-color: var(--borda) !important;
    box-shadow: 0 2px 8px #00000008;
}

/* Titulos e textos */

html[data-tema] h1,
html[data-tema] h2,
html[data-tema] h3,
html[data-tema] label {
    color: var(--texto) !important;
}

html[data-tema] .legenda,
html[data-tema] .nota,
html[data-tema] .muted,
html[data-tema] small {
    color: var(--secundario) !important;
}

/* Campos de preenchimento */

html[data-tema] input,
html[data-tema] select,
html[data-tema] textarea {
    background: var(--campo) !important;
    color: var(--texto) !important;
    border-color: var(--borda) !important;
}

/* Tabelas */

html[data-tema] table,
html[data-tema] tbody tr,
html[data-tema] td {
    background: var(--superficie) !important;
    color: var(--texto) !important;
    border-color: var(--borda) !important;
}

html[data-tema] th {
    background: #303033 !important;
    color: #e8e8e8 !important;
}

html[data-tema] tbody tr:hover td {
    background: var(--hover) !important;
}

/* Indicadores financeiros */

html[data-tema] .verde {
    color: var(--verde) !important;
}

html[data-tema] .vermelho:not(.btn):not(a):not(button),
html[data-tema] .erro {
    color: var(--vermelho) !important;
}

html[data-tema] .amarelo {
    color: var(--amarelo) !important;
}

html[data-tema] .barra {
    background: var(--tabela) !important;
}

/* Menu lateral */

html[data-tema] .sidebar {
    background: #171719 !important;
}

html[data-tema] [data-tatami-menu-item="true"]:is(a) {
    background: #ce202b !important;
    color: #ffffff !important;
}

html[data-tema] [data-tatami-menu-item="true"]:is(a):hover {
    background: #b81c26 !important;
}

/* Seletor de tema */

html[data-tema="escuro"] #tatami-tema {
    background: #363639 !important;
    color: #dedede !important;
    border-color: #505053 !important;
}


/* TATAMI - Paleta de conforto visual */

html[data-tema="claro"] {
    --fundo: #e5e7e9;
    --superficie: #f0f1f2;
    --texto: #343434;
    --secundario: #626262;
    --borda: #d5d7da;
    --campo: #f5f5f5;
    --verde: #287849;
    --vermelho: #bd2530;
    --amarelo: #94651c;
    --tabela: #dedfe1;
    --hover: #e6e7e9;
}

html[data-tema="escuro"] {
    --fundo: #1c1c1e;
    --superficie: #29292c;
    --texto: #dedede;
    --secundario: #b5b5b5;
    --borda: #3b3b3e;
    --campo: #222224;
    --verde: #81c99b;
    --vermelho: #ef858c;
    --amarelo: #dbb574;
    --tabela: #343437;
    --hover: #323235;
}

/* Fundo geral */

html[data-tema],
html[data-tema] body,
html[data-tema] main,
html[data-tema] .content,
html[data-tema] .main-content,
html[data-tema] .conteudo {
    background: var(--fundo) !important;
    color: var(--texto) !important;
}

/* Cartoes e paineis */

html[data-tema] .card,
html[data-tema] .filtros,
html[data-tema] .panel,
html[data-tema] .stat-card,
html[data-tema] .summary-card {
    background: var(--superficie) !important;
    color: var(--texto) !important;
    border-color: var(--borda) !important;
    box-shadow: 0 2px 8px #00000008;
}

/* Titulos e textos */

html[data-tema] h1,
html[data-tema] h2,
html[data-tema] h3,
html[data-tema] label {
    color: var(--texto) !important;
}

html[data-tema] .legenda,
html[data-tema] .nota,
html[data-tema] .muted,
html[data-tema] small {
    color: var(--secundario) !important;
}

/* Campos de preenchimento */

html[data-tema] input,
html[data-tema] select,
html[data-tema] textarea {
    background: var(--campo) !important;
    color: var(--texto) !important;
    border-color: var(--borda) !important;
}

/* Tabelas */

html[data-tema] table,
html[data-tema] tbody tr,
html[data-tema] td {
    background: var(--superficie) !important;
    color: var(--texto) !important;
    border-color: var(--borda) !important;
}

html[data-tema] th {
    background: #303033 !important;
    color: #e8e8e8 !important;
}

html[data-tema] tbody tr:hover td {
    background: var(--hover) !important;
}

/* Indicadores financeiros */

html[data-tema] .verde {
    color: var(--verde) !important;
}

html[data-tema] .vermelho:not(.btn):not(a):not(button),
html[data-tema] .erro {
    color: var(--vermelho) !important;
}

html[data-tema] .amarelo {
    color: var(--amarelo) !important;
}

html[data-tema] .barra {
    background: var(--tabela) !important;
}

/* Menu lateral */

html[data-tema] .sidebar {
    background: #171719 !important;
}

html[data-tema] [data-tatami-menu-item="true"]:is(a) {
    background: #ce202b !important;
    color: #ffffff !important;
}

html[data-tema] [data-tatami-menu-item="true"]:is(a):hover {
    background: #b81c26 !important;
}

/* Seletor de tema */

html[data-tema="escuro"] #tatami-tema {
    background: #363639 !important;
    color: #dedede !important;
    border-color: #505053 !important;
}

