/**
 * Tema global: off-white (conforto), claro original, escuro.
 * Controlado por html[data-app-theme="..."] definido em aplicarTemaApp() e no <head> do index.
 */

/* ——— Claro padrão (próximo do Tailwind bg-slate-50) ——— */
html[data-app-theme="light"] body {
    background-color: #f8fafc !important;
    color: #1e293b !important;
}

html[data-app-theme="light"] .top-header {
    background-color: rgba(255, 255, 255, 0.85) !important;
    border-color: #e2e8f0 !important;
}

html[data-app-theme="light"] .card,
html[data-app-theme="light"] .card-kpi {
    background-color: #ffffff !important;
    border-color: #f1f5f9 !important;
}

/* ——— Off-white / gelo (menos branco puro) ——— */
html[data-app-theme="offwhite"] body {
    background-color: #e9edf2 !important;
    color: #1e293b !important;
}

html[data-app-theme="offwhite"] .top-header {
    background-color: rgba(241, 244, 248, 0.92) !important;
    border-color: #d8dee6 !important;
}

html[data-app-theme="offwhite"] .card,
html[data-app-theme="offwhite"] .card-kpi {
    background-color: #f6f8fa !important;
    border-color: #dce2e9 !important;
}

html[data-app-theme="offwhite"] .config-tabs {
    background-color: #dfe5ec !important;
}

html[data-app-theme="offwhite"] input:not([type="checkbox"]):not([type="radio"]),
html[data-app-theme="offwhite"] select,
html[data-app-theme="offwhite"] textarea {
    background-color: #fafbfc !important;
}

/* ——— Escuro ——— */
html[data-app-theme="dark"] body {
    background-color: #0f172a !important;
    color: #e2e8f0 !important;
}

html[data-app-theme="dark"] h1,
html[data-app-theme="dark"] h2,
html[data-app-theme="dark"] h3,
html[data-app-theme="dark"] h4,
html[data-app-theme="dark"] h5,
html[data-app-theme="dark"] h6 {
    color: #f1f5f9 !important;
}

html[data-app-theme="dark"] .top-header {
    background-color: rgba(15, 23, 42, 0.92) !important;
    border-color: #334155 !important;
}

html[data-app-theme="dark"] .card,
html[data-app-theme="dark"] .card-kpi {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

html[data-app-theme="dark"] .config-tabs {
    background-color: #1e293b !important;
}

html[data-app-theme="dark"] .tab-btn {
    color: #cbd5e1 !important;
}

html[data-app-theme="dark"] .tab-btn:hover {
    background-color: #334155 !important;
}

html[data-app-theme="dark"] .tab-btn.active {
    background-color: #334155 !important;
    color: #f8fafc !important;
}

html[data-app-theme="dark"] input:not([type="checkbox"]):not([type="radio"]),
html[data-app-theme="dark"] select,
html[data-app-theme="dark"] textarea {
    background-color: #0f172a !important;
    border-color: #475569 !important;
    color: #e2e8f0 !important;
}

html[data-app-theme="dark"] thead tr,
html[data-app-theme="dark"] th {
    background-color: #1e293b !important;
    color: #94a3b8 !important;
    border-color: #334155 !important;
}

html[data-app-theme="dark"] td {
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

html[data-app-theme="dark"] tbody tr:hover {
    background-color: rgba(51, 65, 85, 0.5) !important;
}

html[data-app-theme="dark"] .text-slate-800,
html[data-app-theme="dark"] .text-slate-900 {
    color: #f1f5f9 !important;
}

html[data-app-theme="dark"] .text-slate-500,
html[data-app-theme="dark"] .text-slate-600,
html[data-app-theme="dark"] .text-slate-700 {
    color: #94a3b8 !important;
}

html[data-app-theme="dark"] .border-slate-100,
html[data-app-theme="dark"] .border-slate-200 {
    border-color: #334155 !important;
}

html[data-app-theme="dark"] .bg-slate-50 {
    background-color: rgba(30, 41, 59, 0.6) !important;
}

html[data-app-theme="dark"] .segmented-control {
    background-color: #334155 !important;
}

html[data-app-theme="dark"] .segmented-control label {
    color: #cbd5e1 !important;
}

html[data-app-theme="dark"] .segmented-control input:checked + label {
    background-color: #475569 !important;
    color: #f8fafc !important;
}
