/* V242.17.1 — Configurações no design system da VECONI (tokens --vf-*).
   As cores fixas do CSS legado das Configurações deixavam cartões claros dentro do tema
   escuro. Aqui as mesmas peças usam os tokens, que já têm valores próprios em cada tema. */
html:has(#app:is([data-route="configuracoes"], [data-route="dispositivos"])),
html:has(#app:is([data-route="configuracoes"], [data-route="dispositivos"])) body,
html:has(#app:is([data-route="configuracoes"], [data-route="dispositivos"])) .shell,
html main#app:is([data-route="configuracoes"], [data-route="dispositivos"]) { background: var(--vf-bg); }

html .settings-mobile-v2 { color: var(--vf-text); }

/* Status da sincronização */
html .settings-mobile-v2 .settings-sync-hero {
  border-color: color-mix(in srgb, var(--vf-brand) 30%, var(--vf-line));
  background: var(--vf-surface);
  box-shadow: var(--vf-shadow-1);
  color: var(--vf-accent-text);
}
html .settings-mobile-v2 .settings-sync-copy b { color: var(--vf-accent-text); }
html .settings-mobile-v2 .settings-sync-copy small { color: var(--vf-text-2); }
html .settings-mobile-v2 .settings-sync-hero[data-sync-state="error"] {
  border-color: color-mix(in srgb, var(--vf-neg) 32%, var(--vf-line));
  background: color-mix(in srgb, var(--vf-neg-soft) 70%, var(--vf-surface));
}
html .settings-mobile-v2 .settings-sync-hero[data-sync-state="error"] .settings-sync-copy b { color: var(--vf-neg); }

/* Grupos e linhas */
html .settings-mobile-v2 .settings-group-heading { display: grid; gap: 2px; margin-bottom: 12px; }
html .settings-mobile-v2 .settings-group-heading h2 { color: var(--vf-ink); }
html .settings-mobile-v2 .settings-group-heading p { color: var(--vf-text-3); }
html .settings-mobile-v2 .settings-group-list,
html .settings-mobile-v2 .settings-group:last-of-type .settings-group-list {
  border-color: var(--vf-line);
  background: var(--vf-surface);
  box-shadow: var(--vf-shadow-1);
}
html .settings-mobile-v2 .settings-list-row { border-bottom-color: var(--vf-line); color: var(--vf-ink); }
html .settings-mobile-v2 .settings-list-row:hover { background: var(--vf-surface-2); }
html .settings-mobile-v2 :is(.settings-sync-icon, .settings-row-icon) { background: var(--vf-brand-soft); color: var(--vf-accent-text); }
html .settings-mobile-v2 .settings-row-copy b { color: var(--vf-ink); }
html .settings-mobile-v2 .settings-row-copy small { color: var(--vf-text-2); }
html .settings-mobile-v2 :is(.settings-sync-hero, .settings-list-row) > svg { color: var(--vf-text-3); }
html .settings-mobile-v2 .settings-list-row.is-danger,
html .settings-mobile-v2 .settings-list-row.is-danger .settings-row-copy b,
html .settings-mobile-v2 .settings-list-row.is-danger > svg { color: var(--vf-neg); }
html .settings-mobile-v2 .settings-list-row.is-danger .settings-row-icon { background: var(--vf-neg-soft); color: var(--vf-neg); }
html .settings-mobile-v2 .settings-list-row.is-danger:hover { background: color-mix(in srgb, var(--vf-neg-soft) 60%, var(--vf-surface)); }
html .settings-mobile-v2 :is(.settings-list-row, .settings-sync-hero):focus-visible { outline: none; box-shadow: inset var(--vf-focus); }
html .settings-mobile-v2 .settings-version { color: var(--vf-text-3); font-size: 12.5px; text-align: center; }

/* Aplicativo: versão e atualização deste aparelho */
html .settings-mobile-v2 .settings-app-update {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 78px;
  padding: 11px 18px;
}
html .settings-mobile-v2 .settings-app-update .settings-row-copy { display: grid; gap: 2px; min-width: 0; }
html .settings-mobile-v2 .settings-app-update .settings-row-copy b { font-feature-settings: var(--vf-num); }
html .settings-mobile-v2 .settings-app-update .settings-app-update-reason { color: var(--vf-warn); }
html .settings-mobile-v2 .settings-app-update [hidden] { display: none !important; }
html .settings-mobile-v2 .settings-app-update .btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
html .settings-mobile-v2 .settings-app-update .btn svg { width: 17px; height: 17px; }
@media (max-width: 359px) {
  html .settings-mobile-v2 .settings-app-update { grid-template-columns: 44px minmax(0, 1fr); gap: 10px; padding-inline: 12px; }
  html .settings-mobile-v2 .settings-app-update .btn { grid-column: 1 / -1; }
}

/* Consignados (entrada anexada às Configurações) acompanha a coluna e o tema */
html main#app[data-route="configuracoes"] > .consignment-entry {
  width: min(100%, 880px);
  margin: 0 auto 32px;
  border-color: var(--vf-line);
  border-radius: 20px;
  background: var(--vf-surface);
  box-shadow: var(--vf-shadow-1);
  color: var(--vf-text);
}
html main#app[data-route="configuracoes"] > .consignment-entry :is(h2, h3, b, strong) { color: var(--vf-ink); }
html main#app[data-route="configuracoes"] > .consignment-entry :is(p, small, .muted) { color: var(--vf-text-2); }
html main#app[data-route="configuracoes"] > .consignment-entry .btn-light {
  border-color: var(--vf-line);
  background: var(--vf-surface-2);
  color: var(--vf-ink);
  text-decoration: none;
}

/* Folhas abertas pelas Configurações */
html .settings-sheet .mobile-field input { border-color: var(--vf-line); background: var(--vf-surface-2); color: var(--vf-ink); }
html .settings-sheet .mobile-field input:focus { border-color: var(--vf-brand); box-shadow: var(--vf-focus); }
html .settings-account-readonly { border-color: var(--vf-line); background: var(--vf-surface-2); }
html .settings-account-readonly span { color: var(--vf-text-3); }
html .settings-account-readonly b { color: var(--vf-ink); }
html .settings-backup-list > button { border-color: var(--vf-line); background: var(--vf-surface); color: var(--vf-ink); }
html .settings-backup-list > button > svg:first-child { background: var(--vf-brand-soft); color: var(--vf-accent-text); }
html .settings-backup-list > button small { color: var(--vf-text-2); }
html .settings-backup-list > button > svg:last-child { color: var(--vf-text-3); }
html .settings-backup-list > button.danger > svg:first-child { background: var(--vf-neg-soft); color: var(--vf-neg); }
