/* NutriSync: compatibilidade de temas para a versão web já publicada.
   Mantém o JavaScript e os endpoints existentes. Exclui documentos para impressão. */
html:root {
 --page-surface:#ffffff; --page-surface-hover:#f1f5f9;
 --page-text-primary:#0f172a; --page-text-muted:#475569;
 --page-border:#cbd5e1; --ui-surface:#ffffff; --ui-surface-hover:#f1f5f9;
 --ui-text-primary:#0f172a; --ui-text-muted:#475569;
 --ui-border:#cbd5e1; --text-muted:#475569; --layout-text-muted:#475569;
 --layout-topbar-text-muted:#475569;
 --theme-link:#0369a1; --theme-primary:#1f776c; --theme-primary-end:#0369a1;
 --theme-danger:#b91c1c; --theme-danger-solid:#b91c1c;
 --theme-success:#166534; --theme-warning:#92400e;
 --theme-success-bg:#dcfce7; --theme-success-text:#14532d;
 --theme-info-bg:#e0f2fe; --theme-info-text:#075985;
 --theme-error-bg:#fee2e2; --theme-error-text:#991b1b;
 --theme-warning-bg:#fef3c7; --theme-warning-text:#78350f;
}
html:root.dark {
 --page-surface:#1e293b; --page-surface-hover:#334155;
 --page-text-primary:#e2e8f0; --page-text-muted:#cbd5e1;
 --page-border:#475569; --ui-surface:#1e293b; --ui-surface-hover:#334155;
 --ui-text-primary:#e2e8f0; --ui-text-muted:#cbd5e1;
 --ui-border:#475569; --text-muted:#cbd5e1; --layout-text-muted:#cbd5e1;
 --layout-topbar-text-muted:#cbd5e1;
 --theme-link:#7dd3fc; --theme-danger:#fca5a5;
 --theme-success:#86efac; --theme-warning:#fcd34d;
 --theme-success-bg:#14532d; --theme-success-text:#bbf7d0;
 --theme-info-bg:#0c4a6e; --theme-info-text:#bae6fd;
 --theme-error-bg:#7f1d1d; --theme-error-text:#fecaca;
 --theme-warning-bg:#78350f; --theme-warning-text:#fef3c7;
}
html:root .ns-table th {color:var(--page-text-muted)!important;}
html:root .ns-table tr:hover td {background:var(--page-surface-hover)!important; color:var(--page-text-primary)!important;}
html:root .ns-subscription-section h2 {color:var(--page-text-primary)!important;}
html:root .ns-subscription-section>p,
html:root .ns-chat-empty,
html:root .ns-empty-meal,
html:root .ns-mini-label {color:var(--page-text-muted)!important;}
html:root .ns-btn-primary {background:linear-gradient(135deg,var(--theme-primary),var(--theme-primary-end))!important; color:#fff!important;}
html:root .ns-sidebar-link-active {background:var(--layout-sidebar-hover,#1e293b)!important; color:#e2e8f0!important; box-shadow:none;}
html:root .ns-feature-card,
html:root .ns-feature-card-hover {background:var(--page-surface)!important; border-color:var(--page-border)!important;}
html:root .ns-features-grid h3 {color:var(--page-text-primary)!important;}
html:root .ns-features-grid p {color:var(--page-text-muted)!important;}
html:root .ns-features-grid a {color:var(--theme-link)!important;}
html:root .ns-tab {color:var(--page-text-muted);}
html:root .ns-tab:hover, html:root .ns-tab.active {color:var(--theme-link);border-bottom-color:var(--theme-link);}
html:root .ns-tabs {border-bottom-color:var(--page-border);}
html:root .ns-financial-consultations-table th,
html:root .ns-financial-consultations-table tr:hover,
html:root .ns-category-item,
html:root .ns-financial-report-summary {background:var(--page-surface-hover);border-color:var(--page-border);}
html:root .ns-kpi-label,
html:root .ns-report-label {color:var(--page-text-muted);}
html:root .ns-category-name,
html:root .ns-report-value,
html:root .ns-financial-report-summary h3 {color:var(--page-text-primary);}
html:root .ns-financial-type-badge.receita,
html:root .ns-financial-status-badge.pago {background:var(--theme-success-bg);color:var(--theme-success-text);}
html:root .ns-financial-type-badge.despesa {background:var(--theme-error-bg);color:var(--theme-error-text);}
html:root .ns-financial-status-badge.pendente {background:var(--theme-warning-bg);color:var(--theme-warning-text);}

html:root :is(.ns-main,.ns-modal) *[style*="color: rgb(100, 116, 139)"]:not(.exam-request-print,.exam-request-print *),
html:root :is(.ns-main,.ns-modal) *[style*="color: #64748b"]:not(.exam-request-print,.exam-request-print *) {color:var(--page-text-muted)!important;}

html:root :is(.ns-main,.ns-modal) *[style*="color: rgb(71, 85, 105)"]:not(.exam-request-print,.exam-request-print *),
html:root :is(.ns-main,.ns-modal) *[style*="color: #475569"]:not(.exam-request-print,.exam-request-print *) {color:var(--page-text-muted)!important;}

html:root :is(.ns-main,.ns-modal) *[style*="color: rgb(148, 163, 184)"]:not(.exam-request-print,.exam-request-print *),
html:root :is(.ns-main,.ns-modal) *[style*="color: #94a3b8"]:not(.exam-request-print,.exam-request-print *) {color:var(--page-text-muted)!important;}

html:root :is(.ns-main,.ns-modal) *[style*="color: rgb(15, 23, 42)"]:not(.exam-request-print,.exam-request-print *),
html:root :is(.ns-main,.ns-modal) *[style*="color: #0f172a"]:not(.exam-request-print,.exam-request-print *) {color:var(--page-text-primary)!important;}

html:root :is(.ns-main,.ns-modal) *[style*="color: rgb(30, 41, 59)"]:not(.exam-request-print,.exam-request-print *),
html:root :is(.ns-main,.ns-modal) *[style*="color: #1e293b"]:not(.exam-request-print,.exam-request-print *) {color:var(--page-text-primary)!important;}

html:root :is(.ns-main,.ns-modal) *[style*="color: rgb(14, 165, 233)"]:not(.exam-request-print,.exam-request-print *),
html:root :is(.ns-main,.ns-modal) *[style*="color: #0ea5e9"]:not(.exam-request-print,.exam-request-print *) {color:var(--theme-link)!important;}

html:root :is(.ns-main,.ns-modal) *[style*="color: rgb(239, 68, 68)"]:not(.exam-request-print,.exam-request-print *),
html:root :is(.ns-main,.ns-modal) *[style*="color: #ef4444"]:not(.exam-request-print,.exam-request-print *) {color:var(--theme-danger)!important;}

html:root :is(.ns-main,.ns-modal) *[style*="color: rgb(16, 185, 129)"]:not(.exam-request-print,.exam-request-print *),
html:root :is(.ns-main,.ns-modal) *[style*="color: #10b981"]:not(.exam-request-print,.exam-request-print *) {color:var(--theme-success)!important;}

html:root :is(.ns-main,.ns-modal) *[style*="color: rgb(245, 158, 11)"]:not(.exam-request-print,.exam-request-print *),
html:root :is(.ns-main,.ns-modal) *[style*="color: #f59e0b"]:not(.exam-request-print,.exam-request-print *) {color:var(--theme-warning)!important;}

html:root :is(.ns-main,.ns-modal) :is(div,section,article,form,label,li)[style*="background: rgb(255, 255, 255)"]:not(.exam-request-print,.exam-request-print *),
html:root :is(.ns-main,.ns-modal) :is(div,section,article,form,label,li)[style*="background: #fff"]:not(.exam-request-print,.exam-request-print *) {background:var(--page-surface)!important;}

html:root :is(.ns-main,.ns-modal) :is(div,section,article,form,label,li)[style*="background-color: rgb(255, 255, 255)"]:not(.exam-request-print,.exam-request-print *),
html:root :is(.ns-main,.ns-modal) :is(div,section,article,form,label,li)[style*="background-color: #fff"]:not(.exam-request-print,.exam-request-print *) {background:var(--page-surface)!important;}

html:root :is(.ns-main,.ns-modal) :is(div,section,article,form,label,li)[style*="background: rgb(255, 255, 255)"]:not(.exam-request-print,.exam-request-print *),
html:root :is(.ns-main,.ns-modal) :is(div,section,article,form,label,li)[style*="background: #ffffff"]:not(.exam-request-print,.exam-request-print *) {background:var(--page-surface)!important;}

html:root :is(.ns-main,.ns-modal) :is(div,section,article,form,label,li)[style*="background-color: rgb(255, 255, 255)"]:not(.exam-request-print,.exam-request-print *),
html:root :is(.ns-main,.ns-modal) :is(div,section,article,form,label,li)[style*="background-color: #ffffff"]:not(.exam-request-print,.exam-request-print *) {background:var(--page-surface)!important;}

html:root :is(.ns-main,.ns-modal) :is(div,section,article,form,label,li)[style*="background: rgb(248, 250, 252)"]:not(.exam-request-print,.exam-request-print *),
html:root :is(.ns-main,.ns-modal) :is(div,section,article,form,label,li)[style*="background: #f8fafc"]:not(.exam-request-print,.exam-request-print *) {background:var(--page-surface-hover)!important;}

html:root :is(.ns-main,.ns-modal) :is(div,section,article,form,label,li)[style*="background-color: rgb(248, 250, 252)"]:not(.exam-request-print,.exam-request-print *),
html:root :is(.ns-main,.ns-modal) :is(div,section,article,form,label,li)[style*="background-color: #f8fafc"]:not(.exam-request-print,.exam-request-print *) {background:var(--page-surface-hover)!important;}

html:root :is(.ns-main,.ns-modal) :is(div,section,article,form,label,li)[style*="background: rgb(241, 245, 249)"]:not(.exam-request-print,.exam-request-print *),
html:root :is(.ns-main,.ns-modal) :is(div,section,article,form,label,li)[style*="background: #f1f5f9"]:not(.exam-request-print,.exam-request-print *) {background:var(--page-surface-hover)!important;}

html:root :is(.ns-main,.ns-modal) :is(div,section,article,form,label,li)[style*="background-color: rgb(241, 245, 249)"]:not(.exam-request-print,.exam-request-print *),
html:root :is(.ns-main,.ns-modal) :is(div,section,article,form,label,li)[style*="background-color: #f1f5f9"]:not(.exam-request-print,.exam-request-print *) {background:var(--page-surface-hover)!important;}

html:root :is(.ns-main,.ns-modal) button[style*="background: rgb(14, 165, 233)"]:not(.exam-request-print,.exam-request-print *),
html:root :is(.ns-main,.ns-modal) button[style*="background: #0ea5e9"]:not(.exam-request-print,.exam-request-print *) {background:var(--theme-primary)!important;color:#fff!important;}

html:root :is(.ns-main,.ns-modal) button[style*="background-color: rgb(14, 165, 233)"]:not(.exam-request-print,.exam-request-print *),
html:root :is(.ns-main,.ns-modal) button[style*="background-color: #0ea5e9"]:not(.exam-request-print,.exam-request-print *) {background:var(--theme-primary)!important;color:#fff!important;}

html:root :is(.ns-main,.ns-modal) button[style*="background: rgb(239, 68, 68)"]:not(.exam-request-print,.exam-request-print *),
html:root :is(.ns-main,.ns-modal) button[style*="background: #ef4444"]:not(.exam-request-print,.exam-request-print *) {background:var(--theme-danger-solid)!important;color:#fff!important;}

html:root :is(.ns-main,.ns-modal) button[style*="background-color: rgb(239, 68, 68)"]:not(.exam-request-print,.exam-request-print *),
html:root :is(.ns-main,.ns-modal) button[style*="background-color: #ef4444"]:not(.exam-request-print,.exam-request-print *) {background:var(--theme-danger-solid)!important;color:#fff!important;}

html:root :is(.ns-main,.ns-modal) :is(div,section,article,p,span)[style*="background: rgb(209, 250, 229)"]:not(.exam-request-print,.exam-request-print *),
html:root :is(.ns-main,.ns-modal) :is(div,section,article,p,span)[style*="background: #d1fae5"]:not(.exam-request-print,.exam-request-print *) {background:var(--theme-success-bg)!important;}

html:root :is(.ns-main,.ns-modal) :is(div,section,article,p,span)[style*="background-color: rgb(209, 250, 229)"]:not(.exam-request-print,.exam-request-print *),
html:root :is(.ns-main,.ns-modal) :is(div,section,article,p,span)[style*="background-color: #d1fae5"]:not(.exam-request-print,.exam-request-print *) {background:var(--theme-success-bg)!important;}

html:root :is(.ns-main,.ns-modal) :is(div,section,article,p,span)[style*="background: rgb(236, 253, 245)"]:not(.exam-request-print,.exam-request-print *),
html:root :is(.ns-main,.ns-modal) :is(div,section,article,p,span)[style*="background: #ecfdf5"]:not(.exam-request-print,.exam-request-print *) {background:var(--theme-success-bg)!important;}

html:root :is(.ns-main,.ns-modal) :is(div,section,article,p,span)[style*="background-color: rgb(236, 253, 245)"]:not(.exam-request-print,.exam-request-print *),
html:root :is(.ns-main,.ns-modal) :is(div,section,article,p,span)[style*="background-color: #ecfdf5"]:not(.exam-request-print,.exam-request-print *) {background:var(--theme-success-bg)!important;}

html:root :is(.ns-main,.ns-modal) :is(div,section,article,p,span)[style*="background: rgb(240, 253, 244)"]:not(.exam-request-print,.exam-request-print *),
html:root :is(.ns-main,.ns-modal) :is(div,section,article,p,span)[style*="background: #f0fdf4"]:not(.exam-request-print,.exam-request-print *) {background:var(--theme-success-bg)!important;}

html:root :is(.ns-main,.ns-modal) :is(div,section,article,p,span)[style*="background-color: rgb(240, 253, 244)"]:not(.exam-request-print,.exam-request-print *),
html:root :is(.ns-main,.ns-modal) :is(div,section,article,p,span)[style*="background-color: #f0fdf4"]:not(.exam-request-print,.exam-request-print *) {background:var(--theme-success-bg)!important;}

html:root :is(.ns-main,.ns-modal) :is(div,section,article,p,span)[style*="background: rgb(224, 242, 254)"]:not(.exam-request-print,.exam-request-print *),
html:root :is(.ns-main,.ns-modal) :is(div,section,article,p,span)[style*="background: #e0f2fe"]:not(.exam-request-print,.exam-request-print *) {background:var(--theme-info-bg)!important;}

html:root :is(.ns-main,.ns-modal) :is(div,section,article,p,span)[style*="background-color: rgb(224, 242, 254)"]:not(.exam-request-print,.exam-request-print *),
html:root :is(.ns-main,.ns-modal) :is(div,section,article,p,span)[style*="background-color: #e0f2fe"]:not(.exam-request-print,.exam-request-print *) {background:var(--theme-info-bg)!important;}

html:root :is(.ns-main,.ns-modal) :is(div,section,article,p,span)[style*="background: rgb(240, 249, 255)"]:not(.exam-request-print,.exam-request-print *),
html:root :is(.ns-main,.ns-modal) :is(div,section,article,p,span)[style*="background: #f0f9ff"]:not(.exam-request-print,.exam-request-print *) {background:var(--theme-info-bg)!important;}

html:root :is(.ns-main,.ns-modal) :is(div,section,article,p,span)[style*="background-color: rgb(240, 249, 255)"]:not(.exam-request-print,.exam-request-print *),
html:root :is(.ns-main,.ns-modal) :is(div,section,article,p,span)[style*="background-color: #f0f9ff"]:not(.exam-request-print,.exam-request-print *) {background:var(--theme-info-bg)!important;}

html:root :is(.ns-main,.ns-modal) :is(div,section,article,p,span)[style*="background: rgb(239, 246, 255)"]:not(.exam-request-print,.exam-request-print *),
html:root :is(.ns-main,.ns-modal) :is(div,section,article,p,span)[style*="background: #eff6ff"]:not(.exam-request-print,.exam-request-print *) {background:var(--theme-info-bg)!important;}

html:root :is(.ns-main,.ns-modal) :is(div,section,article,p,span)[style*="background-color: rgb(239, 246, 255)"]:not(.exam-request-print,.exam-request-print *),
html:root :is(.ns-main,.ns-modal) :is(div,section,article,p,span)[style*="background-color: #eff6ff"]:not(.exam-request-print,.exam-request-print *) {background:var(--theme-info-bg)!important;}

html:root :is(.ns-main,.ns-modal) :is(div,section,article,p,span)[style*="background: rgb(219, 234, 254)"]:not(.exam-request-print,.exam-request-print *),
html:root :is(.ns-main,.ns-modal) :is(div,section,article,p,span)[style*="background: #dbeafe"]:not(.exam-request-print,.exam-request-print *) {background:var(--theme-info-bg)!important;}

html:root :is(.ns-main,.ns-modal) :is(div,section,article,p,span)[style*="background-color: rgb(219, 234, 254)"]:not(.exam-request-print,.exam-request-print *),
html:root :is(.ns-main,.ns-modal) :is(div,section,article,p,span)[style*="background-color: #dbeafe"]:not(.exam-request-print,.exam-request-print *) {background:var(--theme-info-bg)!important;}

html:root :is(.ns-main,.ns-modal) :is(div,section,article,p,span)[style*="background: rgb(254, 226, 226)"]:not(.exam-request-print,.exam-request-print *),
html:root :is(.ns-main,.ns-modal) :is(div,section,article,p,span)[style*="background: #fee2e2"]:not(.exam-request-print,.exam-request-print *) {background:var(--theme-error-bg)!important;}

html:root :is(.ns-main,.ns-modal) :is(div,section,article,p,span)[style*="background-color: rgb(254, 226, 226)"]:not(.exam-request-print,.exam-request-print *),
html:root :is(.ns-main,.ns-modal) :is(div,section,article,p,span)[style*="background-color: #fee2e2"]:not(.exam-request-print,.exam-request-print *) {background:var(--theme-error-bg)!important;}

html:root :is(.ns-main,.ns-modal) :is(div,section,article,p,span)[style*="background: rgb(254, 243, 199)"]:not(.exam-request-print,.exam-request-print *),
html:root :is(.ns-main,.ns-modal) :is(div,section,article,p,span)[style*="background: #fef3c7"]:not(.exam-request-print,.exam-request-print *) {background:var(--theme-warning-bg)!important;}

html:root :is(.ns-main,.ns-modal) :is(div,section,article,p,span)[style*="background-color: rgb(254, 243, 199)"]:not(.exam-request-print,.exam-request-print *),
html:root :is(.ns-main,.ns-modal) :is(div,section,article,p,span)[style*="background-color: #fef3c7"]:not(.exam-request-print,.exam-request-print *) {background:var(--theme-warning-bg)!important;}

html:root :is(.ns-main,.ns-modal) *[style*="color: rgb(6, 95, 70)"]:not(.exam-request-print,.exam-request-print *),
html:root :is(.ns-main,.ns-modal) *[style*="color: #065f46"]:not(.exam-request-print,.exam-request-print *) {color:var(--theme-success-text)!important;}

html:root :is(.ns-main,.ns-modal) *[style*="color: rgb(4, 120, 87)"]:not(.exam-request-print,.exam-request-print *),
html:root :is(.ns-main,.ns-modal) *[style*="color: #047857"]:not(.exam-request-print,.exam-request-print *) {color:var(--theme-success-text)!important;}

html:root :is(.ns-main,.ns-modal) *[style*="color: rgb(5, 150, 105)"]:not(.exam-request-print,.exam-request-print *),
html:root :is(.ns-main,.ns-modal) *[style*="color: #059669"]:not(.exam-request-print,.exam-request-print *) {color:var(--theme-success-text)!important;}

html:root :is(.ns-main,.ns-modal) *[style*="color: rgb(12, 74, 110)"]:not(.exam-request-print,.exam-request-print *),
html:root :is(.ns-main,.ns-modal) *[style*="color: #0c4a6e"]:not(.exam-request-print,.exam-request-print *) {color:var(--theme-info-text)!important;}

html:root :is(.ns-main,.ns-modal) *[style*="color: rgb(7, 89, 133)"]:not(.exam-request-print,.exam-request-print *),
html:root :is(.ns-main,.ns-modal) *[style*="color: #075985"]:not(.exam-request-print,.exam-request-print *) {color:var(--theme-info-text)!important;}

html:root :is(.ns-main,.ns-modal) *[style*="color: rgb(30, 64, 175)"]:not(.exam-request-print,.exam-request-print *),
html:root :is(.ns-main,.ns-modal) *[style*="color: #1e40af"]:not(.exam-request-print,.exam-request-print *) {color:var(--theme-info-text)!important;}

html:root :is(.ns-main,.ns-modal) *[style*="color: rgb(153, 27, 27)"]:not(.exam-request-print,.exam-request-print *),
html:root :is(.ns-main,.ns-modal) *[style*="color: #991b1b"]:not(.exam-request-print,.exam-request-print *) {color:var(--theme-error-text)!important;}

html:root :is(.ns-main,.ns-modal) *[style*="color: rgb(146, 64, 14)"]:not(.exam-request-print,.exam-request-print *),
html:root :is(.ns-main,.ns-modal) *[style*="color: #92400e"]:not(.exam-request-print,.exam-request-print *) {color:var(--theme-warning-text)!important;}

/* O conteúdo que vira documento conserva papel branco e tinta escura. */
html:root .exam-request-print {background:#fff!important;color:#0f172a!important;color-scheme:light;}

html:root .ns-features-grid h3 {
  font-size:15px!important; line-height:1.4!important;
  overflow-wrap:normal!important; word-break:normal!important;
}
/* Textos de botões ativos não herdam a conversão dos neutros legados. */
html:root :is(.ns-main,.ns-modal) button[style*="background: var(--theme-primary)"],
html:root :is(.ns-main,.ns-modal) button[style*="background: var(--theme-danger-solid)"] {
  color:#fff!important;
}
html:root :is(.ns-main,.ns-modal) button[style*="color: rgb(42, 157, 143)"],
html:root :is(.ns-main,.ns-modal) button[style*="color: #2a9d8f"] {
  color:var(--theme-link)!important;
}
html:root :is(.ns-main,.ns-modal) [style*="color: rgb(42, 157, 143)"]:not(.exam-request-print,.exam-request-print *) {
  color:var(--theme-link)!important;
}
html:root :is(.ns-main,.ns-modal) :is(a,button)[style*="background: rgb(42, 157, 143)"] {
  background:var(--theme-primary)!important;color:#fff!important;
}
html:root .ns-btn-outline {color:var(--theme-link)!important;border-color:var(--theme-link)!important;}
html:root .ns-btn-outline:hover {background:var(--theme-primary)!important;color:#fff!important;}
