/* Nina Web Dom196 | Design System compartilhado
   Objetivo: mesma hierarquia, espaçamento e componentes em todos os pilares,
   Planner, Agenda, Conexões e telas financeiras, sem reescrever fluxos funcionais.
   Carregado depois de theme.css. Não altera gráficos, calendário ou tabelas.
*/
:root {
  --nu-radius-hero: 22px;
  --nu-radius-card: 18px;
  --nu-radius-field: 11px;
  --nu-radius-action: 11px;
  --nu-space-page: clamp(16px, 2.2vw, 26px);
  --nu-shadow: 0 6px 22px rgba(33, 44, 43, .035);
  --nu-transition: .16s ease;
}

/* Navegação transversal comum a todos os módulos principais. */
.nina-module-nav {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin: 0 0 20px;
  padding: 0;
  max-width: 100%;
}
.nina-module-nav a,
.nina-module-nav .nina-module-nav-active {
  display: inline-flex;
  align-items: center;
  min-height: 39px;
  padding: 8px 14px;
  border: 1px solid var(--nina-border);
  border-radius: 999px;
  background: var(--nina-surface);
  color: var(--nina-text-secondary);
  text-decoration: none;
  font-size: .86rem;
  font-weight: 650;
  line-height: 1.25;
  white-space: nowrap;
  transition: color var(--nu-transition), background var(--nu-transition), border-color var(--nu-transition);
}
.nina-module-nav a:hover {
  color: var(--nina-accent);
  border-color: var(--nina-accent);
  background: var(--nina-accent-soft);
}
.nina-module-nav .nina-module-nav-active {
  background: var(--nina-accent-soft);
  color: var(--nina-accent);
  border-color: var(--nina-border-strong);
}
.nina-module-nav :is(a, span):focus-visible {
  outline: 3px solid var(--nina-accent);
  outline-offset: 2px;
}

/* Semântica visual: cada pilar conserva sua cor, mas compartilha a forma. */
.nina-pillar, .nina-pillar * { box-sizing: border-box; }
.rel-wrap { --np-accent: #76518b; --np-tint: #f3eef8; }
.pr-wrap  { --np-accent: #6d5a8d; --np-tint: #f2eff8; }
.lz-wrap  { --np-accent: #955f41; --np-tint: #fbf2e9; }
html[data-theme-effective="dark"] .rel-wrap { --np-accent: #c4a2de; --np-tint: #33263d; }
html[data-theme-effective="dark"] .pr-wrap  { --np-accent: #c9afe8; --np-tint: #30283c; }
html[data-theme-effective="dark"] .lz-wrap  { --np-accent: #e6b28b; --np-tint: #392a25; }
html[data-theme-effective="dark"] :is(.rel-wrap .rel-btn, .pr-wrap .pr-btn, .lz-wrap .lz-btn) {
  background: #51405f;
  border-color: #ad93c0;
  color: #fff !important;
}

.nina-pillar--relationships { --np-accent: #76518b; --np-tint: #f3eef8; }
.nina-pillar--purpose       { --np-accent: #6d5a8d; --np-tint: #f2eff8; }
.nina-pillar--leisure       { --np-accent: #955f41; --np-tint: #fbf2e9; }
.nina-pillar--career        { --np-accent: #32796f; --np-tint: #e9f4ef; }
.nina-pillar--homecare      { --np-accent: #31796e; --np-tint: #eaf4ef; }
html[data-theme-effective="dark"] .nina-pillar--relationships { --np-accent: #c4a2de; --np-tint: #33263d; }
html[data-theme-effective="dark"] .nina-pillar--purpose       { --np-accent: #c9afe8; --np-tint: #30283c; }
html[data-theme-effective="dark"] .nina-pillar--leisure       { --np-accent: #e6b28b; --np-tint: #392a25; }
html[data-theme-effective="dark"] .nina-pillar--career        { --np-accent: #92d0bb; --np-tint: #203c34; }
html[data-theme-effective="dark"] .nina-pillar--homecare      { --np-accent: #92cdb9; --np-tint: #203b32; }

:is(.nina-pillar, .nina-life, .registry, .conn-wrap, .rel-wrap, .pr-wrap, .lz-wrap, .nina-career, .porto) {
  color: var(--nina-text);
}
:is(.rel-wrap, .pr-wrap, .lz-wrap, .nina-career, .porto, .nina-life, .registry, .conn-wrap) {
  min-width: 0;
  overflow-wrap: break-word;
}
/* Componentes de Carreira deixam de definir tokens fixos para tema claro. */
.nina-career {
  --career-ink: var(--nina-text);
  --career-muted: var(--nina-text-secondary);
  --career-border: var(--nina-border);
  --career-panel: var(--nina-surface);
  --career-accent: var(--nina-accent);
  --career-pale: var(--nina-accent-soft);
}
.nina-career .career-hero-note {
  background: var(--nina-surface);
  border: 1px solid var(--nina-border);
  box-shadow: none;
  border-radius: 16px;
  padding: 22px;
}
.nina-career :is(.career-pill, .career-empty, .career-sections-nav a) {
  background: var(--nina-surface-soft);
  color: var(--nina-text-secondary);
  border-color: var(--nina-border);
}
:is(.rel-wrap .rel-alert, .pr-wrap .pr-notice, .lz-wrap .lz-notice) {
  border: 1px solid var(--nina-border);
  border-radius: 11px;
  background: var(--nina-success-soft);
  color: var(--nina-text);
  padding: 12px;
}
:is(.rel-wrap .rel-avatar, .lz-wrap .lz-chip) {
  background: var(--nina-accent-soft);
  color: var(--nina-accent);
}
.pr-wrap .pr-item p { color: var(--nina-text-secondary); }

/* Cabeçalhos simples: apresentação vertical; outros heróis mantêm sua composição. */
.nina-pillar :is(.rel-head, .pr-head, .lz-head).nina-pillar-hero {
  display: block;
  padding: clamp(22px, 3.2vw, 34px);
  margin: 0 0 18px;
  border: 1px solid var(--nina-border);
  background: linear-gradient(115deg, var(--np-tint), var(--nina-surface));
  border-radius: var(--nu-radius-hero);
  box-shadow: none;
}
.nina-pillar :is(.rel-head, .pr-head, .lz-head).nina-pillar-hero h1 {
  margin: 8px 0 9px;
  font-family: inherit;
  color: var(--nina-text);
  font-size: clamp(1.8rem, 3vw, 2.65rem);
  font-weight: 750;
  line-height: 1.17;
  letter-spacing: -.035em;
}
.nina-pillar :is(.rel-head, .pr-head, .lz-head).nina-pillar-hero p {
  margin: 0;
  max-width: 690px;
  color: var(--nina-text-secondary);
  font-size: .97rem;
  line-height: 1.6;
}
.nina-pillar :is(.rel-pill, .pr-pill, .lz-pill) {
  display: inline-flex;
  padding: 5px 10px;
  border: 1px solid color-mix(in srgb, var(--np-accent) 27%, transparent);
  border-radius: 999px;
  color: var(--np-accent);
  background: var(--np-tint);
  font-size: .76rem;
  font-weight: 750;
}
/* Cabeçalhos compostos. A navegação compartilhada fica logo abaixo. */
.nina-pillar .career-hero.nina-pillar-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(235px, .7fr);
  gap: clamp(16px, 3vw, 26px);
  border: 1px solid var(--nina-border);
  border-radius: var(--nu-radius-hero);
  background: linear-gradient(115deg, var(--np-tint), var(--nina-surface));
  padding: clamp(22px, 3.2vw, 34px);
  box-shadow: none;
}
.nina-pillar .career-hero.nina-pillar-hero h1 {
  max-width: 780px;
  font-family: inherit;
  font-size: clamp(1.85rem, 3vw, 2.65rem);
  line-height: 1.17;
  letter-spacing: -.035em;
  color: var(--nina-text);
}
.nina-pillar .career-hero.nina-pillar-hero h1 em {
  color: var(--np-accent);
  font-weight: inherit;
}
.nina-pillar .career-hero.nina-pillar-hero p { color: var(--nina-text-secondary); }
.nina-pillar .porto-hero.nina-pillar-hero {
  background: linear-gradient(115deg, var(--np-tint), var(--nina-surface));
  border: 1px solid var(--nina-border);
  border-radius: var(--nu-radius-hero);
  padding: clamp(22px, 3.2vw, 34px);
}
.nina-pillar .porto-hero.nina-pillar-hero h1 {
  font-family: inherit;
  font-size: clamp(1.85rem, 3vw, 2.65rem);
  letter-spacing: -.035em;
  color: var(--nina-text);
}
.nina-pillar .porto-hero.nina-pillar-hero h1 em { color: var(--np-accent); font-family: inherit; }
.nina-pillar .porto-hero.nina-pillar-hero p { color: var(--nina-text-secondary); }

/* Cards: mesma geometria, superfície e contorno. Respeita grids originais. */
:is(.rel-wrap .rel-card, .pr-wrap .pr-card, .lz-wrap .lz-card,
       .nina-career .career-panel, .nina-career .career-form-panel,
       .porto .porto-panel, .porto .porto-blank,
       .nina-life .nina-map-panel, .nina-life .nina-life-panel,
       .nina-life .nina-life-hero, .nina-life .nina-life-submodule-head,
       .nina-life .nina-planner-hero, .nina-agenda .agenda-hero,
       .nina-agenda .agenda-filter, .nina-agenda .agenda-calendar,
       .nina-agenda .agenda-summary, .nina-agenda .agenda-upcoming,
       .conn-wrap .conn-card, .registry .registry-panel,
       .registry .registry-hero, .registry .registry-form-panel) {
  border: 1px solid var(--nina-border);
  border-radius: var(--nu-radius-card);
  background-color: var(--nina-surface);
  box-shadow: var(--nu-shadow);
  color: var(--nina-text);
}
:is(.rel-wrap .rel-card, .pr-wrap .pr-card, .lz-wrap .lz-card, .conn-wrap .conn-card) {
  padding: clamp(17px, 2.5vw, 25px);
}
:is(.rel-wrap, .pr-wrap, .lz-wrap, .conn-wrap) :is(p, small) { line-height: 1.55; }
:is(.rel-wrap .rel-head, .pr-wrap .pr-head, .lz-wrap .lz-head,
       .rel-wrap .rel-row, .pr-wrap .pr-heading, .lz-wrap .lz-heading,
       .conn-wrap header) p {
  color: var(--nina-text-secondary);
}
:is(.rel-wrap .rel-empty, .pr-wrap .pr-empty, .lz-wrap .lz-empty,
       .rel-wrap .rel-footer, .pr-wrap .pr-foot, .lz-wrap .lz-footer,
       .conn-wrap .conn-muted) { color: var(--nina-text-secondary); }
:is(.rel-wrap .rel-item, .pr-wrap .pr-item, .lz-wrap .lz-item,
       .conn-wrap .conn-row, .conn-wrap .conn-group) { border-color: var(--nina-border); }
:is(.rel-wrap .rel-detail small, .pr-wrap .pr-date, .lz-wrap .lz-item p,
       .conn-wrap .conn-row p) { color: var(--nina-text-secondary); }

/* Botões e campos de modules antigos (cor de pilar + mesma altura e foco). */
:is(.rel-wrap, .pr-wrap, .lz-wrap, .nina-career, .porto) :is(.rel-btn, .pr-btn, .lz-btn, .career-button, .porto-btn) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: var(--nu-radius-action);
  font-family: inherit;
  font-size: .89rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--nu-transition), border-color var(--nu-transition), transform var(--nu-transition);
}
.rel-wrap .rel-btn, .pr-wrap .pr-btn, .lz-wrap .lz-btn {
  background: var(--np-accent, var(--nina-accent));
  border: 1px solid var(--np-accent, var(--nina-accent));
  color: #fff !important;
}
.nina-pillar--career .career-button:not(.career-button-soft):not(.career-button-danger),
.nina-pillar--homecare .porto-btn:not(.porto-btn-outline) {
  background: #236756;
  border-color: #236756;
  color: #fff !important;
}
:is(.rel-wrap, .pr-wrap, .lz-wrap, .nina-career, .porto) :is(.rel-btn, .pr-btn, .lz-btn, .career-button, .porto-btn):hover { filter: brightness(.96); }
:is(.rel-wrap, .pr-wrap, .lz-wrap, .nina-career, .porto, .nina-life, .registry, .conn-wrap)
  :is(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--nina-accent);
  outline-offset: 3px;
}
:is(.rel-wrap, .pr-wrap, .lz-wrap, .nina-career, .porto, .conn-wrap)
  :is(.rel-field, .pr-field, .lz-field, .career-field, .porto-field, .conn-field)
  :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  width: 100%;
  max-width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--nina-border-strong);
  border-radius: var(--nu-radius-field);
  background: var(--nina-surface);
  color: var(--nina-text);
  font: inherit;
}
:is(.rel-wrap, .pr-wrap, .lz-wrap, .nina-career, .porto, .conn-wrap)
  :is(.rel-field, .pr-field, .lz-field, .career-field, .porto-field, .conn-field) label {
  color: var(--nina-text);
  font-weight: 650;
}
:is(.rel-wrap, .pr-wrap, .lz-wrap, .nina-career, .porto, .conn-wrap) :is(.errorlist, .career-form-errors, .porto-form-errors) {
  color: var(--nina-danger);
}
:is(.rel-wrap, .pr-wrap, .lz-wrap) :is(.rel-back, .pr-back, .lz-back) { color: var(--nina-accent); }
:is(.rel-wrap .rel-detail a, .pr-wrap .pr-item a, .lz-wrap .lz-item a, .conn-wrap a:not(.nina-module-nav a)) {
  color: var(--nina-accent);
  text-underline-offset: 3px;
}

/* Planner e Agenda: tipografia comum, sem alterar grades/calendário. */
.nina-life, .nina-agenda { --nu-module-ink: var(--nina-text); }
.nina-life :is(.nina-planner-hero, .nina-life-submodule-head, .nina-life-hero, .agenda-hero) {
  border: 1px solid var(--nina-border);
  border-radius: var(--nu-radius-hero);
  background: linear-gradient(115deg, var(--nina-accent-soft), var(--nina-surface));
  box-shadow: none;
}
.nina-life :is(.nina-planner-hero, .nina-life-submodule-head, .nina-life-hero, .agenda-hero) h1 {
  font-family: inherit;
  font-size: clamp(1.8rem, 3vw, 2.65rem);
  font-weight: 750;
  line-height: 1.17;
  letter-spacing: -.035em;
  color: var(--nina-text);
}
.nina-life :is(.nina-planner-hero, .nina-life-submodule-head, .nina-life-hero, .agenda-hero) p {
  color: var(--nina-text-secondary);
  opacity: 1;
  line-height: 1.6;
}
.nina-life :is(.nina-life-button, .agenda-button) { border-radius: var(--nu-radius-action); }
.nina-life :is(.nina-life-breadcrumb, .nina-life-back),
.nina-agenda .agenda-hero p { color: var(--nina-text-secondary); }
.nina-life .nina-module-nav { margin: 16px 0 20px; }

/* Conexões: abandonar o estilo visual legado roxo sem mexer nos vínculos. */
.conn-wrap { color: var(--nina-text); }
.conn-wrap header h1 { color: var(--nina-text); }
.conn-wrap :is(.conn-card, .conn-form) { background: var(--nina-surface); color: var(--nina-text); }
.conn-wrap .conn-nav a { background: var(--nina-accent-soft); color: var(--nina-accent); }
.conn-wrap .conn-primary {
  min-height: 42px;
  border: 1px solid var(--nina-accent);
  border-radius: var(--nu-radius-action);
  background: var(--nina-accent);
  color: var(--nina-page);
  font: inherit;
  font-weight: 700;
}

/* Financeiro: uniformizar os títulos e as superfícies sem tocar em tabelas,
   gráficos, cálculos, filtros, indicadores ou regras de cor de saldo. */
.page-container > .finance-header,
.page-container :is(.budget-header, .transactions-header, .goals-header,
  .analytics-header, .wealth-header, .cards-header, .invoice-header,
  .assets-header, .wishlist-header, .rec-header, .account-header,
  .projects-header, .forecast-heading, .onboarding-header) {
  border: 1px solid var(--nina-border);
  border-radius: var(--nu-radius-hero);
  padding: clamp(20px, 3vw, 30px);
  margin-bottom: 18px;
  background: linear-gradient(115deg, var(--nina-accent-soft), var(--nina-surface));
  color: var(--nina-text);
}
.page-container :is(.finance-header, .budget-header, .transactions-header,
  .goals-header, .analytics-header, .wealth-header, .cards-header,
  .assets-header, .wishlist-header, .rec-header, .account-header,
  .projects-header, .forecast-heading) h1 {
  font-family: inherit;
  font-size: clamp(1.8rem, 3vw, 2.65rem);
  line-height: 1.17;
  letter-spacing: -.035em;
  color: var(--nina-text);
}
.page-container :is(.finance-header, .budget-header, .transactions-header,
  .goals-header, .analytics-header, .wealth-header, .cards-header,
  .assets-header, .wishlist-header, .rec-header, .account-header,
  .projects-header, .forecast-heading) p {
  color: var(--nina-text-secondary);
  line-height: 1.6;
}
.page-container :is(.finance-menu-card, .budget-page .panel, .transactions-page .panel,
  .goals-page .panel, .analytics-page .panel, .wishlist-page .panel) {
  border-color: var(--nina-border);
  border-radius: var(--nu-radius-card);
}
.page-container > .finance-header + .nina-module-nav { margin: 0 0 24px; }

/* Visual em telas compactas: navegação pode rolar sem empilhar a página. */
@media (max-width: 760px) {
  .nina-module-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    padding: 0 0 8px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }
  .nina-module-nav > * { flex: none; scroll-snap-align: start; }
  .nina-pillar .career-hero.nina-pillar-hero { grid-template-columns: minmax(0, 1fr); }
  .nina-pillar .porto-hero.nina-pillar-hero { flex-direction: column; align-items: stretch; }
  .nina-pillar .porto-hero-mark { display: none; }
  .nina-life .nina-planner-hero { grid-template-columns: minmax(0, 1fr); }
  .nina-pillar :is(.rel-head, .pr-head, .lz-head).nina-pillar-hero { padding: 20px; }
  .page-container > .finance-header,
  .page-container :is(.budget-header, .transactions-header, .goals-header,
      .analytics-header, .wealth-header, .cards-header, .assets-header,
      .wishlist-header, .rec-header, .account-header, .projects-header,
      .forecast-heading) { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .nina-module-nav a,
  :is(.rel-wrap, .pr-wrap, .lz-wrap, .nina-career, .porto) :is(.rel-btn, .pr-btn, .lz-btn, .career-button, .porto-btn) {
    transition: none;
  }
}
