/* Tema visual compartilhado — carregado após os estilos específicos de cada página. */
:root {
  --verde-primario: #0f766e;
  --verde-escuro: #115e59;
  --verde-claro: #ecf4f1;
  --branco: #ffffff;
  --cinza-claro: #f6f9f8;
  --cinza-medio: #d5e2dd;
  --cinza-escuro: #53665f;
  --texto-escuro: #162a24;
  --sombra: 0 10px 30px rgba(15, 52, 45, 0.08);
  --sombra-hover: 0 16px 42px rgba(15, 52, 45, 0.13);
  --brand-gradient: linear-gradient(118deg, #115e59 0%, #0f766e 40%, #197687 60%, #245b8a 100%);
  --brand-gradient-hover: linear-gradient(105deg, #115e59 0%, #156a7a 58%, #1f4f78 100%);
}

body {
  color: #162a24;
  background: #f6f9f8;
}

.dashboard-header,
.historico-header,
.relatorios-header,
.topo,
.activity-header,
.auth-header,
body > header {
  color: #ffffff;
  background: var(--brand-gradient) !important;
  box-shadow: 0 8px 24px rgba(15, 52, 45, 0.14);
}

.logo,
.auth-header .logo,
.nav-link,
.nav-menu a,
.user-name,
body > header h1,
body > header nav a {
  color: #ffffff !important;
}

.nav-link.active,
.nav-link:hover,
.nav-menu a.active,
.nav-menu a:hover,
body > header nav a:hover,
body > header nav a.ativo {
  background: rgba(255, 255, 255, 0.14) !important;
  text-decoration: none !important;
}

.logout-btn {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.38) !important;
}

.welcome-banner,
.perfil-header {
  color: #ffffff !important;
  background: var(--brand-gradient) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 16px 38px rgba(27, 83, 105, 0.2) !important;
}

.welcome-banner p,
.perfil-header p,
.perfil-header .email,
.perfil-header .bio {
  color: #dcece7 !important;
}

.date-display,
.stat-rapida {
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
}

.metric-card,
.weekly-card,
.action-btn,
.metrica-card,
.metrica-hoje-card,
.detalhes-coluna,
.estatistica-card,
.tabela-container,
.resumo-card,
.grafico-full,
.grafico-container,
.analise-card,
.recomendacao-card,
.comparativo-container,
.tracker-card,
.history-card,
.auth-form-section,
.login-container,
.onboarding-container,
.card {
  background: #ffffff !important;
  border-color: #d5e2dd !important;
  box-shadow: var(--sombra) !important;
}

.metric-card {
  border-left: 1px solid #d5e2dd !important;
  border-top: 4px solid #0f766e !important;
}

.metric-card:nth-child(1) { border-top-color: #6d5bd0 !important; }
.metric-card:nth-child(2) { border-top-color: #4d7c0f !important; }
.metric-card:nth-child(3) { border-top-color: #c2410c !important; }
.metric-card:nth-child(4) { border-top-color: #0369a1 !important; }

.metric-card:nth-child(1) .metric-value { color: #6d5bd0 !important; }
.metric-card:nth-child(2) .metric-value { color: #4d7c0f !important; }
.metric-card:nth-child(3) .metric-value { color: #c2410c !important; }
.metric-card:nth-child(4) .metric-value { color: #0369a1 !important; }

.metric-card:nth-child(1) .progress-fill { background: #6d5bd0 !important; }
.metric-card:nth-child(2) .progress-fill { background: #4d7c0f !important; }
.metric-card:nth-child(3) .progress-fill { background: #c2410c !important; }
.metric-card:nth-child(4) .progress-fill { background: #0369a1 !important; }

.metricas-grid .metrica-card .metrica-valor,
.metricas-hoje-grid .metrica-hoje-valor,
.estatistica-valor {
  color: #0f766e !important;
}

.estatistica-icon,
.resumo-icon,
.metrica-icon,
.metrica-hoje-icon {
  background: #0f766e !important;
}

.metrica-icon--blood { background: #b42338 !important; }

/* Métricas gerais do Perfil: somente Sono e Alimentação seguem suas cores. */
.metricas-grid .metrica-card:nth-child(1) .metrica-icon { background: #6d5bd0 !important; }
.metricas-grid .metrica-card:nth-child(2) .metrica-icon { background: #4d7c0f !important; }

/* Perfil: a cor do bloco de cada ícone acompanha a sua meta correspondente. */
.metricas-hoje-grid .metrica-hoje-card:nth-child(1) .metrica-hoje-icon { background: #6d5bd0 !important; }
.metricas-hoje-grid .metrica-hoje-card:nth-child(2) .metrica-hoje-icon { background: #4d7c0f !important; }
.metricas-hoje-grid .metrica-hoje-card:nth-child(3) .metrica-hoje-icon { background: #c2410c !important; }
.metricas-hoje-grid .metrica-hoje-card:nth-child(4) .metrica-hoje-icon { background: #0369a1 !important; }

/* Histórico: cores das métricas seguem o mesmo mapa do Dashboard. */
.estatisticas-grid .estatistica-card { border-top: 4px solid #0f766e; }
.estatisticas-grid .estatistica-card:nth-child(1) { border-top-color: #6d5bd0; }
.estatisticas-grid .estatistica-card:nth-child(2) { border-top-color: #4d7c0f; }
.estatisticas-grid .estatistica-card:nth-child(3) { border-top-color: #c2410c; }
.estatisticas-grid .estatistica-card:nth-child(4) { border-top-color: #0369a1; }
.estatisticas-grid .estatistica-card:nth-child(1) .estatistica-icon { background: #6d5bd0 !important; }
.estatisticas-grid .estatistica-card:nth-child(2) .estatistica-icon { background: #4d7c0f !important; }
.estatisticas-grid .estatistica-card:nth-child(3) .estatistica-icon { background: #c2410c !important; }
.estatisticas-grid .estatistica-card:nth-child(4) .estatistica-icon { background: #0369a1 !important; }
.estatisticas-grid .estatistica-card:nth-child(1) .estatistica-valor { color: #6d5bd0 !important; }
.estatisticas-grid .estatistica-card:nth-child(2) .estatistica-valor { color: #4d7c0f !important; }
.estatisticas-grid .estatistica-card:nth-child(3) .estatistica-valor { color: #c2410c !important; }
.estatisticas-grid .estatistica-card:nth-child(4) .estatistica-valor { color: #0369a1 !important; }

/* Tabela diária: colunas visíveis, separadas e identificadas pela sua cor. */
.tabela-container { padding: 0; border: 1px solid #d5e2dd !important; border-radius: 18px !important; }
.tabela-container table { border-collapse: separate; border-spacing: 0; overflow: hidden; border-radius: 17px; }
.tabela-container thead { background: transparent !important; }
.tabela-container th,
.tabela-container td { border-right: 1px solid #dfe9e5; }
.tabela-container th:last-child,
.tabela-container td:last-child { border-right: 0; }
.tabela-container th { color: #173247; background: #f5f8f7; box-shadow: inset 0 3px 0 #0f766e; }
.tabela-container th:nth-child(1) { color: #315265; box-shadow: inset 0 3px 0 #315265; }
.tabela-container th:nth-child(2) { color: #6250c3; background: #f4f1ff; box-shadow: inset 0 3px 0 #6d5bd0; }
.tabela-container th:nth-child(3) { color: #466f11; background: #f3f8e9; box-shadow: inset 0 3px 0 #4d7c0f; }
.tabela-container th:nth-child(4) { color: #a43b0d; background: #fff3ed; box-shadow: inset 0 3px 0 #c2410c; }
.tabela-container th:nth-child(5) { color: #075f91; background: #edf7fd; box-shadow: inset 0 3px 0 #0369a1; }
.tabela-container th:nth-child(6) { color: #976b13; background: #fff9e9; box-shadow: inset 0 3px 0 #c58b1c; }
.tabela-container tbody td:nth-child(1) { color: #315265; font-weight: 700; }
.tabela-container tbody td:nth-child(2) { color: #6250c3; }
.tabela-container tbody td:nth-child(3) { color: #466f11; }
.tabela-container tbody td:nth-child(4) { color: #a43b0d; }
.tabela-container tbody td:nth-child(5) { color: #075f91; }
.tabela-container tbody td:nth-child(6) { color: #976b13; }
.tabela-container tbody tr:hover td { background: #f8fbfa; }
.quality-cell { white-space: nowrap; }
.quality-rating { display: inline-flex; align-items: center; gap: 2px; color: #c58b1c; }
.quality-rating strong { margin-left: .35rem; color: #8c6518; font-size: .85rem; }
.quality-star { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linejoin: round; }
.quality-star__outline { fill: none; }
.quality-star__fill { fill: currentColor; stroke: none; }
.quality-star--empty .quality-star__fill { display: none; }
.quality-star--half .quality-star__fill { clip-path: inset(0 50% 0 0); }

/* Insights usam tons próprios, sem competir com as cores das métricas. */
.insights-grid .insight-card:nth-child(1) { border-top: 3px solid #6d5bd0; }
.insights-grid .insight-card:nth-child(2) { border-top: 3px solid #2563a8; }
.insights-grid .insight-card:nth-child(3) { border-top: 3px solid #b7791f; }
.insights-grid .insight-card:nth-child(1) .insight-icon { background: #6d5bd0 !important; }
.insights-grid .insight-card:nth-child(2) .insight-icon { background: #2563a8 !important; }
.insights-grid .insight-card:nth-child(3) .insight-icon { background: #b7791f !important; }

/* Resumo executivo: cores semânticas e separadas das métricas do relatório. */
.resumo-grid .resumo-card:nth-child(1) { border-top: 3px solid #2563a8; }
.resumo-grid .resumo-card:nth-child(2) { border-top: 3px solid #0f766e; }
.resumo-grid .resumo-card:nth-child(3) { border-top: 3px solid #6d5bd0; }
.resumo-grid .resumo-card:nth-child(4) { border-top: 3px solid #b7791f; }
.resumo-grid .resumo-card:nth-child(1) .resumo-icon { background: #2563a8 !important; }
.resumo-grid .resumo-card:nth-child(2) .resumo-icon { background: #0f766e !important; }
.resumo-grid .resumo-card:nth-child(3) .resumo-icon { background: #6d5bd0 !important; }
.resumo-grid .resumo-card:nth-child(4) .resumo-icon { background: #b7791f !important; }

/* Relatórios: cada métrica conserva a mesma cor em título, gráfico e recomendação. */
.grafico-full > h3 .ui-icon--heading { color: #0f766e; }
.graficos-grid .grafico-container:nth-child(1) h4 .ui-icon--heading { color: #6d5bd0; }
.graficos-grid .grafico-container:nth-child(2) h4 .ui-icon--heading { color: #4d7c0f; }
.graficos-grid .grafico-container:nth-child(3) h4 .ui-icon--heading { color: #c2410c; }
.graficos-grid .grafico-container:nth-child(4) h4 .ui-icon--heading { color: #0369a1; }

.analises-section > h2 .ui-icon--heading { color: #2563a8; }
.analises-grid .analise-card:nth-child(1) h3 .ui-icon--heading { color: #2563a8; }
.analises-grid .analise-card:nth-child(2) h3 .ui-icon--heading { color: #6d5bd0; }
.analises-grid .analise-card:nth-child(3) h3 .ui-icon--heading { color: #0f766e; }
.analises-grid .analise-card:nth-child(4) h3 .ui-icon--heading { color: #b7791f; }
.analises-grid #progressFrequencia { background: #2563a8 !important; }
.analises-grid #percentualFrequencia { color: #2563a8; font-weight: 750; }
.analises-grid #progressConsistencia { background: #6d5bd0 !important; }
.analises-grid #percentualConsistencia { color: #6d5bd0; font-weight: 750; }

.recomendacoes-section > h2 .ui-icon--heading { color: #b7791f; }
.recomendacoes-grid .recomendacao-card:nth-child(1) { border-top: 3px solid #6d5bd0; }
.recomendacoes-grid .recomendacao-card:nth-child(2) { border-top: 3px solid #4d7c0f; }
.recomendacoes-grid .recomendacao-card:nth-child(3) { border-top: 3px solid #c2410c; }
.recomendacoes-grid .recomendacao-card:nth-child(4) { border-top: 3px solid #0369a1; }
.recomendacoes-grid .recomendacao-card:nth-child(1) .recomendacao-icon { background: #6d5bd0 !important; }
.recomendacoes-grid .recomendacao-card:nth-child(2) .recomendacao-icon { background: #4d7c0f !important; }
.recomendacoes-grid .recomendacao-card:nth-child(3) .recomendacao-icon { background: #c2410c !important; }
.recomendacoes-grid .recomendacao-card:nth-child(4) .recomendacao-icon { background: #0369a1 !important; }

.perfil-header .stat-rapida {
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.update-btn,
.submit-btn,
.btn-editar,
.btn-exportar,
.auth-button,
.btn-primary,
.activity-controls .primary,
.form-contato button,
.login-container button[type="submit"],
.auth-form button[type="submit"] {
  color: #ffffff !important;
  background: var(--brand-gradient) !important;
  border-color: transparent !important;
}

.update-btn:hover,
.submit-btn:hover,
.btn-editar:hover,
.btn-exportar:hover,
.auth-button:hover,
.btn-primary:hover,
.activity-controls .primary:hover,
.form-contato button:hover,
.login-container button[type="submit"]:hover,
.auth-form button[type="submit"]:hover {
  background: var(--brand-gradient-hover) !important;
}

.btn-relatorios,
.btn-secondary,
.diagnostic-link.secondary {
  color: #0f766e !important;
  background: #ecf4f1 !important;
  border-color: #b9d0c8 !important;
}

.progress-bar,
.progress-analise .progress-bar {
  background: #e7efec !important;
}

.progress,
.progress-fill,
.progress-analise .progress-fill {
  background: #0f766e;
}

input,
select,
textarea,
.form-contato input,
.form-contato textarea {
  color: #162a24 !important;
  background: #ffffff !important;
  border-color: #b9cec7 !important;
}

input:focus,
select:focus,
textarea:focus,
.form-contato input:focus,
.form-contato textarea:focus {
  border-color: #0f766e !important;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14) !important;
}

thead {
  background: var(--brand-gradient) !important;
}

.page-back,
.diagnostic-back {
  color: #0f766e !important;
  background: #ecf4f1 !important;
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.12) !important;
}

.page-back:hover,
.page-back:focus-visible,
.diagnostic-back:hover,
.diagnostic-back:focus-visible {
  color: #115e59 !important;
  background: #d8e9e3 !important;
}

body:has(.login-container),
body:has(.auth-container),
body:has(.onboarding-container) {
  background: radial-gradient(circle at 20% 15%, #dcece7 0, transparent 34%),
    linear-gradient(145deg, #eef5f2 0%, #f8faf9 72%) !important;
}

.lista-servicos li,
.live-stats div,
.gps-status,
.photo-upload-area:hover {
  background: #ecf4f1 !important;
}

.card h2,
.card p,
.relatorios-header-section h1,
.historico-header-section h1,
.metrics-section h2,
.actions-section h2,
.weekly-section h2,
.metric-header h3,
.metrica-info h3,
.detalhes-coluna h3,
.login-container h2,
.auth-form-section h1,
.onboarding-container h1 {
  color: #162a24 !important;
}

.health-footer,
footer.health-footer,
body > footer:not(.health-footer) {
  color: #dcece7 !important;
  background: #162a24 !important;
  border-top-color: #29483e !important;
}

/* Ícones lineares próprios: substituem os emojis decorativos da interface. */
.ui-icon {
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
  display: inline-block;
  vertical-align: -0.16em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ui-icon--heading { margin-right: .42em; color: #0f766e; }
.metric-icon .ui-icon,
.estatistica-icon .ui-icon,
.metrica-icon .ui-icon,
.metrica-hoje-icon .ui-icon,
.resumo-icon .ui-icon,
.insight-icon .ui-icon,
.recomendacao-icon .ui-icon,
.action-icon .ui-icon { width: 1.45em; height: 1.45em; vertical-align: middle; }

.quality-stars { display: inline-flex; gap: 2px; color: #c58b1c; }
.quality-stars .ui-icon { width: 1em; height: 1em; fill: currentColor; stroke-width: 1.35; }

.health-footer h3,
.health-footer a,
footer.health-footer h3,
footer.health-footer a {
  color: #ffffff !important;
}

.health-footer .footer-bottom,
footer.health-footer .footer-bottom {
  color: #a9beb6 !important;
  border-top-color: #29483e !important;
}

@media (max-width: 760px) {
  .welcome-banner,
  .perfil-header,
  .card {
    border-radius: 14px !important;
  }
}
